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

#include <DGtal/math/MPolynomial.h>

Inheritance diagram for DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >:
[legend]

Data Structures

class  EvalFun
 
class  EvalFun2
 

Public Types

typedef TRing Ring
 
typedef TOwner Owner
 
typedef TAlloc Alloc
 
typedef TX X
 
typedef MPolynomial< n, Ring, AllocMPolyN
 Type for the multivariate polynomial. More...
 
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, MPolynomialEvaluatorImpl< n, Ring, Owner, Alloc, X >, Alloc, XX > operator() (const XX &x) const
 

Private Member Functions

 MPolynomialEvaluatorImpl (const Owner &owner, const X &evalpoint)
 
template<typename XX , typename Fun >
void evaluate (XX &res, const Fun &evalfun) const
 

Private Attributes

const OwnermyOwner
 
const XmyEvalPoint
 

Friends

template<int nn, class TT , class AA , class SS >
class MPolynomialEvaluator
 
template<int nn, class TT , class HLHL , class AA , class SS >
class MPolynomialEvaluatorImpl
 

Detailed Description

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

Description of template class 'MPolynomialEvaluatorImpl'

Another helper for polynomial evaluation. This template is returned from MPolynomialEvaluator<n, TRing, TAlloc>::operator().

The template parameter TOwner is the type of the "owner" of this template, i.e. either MPolynomialEvaluator<n+1, TRing, TAlloc> or MPolynomialEvaluatorImpl<n+1, TRing, ..., TAlloc>.

This class is a backport from Spielwiese.

Definition at line 192 of file MPolynomial.h.

Member Typedef Documentation

◆ Alloc

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

Definition at line 197 of file MPolynomial.h.

◆ MPolyN

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

Type for the multivariate polynomial.

Definition at line 200 of file MPolynomial.h.

◆ MPolyNM1

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

Type for the "child" multivariate polynomial, where the first variable X has been substituted by its value. Note that the ring type has been substituted by the type of the variable (i.e. X).

Definition at line 209 of file MPolynomial.h.

◆ Owner

template<int n, typename TRing , typename TOwner , typename TAlloc , typename TX >
typedef TOwner DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::Owner

Definition at line 196 of file MPolynomial.h.

◆ Ring

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

Definition at line 195 of file MPolynomial.h.

◆ X

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

Definition at line 198 of file MPolynomial.h.

Constructor & Destructor Documentation

◆ MPolynomialEvaluatorImpl()

template<int n, typename TRing , typename TOwner , typename TAlloc , typename TX >
DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::MPolynomialEvaluatorImpl ( const Owner owner,
const X evalpoint 
)
inlineprivate

Definition at line 222 of file MPolynomial.h.

223  : myOwner(owner), myEvalPoint(evalpoint)
224  {}

Member Function Documentation

◆ evaluate()

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

This will be called from a child (i.e. a class of type MPolynomialEvaluatorImpl<n-1, Ring, MPolynomialEvaluator<n,Ring,Owner,Alloc,X>, Alloc, X>) to trigger evaluation.

Definition at line 271 of file MPolynomial.h.

272  {
273  // We have to pass evaluation on to our owner, but give a new
274  // functor which now evaluates polynomials of type poly<n, T>.
275  myOwner.evaluate( res, EvalFun< XX, Fun >( *this, evalfun ) );
276  }

References DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::myOwner.

◆ operator MPolyNM1()

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

Allows casting to poly<n-1, S>.

Definition at line 319 of file MPolynomial.h.

321  {
322  MPolyNM1 res; // missing: determine allocator object
323  // We need to pass evaluation on to our owner
324  myOwner.evaluate( res, EvalFun2( *this ) );
325  return res;
326  }
MPolynomial< n - 1, X, typename Alloc::template rebind< X >::other > MPolyNM1
Definition: MPolynomial.h:209

References DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::myOwner.

◆ operator()()

template<int n, typename TRing , typename TOwner , typename TAlloc , typename TX >
template<typename XX >
MPolynomialEvaluatorImpl< n - 1, Ring, MPolynomialEvaluatorImpl< n, Ring, Owner, Alloc, X >, Alloc, XX > DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::operator() ( const XX &  x) const
inline

Continues evaluation with the next indeterminant. Functor returining a "child" evaluator implementation.

Parameters
xthe next indeterminant.

Definition at line 338 of file MPolynomial.h.

339  {
341  < n - 1, Ring, MPolynomialEvaluatorImpl< n, Ring, Owner, Alloc, X>,
342  Alloc, XX >( *this, x );
343  }

Friends And Related Function Documentation

◆ MPolynomialEvaluator

template<int n, typename TRing , typename TOwner , typename TAlloc , typename TX >
template<int nn, class TT , class AA , class SS >
friend class MPolynomialEvaluator
friend

Definition at line 212 of file MPolynomial.h.

◆ MPolynomialEvaluatorImpl

template<int n, typename TRing , typename TOwner , typename TAlloc , typename TX >
template<int nn, class TT , class HLHL , class AA , class SS >
friend class MPolynomialEvaluatorImpl
friend

Definition at line 215 of file MPolynomial.h.

Field Documentation

◆ myEvalPoint

template<int n, typename TRing , typename TOwner , typename TAlloc , typename TX >
const X& DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::myEvalPoint
private

◆ myOwner

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

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