DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX > Class Template Reference

#include <MPolynomial.h>

Collaboration diagram for DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >:
Collaboration graph
[legend]

Public Types

typedef TRing Ring
typedef TAlloc Alloc
typedef TX X
typedef MPolynomial< n, Ring,
Alloc
MPolyN
typedef MPolynomial< n-1, X,
typename Alloc::template
rebind< X >::other > 
MPolyNM1

Public Member Functions

 operator MPolyNM1 () const
template<typename XX >
MPolynomialEvaluatorImpl< n-1,
Ring, MPolynomialEvaluator< n,
Ring, Alloc, X >, Alloc, XX > 
operator() (const XX &x) const

Private Member Functions

 MPolynomialEvaluator (const MPolyN &poly, const X &evalpoint)
template<typename XX , typename Fun >
void evaluate (XX &res, const Fun &evalfun) const

Private Attributes

const MPolyNmyPoly
const XmyEvalPoint

Friends

class MPolynomial< n, TRing, TAlloc >
class MPolynomialEvaluatorImpl

Detailed Description

template<int n, typename TRing, typename TAlloc, typename TX>
class DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >

The top level polynomial evaluation class, in case n > 1, i.e. in case the coefficients are polynomials by themselves.

This class is a backport from Spielwiese.

Definition at line 399 of file MPolynomial.h.


Member Typedef Documentation

template<int n, typename TRing , typename TAlloc , typename TX >
typedef TAlloc DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::Alloc

Definition at line 408 of file MPolynomial.h.

template<int n, typename TRing , typename TAlloc , typename TX >
typedef MPolynomial< n, Ring, Alloc > DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::MPolyN

Definition at line 410 of file MPolynomial.h.

template<int n, typename TRing , typename TAlloc , typename TX >
typedef MPolynomial< n - 1, X, typename Alloc::template rebind<X>::other > DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::MPolyNM1

Definition at line 412 of file MPolynomial.h.

template<int n, typename TRing , typename TAlloc , typename TX >
typedef TRing DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::Ring

Definition at line 407 of file MPolynomial.h.

template<int n, typename TRing , typename TAlloc , typename TX >
typedef TX DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::X

Definition at line 409 of file MPolynomial.h.


Constructor & Destructor Documentation

template<int n, typename TRing , typename TAlloc , typename TX >
DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::MPolynomialEvaluator ( const MPolyN poly,
const X evalpoint 
)
inlineprivate

Definition at line 418 of file MPolynomial.h.

: myPoly( poly ), myEvalPoint( evalpoint )
{}

Member Function Documentation

template<int n, typename TRing , typename TAlloc , typename TX >
template<typename XX , typename Fun >
void DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::evaluate ( XX &  res,
const Fun &  evalfun 
) const
inlineprivate

Will be called by "child". Evaluates the polynomial into an element of XX (which must not necessarily be X, it can also be MPolynomial<k, X> for some k < n - 1) using the given functor to evaluate the coefficients, which are of type MPolynomial<n-1, Ring>.

Definition at line 430 of file MPolynomial.h.

References DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::myEvalPoint, DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::myPoly, DGtal::MPolynomial< n, TRing, TAlloc >::myValue, and DGtal::IVector< T, TAlloc, usePointers >::size().

{
X xx = (X) 1;
for ( int i = 0; i < (int) myPoly.myValue.size(); ++i )
{
res += evalfun( myPoly.myValue[i] ) * xx;
xx = xx * myEvalPoint;
}
}
template<int n, typename TRing , typename TAlloc , typename TX >
DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::operator MPolyNM1 ( ) const
inline
template<int n, typename TRing , typename TAlloc , typename TX >
template<typename XX >
MPolynomialEvaluatorImpl< n - 1, Ring, MPolynomialEvaluator< n, Ring, Alloc, X >, Alloc, XX > DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::operator() ( const XX &  x) const
inline

Continue evaluation to lower level.

Definition at line 464 of file MPolynomial.h.


Friends And Related Function Documentation

template<int n, typename TRing , typename TAlloc , typename TX >
friend class MPolynomial< n, TRing, TAlloc >
friend

Definition at line 401 of file MPolynomial.h.

template<int n, typename TRing , typename TAlloc , typename TX >
friend class MPolynomialEvaluatorImpl
friend

Definition at line 404 of file MPolynomial.h.


Field Documentation

template<int n, typename TRing , typename TAlloc , typename TX >
const X& DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::myEvalPoint
private
template<int n, typename TRing , typename TAlloc , typename TX >
const MPolyN& DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::myPoly
private

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