DGtal  1.5.beta
DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun2 Class Reference

Public Member Functions

 EvalFun2 (const MPolynomialEvaluatorImpl< n, Ring, Owner, Alloc, X > &owner)
 
MPolyNM1 operator() (const MPolyN &p) const
 

Private Attributes

const MPolynomialEvaluatorImpl< n, Ring, Owner, Alloc, X > & myOwner
 

Detailed Description

template<int n, typename TRing, typename TOwner, typename TAlloc, typename TX>
class DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun2

Evaluates a polynomial of type poly<n, T> in myEvalPoint; the coefficients of the first indeterminate (which are polynomials of type poly<n-1, Ring>) are casted to poly<n-1, X>, and the result is of type poly<n-1, X> as well.

Definition at line 284 of file MPolynomial.h.

Constructor & Destructor Documentation

◆ EvalFun2()

template<int n, typename TRing , typename TOwner , typename TAlloc , typename TX >
DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun2::EvalFun2 ( const MPolynomialEvaluatorImpl< n, Ring, Owner, Alloc, X > &  owner)
inline

Definition at line 290 of file MPolynomial.h.

291  : myOwner(owner)
292  {
293  }
const MPolynomialEvaluatorImpl< n, Ring, Owner, Alloc, X > & myOwner
Definition: MPolynomial.h:286

Member Function Documentation

◆ operator()()

template<int n, typename TRing , typename TOwner , typename TAlloc , typename TX >
MPolyNM1 DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun2::operator() ( const MPolyN p) const
inline

Evaluate: the first indeterminate is replaced by myEvalPoint, and the coefficients of the first indeterminate (which are polynomials of type poly<n-1, Ring>) are casted to the type poly<n-1, X>.

Definition at line 301 of file MPolynomial.h.

302  {
303  MPolyNM1 res;
304  X xx = (X) 1;
305  for ( int i = 0; i < (int) p.myValue.size(); ++i )
306  {
307  res += ( (MPolyNM1) p.myValue[i] ) * xx;
308  xx = xx * myOwner.myEvalPoint;
309  }
310  return res;
311  }
MPolynomial< n - 1, X, typename Alloc::template rebind< X >::other > MPolyNM1
Definition: MPolynomial.h:209

Field Documentation

◆ myOwner

template<int n, typename TRing , typename TOwner , typename TAlloc , typename TX >
const MPolynomialEvaluatorImpl<n, Ring, Owner, Alloc, X>& DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun2::myOwner
private

Definition at line 286 of file MPolynomial.h.


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