29#ifndef POLYNOMIAL_INCLUDED
30#define POLYNOMIAL_INCLUDED
38 template<
unsigned int D1 ,
unsigned int D2 >
struct Min{
static const unsigned int Value = D1<D2 ? D1 : D2; };
40 template<
unsigned int D1 ,
unsigned int D2 >
struct Max{
static const unsigned int Value = D1>D2 ? D1 : D2; };
43 template<
unsigned int Dim ,
unsigned int Degree >
46 template<
unsigned int _Dim ,
unsigned int _Degree >
friend class Polynomial;
57 const double &
_coefficient(
const unsigned int indices[] ,
unsigned int maxDegree )
const;
60 double &
_coefficient(
const unsigned int indices[] ,
unsigned int maxDegree );
63 double _evaluate(
const double coordinates[] ,
unsigned int maxDegree )
const;
69 bool _isZero(
unsigned int maxDegree )
const;
82 template<
unsigned int _Degree >
86 template<
unsigned int _Degree >
90 template<
typename ... UnsignedInts >
91 const double &
coefficient( UnsignedInts ... indices )
const;
94 template<
typename ... UnsignedInts >
98 template<
typename ... Doubles >
99 double operator()( Doubles ... coordinates )
const;
121 template<
unsigned int Dim ,
unsigned int Degree1 ,
unsigned int Degree2 >
125 template<
unsigned int Dim ,
unsigned int Degree1 ,
unsigned int Degree2 >
129 template<
unsigned int Dim ,
unsigned int Degree1 ,
unsigned int Degree2 >
133 template<
unsigned int Dim ,
unsigned int Degree >
137 template<
unsigned int Degree >
140 template<
unsigned int _Dim ,
unsigned int _Degree >
friend class Polynomial;
151 double _coefficients[Degree+1];
154 const double &
_coefficient(
const unsigned int indices[] ,
unsigned int maxDegree )
const;
157 double &
_coefficient(
const unsigned int indices[] ,
unsigned int maxDegree );
160 double _evaluate(
const double coordinates[] ,
unsigned int maxDegree )
const;
166 bool _isZero(
unsigned int maxDegree )
const;
179 template<
typename ... Doubles >
183 template<
unsigned int _Degree >
187 template<
unsigned int _Degree >
207 unsigned int roots(
double *r )
const;
221 template<
unsigned int Degree1 ,
unsigned int Degree2 >
225 template<
unsigned int Degree1 ,
unsigned int Degree2 >
229 template<
unsigned int Degree1 ,
unsigned int Degree2 >
233 template<
unsigned int Degree >
240 template<
unsigned int Degree >
244 template<
unsigned int Degree >
248 template<
unsigned int Degree >
252 template<
unsigned int Degree >
Definition: geometry.h:52
Definition: polynomial.h:139
Definition: polynomial.h:45
bool _isConstant(unsigned int maxDegree) const
Definition: polynomial.inl:340
friend Polynomial< _Dim, Degree1+Degree2 > operator*(const Polynomial< _Dim, Degree1 > &, const Polynomial< _Dim, Degree2 > &)
double _evaluate(const double coordinates[], unsigned int maxDegree) const
Definition: polynomial.inl:305
const double & coefficient(UnsignedInts ... indices) const
Definition: polynomial.inl:349
Polynomial< Dim, Degree-1 > d(int dim) const
Definition: polynomial.inl:379
Polynomial< Dim-1, Degree > _polynomials[Degree+1]
Definition: polynomial.h:54
friend class Polynomial
Definition: polynomial.h:46
double operator()(Doubles ... coordinates) const
Definition: polynomial.inl:367
friend Polynomial< _Dim, Max< Degree1, Degree2 >::Value > operator-(const Polynomial< _Dim, Degree1 > &, const Polynomial< _Dim, Degree2 > &)
unsigned int roots(double *r) const
Definition: polynomial.inl:167
bool _isZero(unsigned int maxDegree) const
Definition: polynomial.inl:333
friend std::ostream & operator<<(std::ostream &, const Polynomial< _Dim, _Degree > &)
friend Polynomial< _Dim, Max< Degree1, Degree2 >::Value > operator+(const Polynomial< _Dim, Degree1 > &, const Polynomial< _Dim, Degree2 > &)
Polynomial & operator=(const Polynomial< Dim, _Degree > &p)
const double & _coefficient(const unsigned int indices[], unsigned int maxDegree) const
Definition: polynomial.inl:291
Definition: geometry.h:299
std::ostream & operator<<(std::ostream &stream, const Point< Dim > &p)
Definition: geometry.inl:127
Polynomial< Dim, Max< Degree1, Degree2 >::Value > operator-(const Polynomial< Dim, Degree1 > &p1, const Polynomial< Dim, Degree2 > &p2)
Definition: polynomial.inl:455
Ray< Dim > operator*(const Matrix< Dim+1, Dim+1 > &m, const Ray< Dim > &ray)
Definition: geometry.inl:493
Polynomial< Dim, Max< Degree1, Degree2 >::Value > operator+(const Polynomial< Dim, Degree1 > &p1, const Polynomial< Dim, Degree2 > &p2)
Definition: polynomial.inl:446
Definition: polynomial.h:40
static const unsigned int Value
Definition: polynomial.h:40
Definition: polynomial.h:38
static const unsigned int Value
Definition: polynomial.h:38