57 |
|
void addPoint(const RealType xp, const RealType yp); |
58 |
|
void addPoints(const vector<RealType>& xps, const vector<RealType>& yps); |
59 |
|
RealType getValueAt(const RealType& t); |
60 |
– |
pair<RealType, RealType> getValueAndDerivativeAt(const RealType& t); |
60 |
|
pair<RealType, RealType> getLimits(); |
61 |
|
void getValueAt(const RealType& t, RealType& v); |
62 |
|
void getValueAndDerivativeAt(const RealType& t, RealType& v, RealType& d); |
63 |
|
|
64 |
|
private: |
65 |
|
void generate(); |
66 |
+ |
std::vector<int> sort_permutation(std::vector<RealType>& v); |
67 |
+ |
std::vector<RealType> apply_permutation(std::vector<RealType> const& v, |
68 |
+ |
std::vector<int> const& p); |
69 |
+ |
|
70 |
|
bool isUniform; |
71 |
|
bool generated; |
72 |
|
RealType dx, dt, yval, dydx; |
73 |
|
int n, j; |
74 |
< |
vector<pair<RealType, RealType> > data_; |
74 |
> |
vector<RealType> x_; |
75 |
> |
vector<RealType> y_; |
76 |
|
vector<RealType> b; |
77 |
|
vector<RealType> c; |
78 |
|
vector<RealType> d; |
79 |
|
}; |
80 |
+ |
|
81 |
+ |
class Comparator{ |
82 |
+ |
std::vector<RealType>& _v; |
83 |
+ |
public: |
84 |
+ |
Comparator(std::vector<RealType>& v) : _v(v) {} |
85 |
+ |
bool operator()(size_t i, size_t j){ |
86 |
+ |
return _v[i] < _v[j]; |
87 |
+ |
} |
88 |
+ |
}; |
89 |
|
} |
90 |
|
|
91 |
|
#endif |