# Changeset 1648

Ignore:
Timestamp:
Dec 13, 2008, 10:28:39 AM (13 years ago)
Message:

Location:
trunk
Files:
4 edited

Unmodified
Removed
• ## trunk/test/interpolation_test.cc

 r1645 /* Copyright (C) 2007 Jari Häkkinen Copyright (C) 2008 Jari Häkkinen This file is part of the yat library, http://dev.thep.lu.se/yat #include "Suite.h" #include "yat/regression/AkimaInterpolation.h" #include "yat/regression/AkimaPeriodicInterpolation.h" #include "yat/regression/CSplineInterpolation.h" #include "yat/regression/CSplinePeriodicInterpolation.h" #include "yat/regression/LinearInterpolation.h" #include "yat/regression/PolynomialInterpolation.h" #include "yat/utility/Vector.h" #include "yat/utility/VectorConstView.h" { using namespace theplu::yat; using namespace theplu::yat::regression; test::Suite suite(argc, argv); y(0)=100; y(1)= 97; y(2)=111; y(3)=120; y(4)=117; y(5)=103; regression::CSplineInterpolation cspline(x,y); CSplineInterpolation cspline(x,y); utility::Vector w(11); } // lazy testing, at least try to create the objects AkimaInterpolation(x,y); AkimaPeriodicInterpolation(x,y); CSplinePeriodicInterpolation(x,y); LinearInterpolation(x,y); PolynomialInterpolation(x,y); return suite.return_value(); }
• ## trunk/yat/regression/GSLInterpolation.cc

 r1644 double GSLInterpolation::evaluate(const double x) const size_t GSLInterpolation::bsearch(const double x_array[], double x, size_t index_lo, size_t index_hi) const { return gsl_interp_bsearch(x_array, x, index_lo, index_hi); } double GSLInterpolation::evaluate(double x) { return gsl_interp_eval(interpolator_,x_,y_,x,accelerator_); return gsl_interp_eval(interpolator_, x_, y_, x, accelerator_); } double GSLInterpolation::evaluate_derivative(double x) { return gsl_interp_eval_deriv(interpolator_, x_, y_, x, accelerator_); } double GSLInterpolation::evaluate_derivative2(double x) { return gsl_interp_eval_deriv2(interpolator_, x_, y_, x, accelerator_); } double GSLInterpolation::evaluate_integral(double a, double b) { return gsl_interp_eval_integ(interpolator_, x_, y_, a, b, accelerator_); } unsigned int GSLInterpolation::min_size(void) const { return gsl_interp_min_size(interpolator_); }
• ## trunk/yat/regression/GSLInterpolation.h

 r1644 public: /** \brief Search index. This function returns the index \f\$ i \f\$ of the array \a x_array such that \f\$ x_array[i] <= x < x_array[i+1] \f\$. The index is searched for in the range \f\$ [index_lo, index_hi] \f\$. */ size_t bsearch(const double x_array[], double x, size_t index_lo, size_t index_hi) const; /** \a x. */ double evaluate(const double x) const; double evaluate(double x); /** \brief Calculate the derivative of the interpolated function at \a x. \return The derivative. */ double evaluate_derivative(double x); /** \brief Calculate the 2nd derivative of the interpolated function at \a x. \return The 2nd derivative. */ double evaluate_derivative2(double x); /** \brief Calculate the numerical integral of the interpolated function over the range \f\$ [a,b] \f\$. \return The integral. */ double evaluate_integral(double a, double b); /** \brief This function returns the minimum number of points required by the interpolation type. For example, Akima spline interpolation requires a minimum of 5 points. \return The minimum number of points required. */ unsigned int min_size(void) const; protected:
• ## trunk/yat/regression/Makefile.am

 r1647 Local.cc MultiDimensional.cc MultiDimensionalWeighted.cc Naive.cc   \ NaiveWeighted.cc OneDimensional.cc OneDimensionalWeighted.cc        \ Polynomial.cc LinearInterpolation.cc PolynomialWeighted.cc Polynomial.cc PolynomialInterpolation.cc PolynomialWeighted.cc include_regressiondir = \$(includedir)/yat/regression LinearWeighted.h Local.h MultiDimensional.h                         \ MultiDimensionalWeighted.h Naive.h NaiveWeighted.h OneDimensional.h \ OneDimensionalWeighted.h Polynomial.h LinearInterpolation.cc        \ OneDimensionalWeighted.h Polynomial.h PolynomialInterpolation.cc    \ PolynomialWeighted.h
Note: See TracChangeset for help on using the changeset viewer.