DGtal 2.0.0
Loading...
Searching...
No Matches
DGtal::MPolynomialEvaluatorImpl< 1, TRing, TOwner, TAlloc, TX >::EvalFun Class Reference

Public Member Functions

 EvalFun (const MPolynomialEvaluatorImpl< 1, Ring, Owner, Alloc, X > &owner)
 
X operator() (const MPolynomial< 1, Ring, Alloc > &p) const
 

Private Attributes

const MPolynomialEvaluatorImpl< 1, Ring, Owner, Alloc, X > & myOwner
 

Detailed Description

template<typename TRing, typename TOwner, typename TAlloc, typename TX>
class DGtal::MPolynomialEvaluatorImpl< 1, TRing, TOwner, TAlloc, TX >::EvalFun

Evaluates a polynomial of type MPolynomial<1, T> in myEvalPoint.

Definition at line 127 of file MPolynomial.h.

Constructor & Destructor Documentation

◆ EvalFun()

template<typename TRing , typename TOwner , typename TAlloc , typename TX >
DGtal::MPolynomialEvaluatorImpl< 1, TRing, TOwner, TAlloc, TX >::EvalFun::EvalFun ( const MPolynomialEvaluatorImpl< 1, Ring, Owner, Alloc, X > &  owner)
inline

Definition at line 133 of file MPolynomial.h.

135 : myOwner(owner)
136 {}
const MPolynomialEvaluatorImpl< 1, Ring, Owner, Alloc, X > & myOwner

Member Function Documentation

◆ operator()()

template<typename TRing , typename TOwner , typename TAlloc , typename TX >
X DGtal::MPolynomialEvaluatorImpl< 1, TRing, TOwner, TAlloc, TX >::EvalFun::operator() ( const MPolynomial< 1, Ring, Alloc > &  p) const
inline

Evalutate polynomial p at the point stored in myOwner.

Parameters
pa monovariate polynomial.
Returns
the value of p at the point.

Definition at line 144 of file MPolynomial.h.

145 {
146 X res = (X) 0;
147 X xx = (X) 1;
148 for ( int i = 0; i < (int) p.myValue.size(); ++i )
149 {
150 res += (X)(Ring) p.myValue[i] * xx;
151 xx = xx * myOwner.myEvalPoint;
152 }
153 return res;
154 }
RealPointT::Coordinate Ring

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

Field Documentation

◆ myOwner

template<typename TRing , typename TOwner , typename TAlloc , typename TX >
const MPolynomialEvaluatorImpl<1, Ring, Owner, Alloc, X>& DGtal::MPolynomialEvaluatorImpl< 1, TRing, TOwner, TAlloc, TX >::EvalFun::myOwner
private

Definition at line 129 of file MPolynomial.h.


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