CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
A class to represent polynomials, as a collection of Monomial and coefficients.
Definition at line 113 of file CepsPolynomial.hpp.
#include <CepsPolynomial.hpp>
Public Types | |
using | ExponentType = typename Monomial< _ArgsDim >::ExponentType |
convenience typedef More... | |
using | ArgType = typename Monomial< _ArgsDim >::ArgType |
convenience typedef More... | |
using | GradientType = typename Monomial< _ArgsDim >::GradientType |
convenience typedef More... | |
using | FunctionType = typename Monomial< _ArgsDim >::FunctionType |
convenience typedef More... | |
using | MonomialType = Monomial< _ArgsDim > |
convenience typedef More... | |
Public Member Functions | |
Polynomial () | |
Default constructor, empty polynomial. More... | |
Polynomial (const Polynomial &that) | |
Copy constructor. More... | |
Polynomial & | operator= (const Polynomial &that) |
Assignment operator. More... | |
~Polynomial () | |
destructor More... | |
void | add (CepsReal coeff, ExponentType exponent) |
Adds a new monomial to the polynomial. More... | |
void | add (const CepsVector< CepsReal > &coeffs, const CepsVector< ExponentType > &exponents) |
Adds several new monomials to the polynomial. More... | |
void | add (const Eigen::Matrix< CepsReal, 1, -1 > &coeffs, const CepsVector< ExponentType > &exponents) |
Adds several new monomials to the polynomial, Eigen format. More... | |
void | setCoeff (CepsReal coeff, const ExponentType &exponent) |
Change the coefficient of a given monomial. More... | |
CepsBool | contains (const MonomialType &other) |
Tells if polynomial contains the given monomial. More... | |
CepsBool | contains (const ExponentType &other) |
Tells if polynomial contains the given monomial. More... | |
CepsReal & | coeffAt (const ExponentType &other) |
Get the coefficient of the associated monomial. 0 if missing. More... | |
CepsReal | eval (const ArgType &x) override |
Evaluate at x (x in ) More... | |
GradientType | gradient (const ArgType &x) const |
Evaluate gradient at x (x in ) More... | |
CepsUInt | getNumberOfMonomials () const |
Returns "size" of polynomial. More... | |
void | reset () |
Wipes the content. More... | |
void | pruneZeroCoeffs (CepsReal epsilon=FLOATING_POINT_EPSILON) |
Removes monomial with 0 coefficient. More... | |
Polynomial | operator* (const Polynomial &b) |
Returns this*b. More... | |
Protected Attributes | |
CepsVector< CepsReal > | m_coeffs |
Coefficients for all monomes. More... | |
CepsVector< MonomialType > | m_mono |
The monomes. More... | |
using Polynomial< _ArgsDim >::ArgType = typename Monomial<_ArgsDim>::ArgType |
convenience typedef
Definition at line 121 of file CepsPolynomial.hpp.
using Polynomial< _ArgsDim >::ExponentType = typename Monomial<_ArgsDim>::ExponentType |
convenience typedef
Definition at line 119 of file CepsPolynomial.hpp.
using Polynomial< _ArgsDim >::FunctionType = typename Monomial<_ArgsDim>::FunctionType |
convenience typedef
Definition at line 125 of file CepsPolynomial.hpp.
using Polynomial< _ArgsDim >::GradientType = typename Monomial<_ArgsDim>::GradientType |
convenience typedef
Definition at line 123 of file CepsPolynomial.hpp.
using Polynomial< _ArgsDim >::MonomialType = Monomial<_ArgsDim> |
convenience typedef
Definition at line 127 of file CepsPolynomial.hpp.
Polynomial< _ArgsDim >::Polynomial | ( | ) |
Default constructor, empty polynomial.
Polynomial< _ArgsDim >::Polynomial | ( | const Polynomial< _ArgsDim > & | that | ) |
Copy constructor.
Polynomial< _ArgsDim >::~Polynomial | ( | ) |
destructor
void Polynomial< _ArgsDim >::add | ( | CepsReal | coeff, |
ExponentType | exponent | ||
) |
Adds a new monomial to the polynomial.
void Polynomial< _ArgsDim >::add | ( | const CepsVector< CepsReal > & | coeffs, |
const CepsVector< ExponentType > & | exponents | ||
) |
Adds several new monomials to the polynomial.
void Polynomial< _ArgsDim >::add | ( | const Eigen::Matrix< CepsReal, 1, -1 > & | coeffs, |
const CepsVector< ExponentType > & | exponents | ||
) |
Adds several new monomials to the polynomial, Eigen format.
CepsReal& Polynomial< _ArgsDim >::coeffAt | ( | const ExponentType & | other | ) |
Get the coefficient of the associated monomial. 0 if missing.
CepsBool Polynomial< _ArgsDim >::contains | ( | const ExponentType & | other | ) |
Tells if polynomial contains the given monomial.
CepsBool Polynomial< _ArgsDim >::contains | ( | const MonomialType & | other | ) |
Tells if polynomial contains the given monomial.
|
override |
Evaluate at x (x in )
CepsUInt Polynomial< _ArgsDim >::getNumberOfMonomials | ( | ) | const |
Returns "size" of polynomial.
GradientType Polynomial< _ArgsDim >::gradient | ( | const ArgType & | x | ) | const |
Evaluate gradient at x (x in )
Polynomial Polynomial< _ArgsDim >::operator* | ( | const Polynomial< _ArgsDim > & | b | ) |
Returns this*b.
Polynomial& Polynomial< _ArgsDim >::operator= | ( | const Polynomial< _ArgsDim > & | that | ) |
Assignment operator.
void Polynomial< _ArgsDim >::pruneZeroCoeffs | ( | CepsReal | epsilon = FLOATING_POINT_EPSILON | ) |
Removes monomial with 0 coefficient.
void Polynomial< _ArgsDim >::reset | ( | ) |
Wipes the content.
void Polynomial< _ArgsDim >::setCoeff | ( | CepsReal | coeff, |
const ExponentType & | exponent | ||
) |
Change the coefficient of a given monomial.
|
protected |
Coefficients for all monomes.
Definition at line 196 of file CepsPolynomial.hpp.
|
protected |
The monomes.
Definition at line 198 of file CepsPolynomial.hpp.