Changeset 1650 for trunk/yat/regression/GSLInterpolation.cc
 Timestamp:
 Dec 14, 2008, 11:13:48 PM (12 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/regression/GSLInterpolation.cc
r1648 r1650 34 34 const utility::VectorBase& x, 35 35 const utility::VectorBase& y) 36 : evaluation_(0.0), gsl_status_(0) 36 37 { 37 38 assert(x.size()==y.size()); … … 44 45 } 45 46 interpolator_ = gsl_interp_alloc(interpolator_type, size); 46 gsl_ interp_init(interpolator_, x_, y_, size);47 gsl_status_=gsl_interp_init(interpolator_, x_, y_, size); 47 48 accelerator_ = gsl_interp_accel_alloc(); 48 49 } … … 65 66 66 67 68 int GSLInterpolation::error_status(void) const 69 { 70 return gsl_status_; 71 } 72 73 67 74 double GSLInterpolation::evaluate(double x) 68 { 69 return gsl_interp_eval(interpolator_, x_, y_, x, accelerator_); 75 { 76 gsl_status_=gsl_interp_eval_e(interpolator_, x_, y_, x, accelerator_, 77 &evaluation_); 78 return evaluation_; 70 79 } 71 80 … … 73 82 double GSLInterpolation::evaluate_derivative(double x) 74 83 { 75 return gsl_interp_eval_deriv(interpolator_, x_, y_, x, accelerator_); 84 gsl_status_=gsl_interp_eval_deriv_e(interpolator_, x_, y_, x, accelerator_, 85 &evaluation_); 86 return evaluation_; 76 87 } 77 88 … … 79 90 double GSLInterpolation::evaluate_derivative2(double x) 80 91 { 81 return gsl_interp_eval_deriv2(interpolator_, x_, y_, x, accelerator_); 92 gsl_status_=gsl_interp_eval_deriv2_e(interpolator_, x_, y_, x, accelerator_, 93 &evaluation_); 94 return evaluation_; 82 95 } 83 96 … … 85 98 double GSLInterpolation::evaluate_integral(double a, double b) 86 99 { 87 return gsl_interp_eval_integ(interpolator_, x_, y_, a, b, accelerator_); 100 gsl_status_=gsl_interp_eval_integ_e(interpolator_, x_, y_, a, b, 101 accelerator_, &evaluation_); 102 return evaluation_; 103 } 104 105 106 double GSLInterpolation::evaluation(void) const 107 { 108 return evaluation_; 88 109 } 89 110
Note: See TracChangeset
for help on using the changeset viewer.