DGtal  0.9.4beta
Public Member Functions | Private Attributes
DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun< XX, Fun > Class Template Reference
Collaboration diagram for DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun< XX, Fun >:
[legend]

Public Member Functions

 EvalFun (const MPolynomialEvaluatorImpl< n, Ring, Owner, Alloc, X > &owner, const Fun &evalfun)
 
XX operator() (const MPolynomial< n, Ring, Alloc > &p) const
 

Private Attributes

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

Detailed Description

template<int n, typename TRing, typename TOwner, typename TAlloc, typename TX>
template<typename XX, typename Fun>
class DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun< XX, Fun >

Evaluates a polynomial of type MPolynomial<n, TRing> in myEvalPoint; the coefficients of the first indeterminate are evaluated using the given functor of type Fun.

Definition at line 222 of file MPolynomial.h.

Constructor & Destructor Documentation

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

Definition at line 229 of file MPolynomial.h.

231  : myOwner(owner), myEvalFun(evalfun)
232  {}
const MPolynomialEvaluatorImpl< n, Ring, Owner, Alloc, X > & myOwner
Definition: MPolynomial.h:224

Member Function Documentation

template<int n, typename TRing, typename TOwner, typename TAlloc, typename TX>
template<typename XX , typename Fun >
XX DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun< XX, Fun >::operator() ( const MPolynomial< n, Ring, Alloc > &  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, T>) are evaluated using myEvalFun.

Definition at line 240 of file MPolynomial.h.

References DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun< XX, Fun >::myEvalFun, DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::myEvalPoint, and DGtal::MPolynomial< n, TRing, TAlloc >::myValue.

241  {
242  XX res = (XX) 0;
243  X xx = (X) 1;
244  for ( int i = 0; i < (int) p.myValue.size(); ++i )
245  {
246  res += myEvalFun(p.myValue[i]) * (XX) xx;
247  xx = xx * myOwner.myEvalPoint;
248  }
249  return res;
250  }
const MPolynomialEvaluatorImpl< n, Ring, Owner, Alloc, X > & myOwner
Definition: MPolynomial.h:224

Field Documentation

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

Definition at line 224 of file MPolynomial.h.


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