Exemplo n.º 1
0
 double CurveQuadratic_Impl::evaluate(const std::vector<double>& x) const {
   OS_ASSERT(x.size() == 1u);
   double result = coefficient1Constant();
   result += coefficient2x() * x[0];
   result += coefficient3xPOW2() * pow(x[0],2);
   return result;
 }
Exemplo n.º 2
0
 double CurveQuartic_Impl::evaluate(const std::vector<double>& x) const {
   BOOST_ASSERT(x.size() == 1u);
   double result = coefficient1Constant();
   result += coefficient2x() * x[0];
   result += coefficient3xPOW2() * pow(x[0],2);
   result += coefficient4xPOW3() * pow(x[0],3);
   result += coefficient5xPOW4() * pow(x[0],4);
   return result;
 }
Exemplo n.º 3
0
 double CurveQuadraticLinear_Impl::evaluate(const std::vector<double>& x) const {
   OS_ASSERT(x.size() == 2u);
   double x2 = pow(x[0],2);
   double result = coefficient1Constant();
   result += coefficient2x() * x[0];
   result += coefficient3xPOW2() * x2;
   double temp = coefficient4y();
   temp += coefficient5xTIMESY() * x[0];
   temp += coefficient6xPOW2TIMESY() * x2;
   result += temp * x[1];
   return result;
 }
Exemplo n.º 4
0
  double CurveBicubic_Impl::evaluate(const std::vector<double>& x) const {
    OS_ASSERT(x.size() == 2u);

    double result = coefficient1Constant();
    double x2 = pow(x[0],2);
    double y2 = pow(x[1],2);
    result += coefficient2x() * x[0];
    result += coefficient3xPOW2() * x2;
    result += coefficient4y() * x[1];
    result += coefficient5yPOW2() * y2;
    result += coefficient6xTIMESY() * x[0] * x[1];
    result += coefficient7xPOW3() * pow(x[0],3);
    result += coefficient8yPOW3() * pow(x[1],3);
    result += coefficient9xPOW2TIMESY() * x2 * x[1];
    result += coefficient10xTIMESYPOW2() * x[0] * y2;
    return result;
  }