35#ifndef STK_CHEBYSHEVCOEFFICIENTS_H
36#define STK_CHEBYSHEVCOEFFICIENTS_H
50template<
class Data,
class Coefs = ArrayXX>
55 typedef typename Data::Type
Type;
94template<
class Data,
class Coefs>
104 Data x = (
Type(2)* (*p_data_)-(minValue_+maxValue_))/(maxValue_-minValue_);
106 coefficients_.resize(p_data_->range(),
Range(0, dim_)) =0;
109 coefficients_.col(0) =
Type(1);
112 coefficients_.col(1) = x;
115 for(
int j=2;
j<coefficients_.endCols(); ++
j)
117 coefficients_.col(
j) = 2. * x *coefficients_.col(
j-1) - coefficients_.col(
j-2); ;
121 for(
int d=1; d<coefficients_.endCols(); ++d)
123 coefficients_.col(d) = (coefficients_.col(d) * (maxValue_-minValue_) + (minValue_+maxValue_))/
Type(2);
In this file we define the Interface class IBasis for basis functions.
#define STKERROR_NO_ARG(Where, Error)
ChebyshevCoefficients class allows to compute the coefficients of a sampled function using Chebyshev ...
ChebyshevCoefficients(Data const *p_data=0, int dim=1, bool useDataValues=true)
default constructor
IBasis< Data, Coefs > Base
virtual ~ChebyshevCoefficients()
Destructor.
virtual bool run()
run the computations.
ChebyshevCoefficients(Data const &data, int dim, bool useDataValues=true)
constructor
ChebyshevCoefficients * clone() const
clone pattern implementation
ChebyshevCoefficients(ChebyshevCoefficients const &coefs)
copy constructor.
Interface base class for all basis function.
Data const * p_data_
the input data set
Type minValue_
Minimal value of the data.
Type maxValue_
Maximal value of the data.
int dim_
number of dimension to build
Coefs coefficients_
Array2D of the coefficients.
virtual bool initializeStep()
perform any computation needed before the call of the regression method.
String msg_error_
String with the last error message.
bool hasRun_
true if run has been used, false otherwise
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
virtual bool run()
run the computations.
The namespace STK is the main domain space of the Statistical ToolKit project.
TRange< UnknownSize > Range