32 const std::vector<double>& coefnum,
33 const std::vector<double>& coefdenom,
34 const std::vector<double>& coefnumphi,
35 const std::vector<double>& coefdenomphi):
63 const std::vector<double>& coefnum =
coefs[
type];
64 const std::vector<double>& coefdenom =
coefs[
type+1];
68 for (std::size_t i = 1; i < coefnum.size(); ++i) {
69 dnum += coefnum[i] * powval * i;
71 num += coefnum[i] * powval;
78 denom += coefdenom[0];
79 for (std::size_t i = 1; i < coefdenom.size(); ++i) {
80 ddenom += coefdenom[i] * powval * i;
82 denom += coefdenom[i] * powval;
87 der_quot = (dnum * denom - ddenom * num) / (denom*denom);
97 const std::vector<double>& coefnum =
coefs[
type];
98 const std::vector<double>& coefdenom =
coefs[
type+1];
100 unsigned int order = coefnum.size();
105 num += coefnum[1] * val;
108 for (std::size_t i = 2; i < coefnum.size(); ++i) {
109 d2_num += coefnum[i] * powval * i * (i-1);
111 d_num += coefnum[i] * powval * i;
112 num += coefnum[i] * powval * val;
116 double d_denom = 0.0;
117 double d2_denom = 0.0;
119 order = coefdenom.size();
122 denom += coefdenom[0];
124 denom += coefdenom[1] * val;
125 d_denom += coefdenom[1];
127 for (std::size_t i = 2; i < coefdenom.size(); ++i) {
128 d2_denom += coefdenom[i] * powval * i * (i-1);
130 d_denom += coefdenom[i] * powval * i;
131 denom += coefdenom[i] * powval * val;
137 der_quot = (d_num * denom - d_denom * num) / (denom*denom);
141 der2_quot = (d2_num - 2*der_quot*d_denom - quot * d2_denom) / denom;
boost::function< boost::tuple< double, bool >arguments_t)> type
void calculateRationalFunction(FunctionType, double value, double ", double &der_quot) const
calculate rational function and its first derivative
std::vector< std::vector< double > > coefs
rational function coefficients