philsupertramp/game-math
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
PolynomialBase Class Referenceabstract

#include <SupportValues.h>

Inheritance diagram for PolynomialBase:
LagrangeBase MonomBase NewtonBase

Public Member Functions

 PolynomialBase (const Matrix< double > &X, const Matrix< double > &Y)
 
virtual Matrix< double > Evaluate (const Matrix< double > &) const =0
 
virtual std::string Function () const =0
 

Friends

std::ostream & operator<< (std::ostream &ostr, const PolynomialBase &base)
 

Detailed Description

function approximation and interpolation using support values

see https://wiki.godesteem.de/wiki/interpolation-and-approximation/

Requires:

Template class for polynomial base representation.

Constructor & Destructor Documentation

◆ PolynomialBase()

PolynomialBase::PolynomialBase ( 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 > PolynomialBase::Evaluate ( const Matrix< double > &  ) const
pure virtual

Evaluate a given vector based on the approximation, computes p(x) for given x

Returns

Implemented in LagrangeBase, MonomBase, and NewtonBase.

◆ Function()

virtual std::string PolynomialBase::Function ( ) const
pure virtual

string representation of interpolated polynomial

Don't overthink this. simply return some kind of equation one can copy into wolframalpha and simplify

Returns

Implemented in MonomBase, LagrangeBase, and NewtonBase.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  ostr,
const PolynomialBase base 
)
friend

std::cout operator

Parameters
ostr
base
Returns

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