philsupertramp/game-math
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Attributes | List of all members
NewtonBase Class Reference

#include <SupportValues.h>

Inheritance diagram for NewtonBase:
PolynomialBase

Public Member Functions

 NewtonBase (const Matrix< double > &x, const Matrix< double > &y)
 
virtual std::string Function () const
 
double GetCoefficient (size_t index, const double &x) const
 
virtual Matrix< double > Evaluate (const Matrix< double > &xIn) const
 
- Public Member Functions inherited from PolynomialBase
 PolynomialBase (const Matrix< double > &X, const Matrix< double > &Y)
 
virtual Matrix< double > Evaluate (const Matrix< double > &) const =0
 
virtual std::string Function () const =0
 

Public Attributes

Matrix< double > b
 newton base coefficients $$b_i$$ More...
 

Private Attributes

Matrix< double > X
 support values $$x_i$$ More...
 

Detailed Description

Newton-Base

$$ p(x) = \sum_{i=0}^{n} b_i \omega_i(x) $$ with $$ b_i = \frac{f_{[x_{r+1}, ..., x_s]} - f_{[x_r, ..., x_{s-1}]}}{x_s - x_r} $$ and $$ \omega_i(x) = \prod_{j=0}^{i-1} (x - x_j), \quad i = 1, \dots n $$ and $$ \omega_0(x) = x_0 $$

https://wiki.godesteem.de/wiki/interpolation-and-approximation/#Newton-Base

Examples
numerics/analysis/TestSupportValues.cpp.

Constructor & Destructor Documentation

◆ NewtonBase()

NewtonBase::NewtonBase ( const Matrix< double > &  x,
const Matrix< double > &  y 
)
inline

default constructor

Parameters
xsupport values $$x_i$$
yevaluated support values $$y_i$$

Member Function Documentation

◆ Evaluate()

virtual Matrix< double > NewtonBase::Evaluate ( const Matrix< double > &  xIn) const
inlinevirtual

Evaluate the newton base for given values

Parameters
xInvalues to evaluate
Returns
interpolated values

Implements PolynomialBase.

◆ Function()

virtual std::string NewtonBase::Function ( ) const
inlinevirtual

String representation in newton base

Returns
representational string

Implements PolynomialBase.

◆ GetCoefficient()

double NewtonBase::GetCoefficient ( size_t  index,
const double &  x 
) const
inline

Getter for coefficient with index i for a value x

Parameters
indexindex of coefficient
xvalue to evaluate
Returns
evaluated coefficient

Member Data Documentation

◆ b

Matrix<double> NewtonBase::b

newton base coefficients $$b_i$$

◆ X

Matrix<double> NewtonBase::X
private

support values $$x_i$$


The documentation for this class was generated from the following file: