DGtal 1.3.0
Loading...
Searching...
No Matches
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>

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
 The polynomial in question. More...
 
const XmyEvalPoint
 The evaluation point. More...
 

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

◆ Alloc

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

Definition at line 350 of file MPolynomial.h.

◆ MPoly1

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.

◆ Ring

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

Definition at line 349 of file MPolynomial.h.

◆ X

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

◆ MPolynomialEvaluator()

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 X & myEvalPoint
The evaluation point.
Definition: MPolynomial.h:356
const MPoly1 & myPoly
The polynomial in question.
Definition: MPolynomial.h:355

Member Function Documentation

◆ operator X()

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.

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 }
Size size() const
Definition: MPolynomial.h:742

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().

◆ operator()()

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

◆ MPolynomial< 1, TRing, TAlloc >

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

Definition at line 291 of file MPolynomial.h.

Field Documentation

◆ myEvalPoint

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.

◆ myPoly

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: