DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Private Attributes
DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun2 Class Reference
Collaboration diagram for DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun2:
Collaboration graph
[legend]

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 274 of file MPolynomial.h.


Constructor & Destructor Documentation

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 280 of file MPolynomial.h.

: myOwner(owner)
{
}

Member Function Documentation

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 291 of file MPolynomial.h.

References DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::myEvalPoint, DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun2::myOwner, DGtal::MPolynomial< n, TRing, TAlloc >::myValue, and DGtal::IVector< T, TAlloc, usePointers >::size().

{
MPolyNM1 res;
X xx = (X) 1;
for ( int i = 0; i < (int) p.myValue.size(); ++i )
{
res += ( (MPolyNM1) p.myValue[i] ) * xx;
xx = xx * myOwner.myEvalPoint;
}
return res;
}

Field Documentation

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

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