Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
MathUtils::Rational Class Reference

Rational function functor: f(x) = P(x) / Q(x). Both numerator P and denominator Q are polynomials. More...

#include <MathUtils_FunctorScalar.hxx>

Public Member Functions

 Rational (const math_Vector &theNum, const math_Vector &theDenom)
 Constructor from math_Vector.
 
 Rational (std::initializer_list< double > theNum, std::initializer_list< double > theDenom)
 Constructor from initializer lists.
 
bool Value (double theX, double &theY) const
 Evaluates rational function at theX.
 

Detailed Description

Rational function functor: f(x) = P(x) / Q(x). Both numerator P and denominator Q are polynomials.

Usage:

// (x + 1) / (x^2 + 1)
Rational aRat({1.0, 1.0}, {1.0, 0.0, 1.0});
Rational function functor: f(x) = P(x) / Q(x). Both numerator P and denominator Q are polynomials.
Definition MathUtils_FunctorScalar.hxx:252
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142

Constructor & Destructor Documentation

◆ Rational() [1/2]

MathUtils::Rational::Rational ( const math_Vector & theNum,
const math_Vector & theDenom )
inline

Constructor from math_Vector.

Parameters
theNumnumerator coefficients (ascending power order)
theDenomdenominator coefficients (ascending power order)

◆ Rational() [2/2]

MathUtils::Rational::Rational ( std::initializer_list< double > theNum,
std::initializer_list< double > theDenom )
inline

Constructor from initializer lists.

Parameters
theNumnumerator coefficients
theDenomdenominator coefficients

Member Function Documentation

◆ Value()

bool MathUtils::Rational::Value ( double theX,
double & theY ) const
inline

Evaluates rational function at theX.

Parameters
[in]theXinput value
[out]theYfunction value P(theX)/Q(theX)
Returns
false if denominator is zero

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