31#if defined(LagrangeInterpolation_RECURSES)
32#error Recursive header files inclusion detected in LagrangeInterpolation.h
35#define LagrangeInterpolation_RECURSES
37#if !defined LagrangeInterpolation_h
39#define LagrangeInterpolation_h
44#include "DGtal/base/Common.h"
45#include "DGtal/math/MPolynomial.h"
46#include "DGtal/kernel/NumberTraits.h"
47#include "DGtal/kernel/CEuclideanRing.h"
61 template <
typename TEucl
ideanRing>
68 typedef TEuclideanRing
Ring;
148 void init(
const std::vector< Ring >& xvalues )
148 void init(
const std::vector< Ring >& xvalues ) {
…}
185 if ( yvalues.size() !=
size() )
return P;
201 ASSERT( i <
size() );
214 that_stream <<
"[LagrangeInterpolation det=" <<
myDeterminant << std::endl;
216 that_stream <<
"l_" << i <<
"=" <<
basis( i ) << std::endl;
247 template <
typename TEucl
ideanRing>
268#undef LagrangeInterpolation_RECURSES
Aim: This class implements Lagrange basis functions and Lagrange interpolation.
Polynomial polynomial(const std::vector< Ring > &yvalues)
LagrangeInterpolation(const std::vector< Ring > &xvalues)
BOOST_CONCEPT_ASSERT((concepts::CEuclideanRing< Ring >))
LagrangeInterpolation(LagrangeInterpolation &&other)=default
~LagrangeInterpolation()=default
LagrangeInterpolation< Integer > Self
void selfDisplay(std::ostream &that_stream) const
std::vector< Polynomial > myLagrangeBasis
Polynomial basis(Size i) const
DGtal::MPolynomial< 1, Ring > Polynomial
LagrangeInterpolation & operator=(const LagrangeInterpolation &other)=default
LagrangeInterpolation & operator=(LagrangeInterpolation &&other)=default
void init(const std::vector< Ring > &xvalues)
LagrangeInterpolation(const LagrangeInterpolation &other)=default
DGtal is the top-level namespace which contains all DGtal functions and types.
MPolynomial< 1, Ring, Alloc > mmonomial(unsigned int e)
const T NumberTraitsImpl< T, Enable >::ZERO
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::uint32_t Dimension
Aim: The traits class for all models of Cinteger.
Aim: Defines the mathematical concept equivalent to a unitary commutative ring with a division operat...