DGtal  0.9.3beta
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
DGtal::MPolynomialEvaluator< 1, TRing, TAlloc, TX > Class Template Reference

#include <DGtal/math/MPolynomial.h>

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

Public Types

typedef TRing Ring
 
typedef TAlloc Alloc
 
typedef TX X
 
typedef MPolynomial< 1, Ring, AllocMPoly1
 

Public Member Functions

 operator X () const
 
X operator() () const
 

Private Member Functions

 MPolynomialEvaluator (const MPoly1 &poly, const X &evalpoint)
 

Private Attributes

const MPoly1myPoly
 
const XmyEvalPoint
 

Friends

class MPolynomial< 1, TRing, TAlloc >
 

Detailed Description

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

The top level polynomial evaluation class, in case n = 1, i.e. does direct evaluation.

This class is a backport from Spielwiese.

Definition at line 345 of file MPolynomial.h.

Member Typedef Documentation

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

Definition at line 350 of file MPolynomial.h.

template<typename TRing , typename TAlloc , typename TX >
typedef MPolynomial< 1, Ring, Alloc > DGtal::MPolynomialEvaluator< 1, TRing, TAlloc, TX >::MPoly1

Definition at line 352 of file MPolynomial.h.

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

Definition at line 349 of file MPolynomial.h.

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

Definition at line 351 of file MPolynomial.h.

Constructor & Destructor Documentation

template<typename TRing , typename TAlloc , typename TX >
DGtal::MPolynomialEvaluator< 1, TRing, TAlloc, TX >::MPolynomialEvaluator ( const MPoly1 poly,
const X evalpoint 
)
inlineprivate

Definition at line 359 of file MPolynomial.h.

360  : myPoly( poly ), myEvalPoint( evalpoint )
361  {}
const MPoly1 & myPoly
The polynomial in question.
Definition: MPolynomial.h:355
const X & myEvalPoint
The evaluation point.
Definition: MPolynomial.h:356

Member Function Documentation

template<typename TRing , typename TAlloc , typename TX >
DGtal::MPolynomialEvaluator< 1, TRing, TAlloc, TX >::operator X ( ) const
inline

Casting to X is done by evaluation in myEvalPoint.

Definition at line 368 of file MPolynomial.h.

References DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::myEvalPoint, and DGtal::MPolynomial< n, TRing, TAlloc >::myValue.

369  {
370  X res = (X) 0;
371  X xx = (X) 1;
372  for ( int i = 0; i < (int) myPoly.myValue.size(); ++i )
373  {
374  res += ( (X) (Ring) myPoly.myValue[i] ) * xx;
375  xx = xx * myEvalPoint;
376  }
377  return res;
378  }
const MPoly1 & myPoly
The polynomial in question.
Definition: MPolynomial.h:355
const X & myEvalPoint
The evaluation point.
Definition: MPolynomial.h:356
template<typename TRing , typename TAlloc , typename TX >
X DGtal::MPolynomialEvaluator< 1, TRing, TAlloc, TX >::operator() ( ) const
inline

Evaluates and returns value in X.

Definition at line 384 of file MPolynomial.h.

385  {
386  return (X) (*this);
387  }

Friends And Related Function Documentation

template<typename TRing , typename TAlloc , typename TX >
friend class MPolynomial< 1, TRing, TAlloc >
friend

Definition at line 347 of file MPolynomial.h.

Field Documentation

template<typename TRing , typename TAlloc , typename TX >
const X& DGtal::MPolynomialEvaluator< 1, TRing, TAlloc, TX >::myEvalPoint
private

The evaluation point.

Definition at line 356 of file MPolynomial.h.

template<typename TRing , typename TAlloc , typename TX >
const MPoly1& DGtal::MPolynomialEvaluator< 1, TRing, TAlloc, TX >::myPoly
private

The polynomial in question.

Definition at line 355 of file MPolynomial.h.


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