Changeset 1644
- Timestamp:
- Dec 13, 2008, 9:14:51 AM (14 years ago)
- Location:
- trunk/yat/regression
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/regression/CSpline.cc
r1643 r1644 29 29 30 30 31 CSpline::CSpline(const utility::VectorConstView& x, 32 const utility::VectorConstView& y) 31 CSpline::CSpline(const utility::VectorBase& x, const utility::VectorBase& y) 33 32 : GSLInterpolation(gsl_interp_cspline,x,y) 34 33 { -
trunk/yat/regression/CSpline.h
r1643 r1644 28 28 namespace yat { 29 29 namespace utility { 30 class Vector ConstView;30 class VectorBase; 31 31 } 32 32 namespace regression { 33 33 34 34 /** 35 @brief Documentation please. 35 \brief Cubic spline with natural boundary conditions. 36 37 The resulting curve is piecewise cubic on each interval, with 38 matching first and second derivatives at the supplied 39 data-points. The second derivative is chosen to be zero at the 40 first point and last point. 41 42 \see Please refer to the base class documentation for genereal 43 introduction to the GSL based interpolation methods. 36 44 */ 37 45 class CSpline : public GSLInterpolation … … 40 48 public: 41 49 /** 42 @brief The default constructor50 \brief The default constructor 43 51 */ 44 CSpline(const utility::VectorConstView& x, 45 const utility::VectorConstView& y); 52 CSpline(const utility::VectorBase& x, const utility::VectorBase& y); 46 53 47 54 /** 48 @brief The destructor55 \brief The destructor 49 56 */ 50 57 ~CSpline(void); … … 52 59 private: 53 60 /** 54 Copy Constructor. (not implemented)61 \brief Copy Constructor. (not implemented) 55 62 */ 56 63 CSpline(const CSpline&); -
trunk/yat/regression/GSLInterpolation.cc
r1643 r1644 22 22 #include "GSLInterpolation.h" 23 23 24 #include "yat/utility/Vector ConstView.h"24 #include "yat/utility/VectorBase.h" 25 25 26 26 #include <cassert> … … 32 32 33 33 GSLInterpolation::GSLInterpolation(const gsl_interp_type* interpolator_type, 34 const utility::Vector ConstView& x,35 const utility::Vector ConstView& y)34 const utility::VectorBase& x, 35 const utility::VectorBase& y) 36 36 { 37 37 assert(x.size()==y.size()); … … 43 43 y_[i]=y(i); 44 44 } 45 interpolator_ =gsl_interp_alloc(interpolator_type, size);45 interpolator_ = gsl_interp_alloc(interpolator_type, size); 46 46 gsl_interp_init(interpolator_, x_, y_, size); 47 47 accelerator_ = gsl_interp_accel_alloc(); -
trunk/yat/regression/GSLInterpolation.h
r1643 r1644 28 28 namespace yat { 29 29 namespace utility { 30 class Vector ConstView;30 class VectorBase; 31 31 } 32 32 namespace regression { 33 33 34 34 /** 35 @brief Documentation please. 35 \brief Base class for interfacing GSL interpolation. 36 37 The GSL interpolation is descibed in 38 http://www.gnu.org/software/gsl/manual/html_node/Interpolation.html. The 39 GSL library provides a variety of interpolation methods, 40 including Cubic splines and Akima splines. Interpolations can be 41 defined for both normal and periodic boundary 42 conditions. Additional functions are available for computing 43 derivatives and integrals of interpolating functions. 44 45 Given a set of data points \f$ (x_1, y_1) \dots (x_n, y_n) \f$ 46 the sub classescompute a continuous interpolating function \f$ 47 y(x) \f$ such that \f$ y(x_i) = y_i \f$. The interpolation is 48 piecewise smooth, and its behavior at the end-points is 49 determined by the type of interpolation used. 36 50 */ 37 51 class GSLInterpolation … … 41 55 42 56 /** 43 @brief Documentation please. 57 \brief Calculate the interpolated value for \a x. 58 59 \return The interpolated value of \f$ y \f$ for a given point 60 \a x. 44 61 */ 45 62 double evaluate(const double x) const; … … 47 64 protected: 48 65 /** 49 @brief The default constructor 66 \brief The default constructor 67 68 Initializion of the interpolation object for the data \f$ (x, 69 y) \f$ where \a x and \a y are vector like objects of the same 70 size. The content of \a x and \a y are copied for internal 71 storage. \a x is always assumed to be strictly ordered, with 72 increasing \a x values; the behavior for other arrangements is 73 not defined. 50 74 */ 51 GSLInterpolation(const gsl_interp_type*, const utility::Vector ConstView& x,52 const utility::Vector ConstView& y);75 GSLInterpolation(const gsl_interp_type*, const utility::VectorBase& x, 76 const utility::VectorBase& y); 53 77 54 78 /** 55 @brief The destructor79 \brief The destructor 56 80 */ 57 81 virtual ~GSLInterpolation(void); … … 59 83 private: 60 84 /** 61 Copy Constructor. (not implemented)85 \brief Copy Constructor. (not implemented) 62 86 */ 63 87 GSLInterpolation(const GSLInterpolation&);
Note: See TracChangeset
for help on using the changeset viewer.