39 typedef std::pair<std::string,integer> DATA_TYPE;
41 mutable std::vector<DATA_TYPE> data;
43 BinarySearch() { data.clear(); data.reserve(256); }
44 ~BinarySearch() { data.clear(); }
46 void clear() { data.clear(); data.reserve(256); }
51 get_elem(
integer i )
const {
return data[size_t(i)]; }
53 integer search( std::string
const &
id )
const;
54 void insert( std::string
const &
id,
integer position );
59 #ifndef DOXYGEN_SHOULD_SKIP_THIS
63 Utils::Malloc<real_type> m_mem;
64 Utils::Malloc<real_type*> m_mem_p;
65 Utils::Malloc<void*> m_mem_splines;
66 Utils::Malloc<int> m_mem_int;
78 Spline ** m_splines{
nullptr};
79 int * m_is_monotone{
nullptr};
81 std::map<string,integer> m_header_to_position;
121 string const &
name()
const {
return m_name; }
132 void get_headers( std::vector<std::string> & names )
const;
147 {
return m_is_monotone[i]; }
239 return m_splines[idx];
525 vector<real_type> & vals
536 vector<real_type> & vals
547 vector<real_type> & vals
558 vector<real_type> & vals
728 eval( vec_real_type
const & vec, GenericContainer & vals )
const;
737 vec_string_type
const & columns,
738 GenericContainer & vals
748 vec_real_type
const & vec,
749 vec_string_type
const & columns,
750 GenericContainer & vals
767 GenericContainer & vals
777 vec_real_type
const & zetas,
779 GenericContainer & vals
791 vec_string_type
const & columns,
792 GenericContainer & vals
802 vec_real_type
const & zetas,
804 vec_string_type
const & columns,
805 GenericContainer & vals
821 GenericContainer & vals
833 vec_real_type
const & zetas,
835 GenericContainer & vals
849 vec_string_type
const & columns,
850 GenericContainer & vals
862 vec_real_type
const & zetas,
864 vec_string_type
const & columns,
865 GenericContainer & vals
881 GenericContainer & vals
890 vec_real_type
const & vec,
891 GenericContainer & vals
901 vec_string_type
const & columns,
902 GenericContainer & vals
912 vec_real_type
const & vec,
913 vec_string_type
const & columns,
914 GenericContainer & vals
931 GenericContainer & vals
941 vec_real_type
const & zetas,
943 GenericContainer & vals
955 vec_string_type
const & columns,
956 GenericContainer & vals
966 vec_real_type
const & zetas,
968 vec_string_type
const & columns,
969 GenericContainer & vals
985 GenericContainer & vals
997 vec_real_type
const & zetas,
999 GenericContainer & vals
1013 vec_string_type
const & columns,
1014 GenericContainer & vals
1026 vec_real_type
const & zetas,
1028 vec_string_type
const & columns,
1029 GenericContainer & vals
1046 GenericContainer & vals
1055 vec_real_type
const & vec,
1056 GenericContainer & vals
1066 vec_string_type
const & columns,
1067 GenericContainer & vals
1076 vec_real_type
const & vec,
1077 vec_string_type
const & columns,
1078 GenericContainer & vals
1089 GenericContainer & vals
1099 vec_real_type
const & zetas,
1101 GenericContainer & vals
1113 vec_string_type
const & columns,
1114 GenericContainer & vals
1124 vec_real_type
const & zetas,
1126 vec_string_type
const & columns,
1127 GenericContainer & vals
1143 GenericContainer & vals
1155 vec_real_type
const & zetas,
1157 GenericContainer & vals
1171 vec_string_type
const & columns,
1172 GenericContainer & vals
1184 vec_real_type
const & zetas,
1186 vec_string_type
const & columns,
1187 GenericContainer & vals
1203 GenericContainer & vals
1212 vec_real_type
const & vec,
1213 GenericContainer & vals
1223 vec_string_type
const & columns,
1224 GenericContainer & vals
1233 vec_real_type
const & vec,
1234 vec_string_type
const & columns,
1235 GenericContainer & vals
1250 GenericContainer & vals
1260 vec_real_type
const & zetas,
1262 GenericContainer & vals
1274 vec_string_type
const & columns,
1275 GenericContainer & vals
1285 vec_real_type
const & zetas,
1287 vec_string_type
const & columns,
1288 GenericContainer & vals
1303 GenericContainer & vals
1315 vec_real_type
const & zetas,
1317 GenericContainer & vals
1331 vec_string_type
const & columns,
1332 GenericContainer & vals
1344 vec_real_type
const & zetas,
1346 vec_string_type
const & columns,
1347 GenericContainer & vals
1373 char const * headers[],
1384 setup( GenericContainer
const & gc );
1391 { this->
setup(gc); }
1401 string info()
const;
1407 info( ostream_type & stream )
const
1408 { stream << this->
info() <<
'\n'; }
1416 #ifdef SPLINES_BACK_COMPATIBILITY
1417 int isMonotone(
integer i )
const {
return m_is_monotone[i]; }
1418 integer numPoints()
const {
return m_npts; }
1419 integer numSplines()
const {
return m_nspl; }
1421 real_type const * xNodes()
const {
return m_X; }
1429 real_type yMin(
char const spl[] )
const {
return this->
y_min(spl); }
1430 real_type yMax(
char const spl[] )
const {
return this->
y_max(spl); }
1432 Spline * getSpline(
char const hdr[] )
const {
return this->
get_spline( hdr ); }
Definition Splines.hh:372
virtual real_type DDDDD(real_type) const
Definition Splines.hh:784
virtual real_type eval(real_type x) const =0
virtual real_type DD(real_type x) const =0
virtual real_type DDDD(real_type) const
Definition Splines.hh:779
virtual real_type D(real_type x) const =0
virtual real_type DDD(real_type x) const =0
Splines Management Class.
Definition SplineSet.hxx:32
Spline * get_spline(char const hdr[]) const
Definition SplineSet.hxx:237
void eval2_DD(real_type zeta, char const indep[], GenericContainer &vals) const
Definition SplineSet.hxx:1140
void info(ostream_type &stream) const
Definition SplineSet.hxx:1407
real_type DDDDD(real_type x, integer spl) const
Definition SplineSet.hxx:341
void eval2_D(real_type zeta, char const indep[], vec_string_type const &columns, GenericContainer &vals) const
Definition SplineSet.hxx:1010
real_type y_max(integer spl) const
Definition SplineSet.hxx:203
void eval2_D(integer spl, real_type zeta, vector< real_type > &vals) const
Definition SplineSet.cc:639
void eval2_DDD(real_type zeta, char const indep[], vec_string_type const &columns, GenericContainer &vals) const
Definition SplineSet.hxx:1328
void eval_DDDDD(real_type x, real_type vals[], integer incy=1) const
real_type DD(real_type x, integer spl) const
Definition SplineSet.hxx:287
real_type eval_DDD(real_type x, integer spl) const
Definition SplineSet.hxx:314
void eval_DDDD(real_type x, real_type vals[], integer incy=1) const
void eval2(real_type zeta, char const indep[], vec_string_type const &columns, GenericContainer &vals) const
Definition SplineSet.hxx:846
string name_list() const
Definition SplineSet.cc:139
virtual ~SplineSet()
spline destructor
Definition SplineSet.cc:93
void build(integer nspl, integer npts, char const *headers[], SplineType1D const stype[], real_type const X[], real_type const *Y[], real_type const *Yp[]=nullptr)
Definition SplineSet.cc:208
void eval2_D(vec_real_type const &zetas, char const indep[], vec_string_type const &columns, GenericContainer &vals) const
Definition SplineSet.hxx:1025
integer num_splines() const
Definition SplineSet.hxx:157
void get_headers(std::vector< std::string > &names) const
Definition SplineSet.cc:129
void dump_table(ostream_type &s, integer num_points) const
Definition SplineSet.cc:174
real_type DDD(real_type x, integer spl) const
Definition SplineSet.hxx:305
real_type eval_DDD(real_type x, char const name[]) const
Definition SplineSet.hxx:386
void setup(GenericContainer const &gc)
Definition SplineSetGC.cc:49
real_type x_node(integer npt) const
Definition SplineSet.hxx:178
real_type y_min(integer spl) const
Definition SplineSet.hxx:198
void eval2_DDD(real_type zeta, char const *indep, GenericContainer &vals) const
Definition SplineSet.hxx:1300
real_type operator()(real_type x, integer spl) const
Definition SplineSet.hxx:251
real_type eval(real_type x, char const name[]) const
Definition SplineSet.hxx:359
integer get_position(char const hdr[]) const
Definition SplineSet.cc:194
real_type y_max(char const spl[]) const
Definition SplineSet.hxx:218
real_type y_node(integer npt, integer spl) const
Definition SplineSet.hxx:183
void eval2_DD(real_type zeta, char const indep[], vec_string_type const &columns, GenericContainer &vals) const
Definition SplineSet.hxx:1168
void eval2_DDD(vec_real_type const &zetas, char const indep[], GenericContainer &vals) const
Definition SplineSet.hxx:1314
string const & header(integer i) const
Definition SplineSet.hxx:126
real_type eval_DDDD(real_type x, integer spl) const
Definition SplineSet.hxx:332
real_type y_min(char const spl[]) const
Definition SplineSet.hxx:209
real_type eval_DDDD(real_type x, char const name[]) const
Definition SplineSet.hxx:395
void eval2_DD(integer spl, real_type zeta, vector< real_type > &vals) const
Definition SplineSet.cc:696
real_type eval_D(real_type x, char const name[]) const
Definition SplineSet.hxx:368
real_type x_max() const
Definition SplineSet.hxx:193
void eval2_D(vec_real_type const &zetas, char const indep[], GenericContainer &vals) const
Definition SplineSet.hxx:996
real_type eval_DDDDD(real_type x, char const name[]) const
Definition SplineSet.hxx:404
void eval2_DDD(vec_real_type const &zetas, char const indep[], vec_string_type const &columns, GenericContainer &vals) const
Definition SplineSet.hxx:1343
void eval2_DD(vec_real_type const &zetas, char const indep[], GenericContainer &vals) const
Definition SplineSet.hxx:1154
int is_monotone(integer i) const
Definition SplineSet.hxx:146
real_type const * y_nodes(integer i) const
Definition SplineSet.cc:150
void eval2(vec_real_type const &zetas, char const indep[], GenericContainer &vals) const
Definition SplineSet.hxx:832
string info() const
Definition SplineSet.cc:103
string const & name() const
Definition SplineSet.hxx:121
real_type x_min() const
Definition SplineSet.hxx:188
real_type eval_DD(real_type x, char const name[]) const
Definition SplineSet.hxx:377
void eval2_DDD(integer spl, real_type zeta, vector< real_type > &vals) const
Definition SplineSet.cc:758
real_type eval_DDDDD(real_type x, integer spl) const
Definition SplineSet.hxx:350
real_type D(real_type x, integer spl) const
Definition SplineSet.hxx:269
void eval_DDDDD(real_type x, vector< real_type > &vals) const
real_type const * x_nodes() const
Definition SplineSet.hxx:168
real_type eval(real_type x, integer spl) const
Definition SplineSet.hxx:260
real_type eval_D(real_type x, integer spl) const
Definition SplineSet.hxx:278
SplineType1D type() const
Return spline type (as number)
Definition SplineSet.hxx:1396
void eval_DDDD(real_type x, vector< real_type > &vals) const
void build(GenericContainer const &gc)
Definition SplineSet.hxx:1390
integer num_points() const
Definition SplineSet.hxx:152
Spline * get_spline(integer i) const
Definition SplineSet.cc:162
void eval2_D(real_type zeta, char const indep[], GenericContainer &vals) const
Definition SplineSet.hxx:982
real_type eval_DD(real_type x, integer spl) const
Definition SplineSet.hxx:296
void eval2_DD(vec_real_type const &zetas, char const indep[], vec_string_type const &columns, GenericContainer &vals) const
Definition SplineSet.hxx:1183
void eval2(real_type zeta, char const indep[], GenericContainer &vals) const
Definition SplineSet.hxx:818
void eval2(vec_real_type const &zetas, char const indep[], vec_string_type const &columns, GenericContainer &vals) const
Definition SplineSet.hxx:861
real_type DDDD(real_type x, integer spl) const
Definition SplineSet.hxx:323
void eval2(integer spl, real_type zeta, vector< real_type > &vals) const
Definition SplineSet.cc:586
Definition SplineAkima.cc:50
int integer
Signed integer type for splines.
Definition Splines.hh:58
enum class SplineType1D :integer { CONSTANT=0, LINEAR=1, CUBIC=2, AKIMA=3, BESSEL=4, PCHIP=5, QUINTIC=6, HERMITE=7, SPLINE_SET=8, SPLINE_VEC=9 } SplineType1D
Associate a number for each type of splines implemented.
Definition Splines.hh:71
double real_type
Floating point type for splines.
Definition Splines.hh:57