Sturm  0.0.0
Computing Sturm sequences in C++
Loading...
Searching...
No Matches
Sturm Namespace Reference

Namespace for the Sturm library. More...

Classes

class  Poly
 Polynomial class. More...
class  Sequence
 Sturm sequence class. More...

Typedefs

using Integer = STURM_DEFAULT_INTEGER_TYPE
 The Integer type as used for the API.

Functions

template<typename Real>
Poly< Real > operator+ (const Poly< Real > &p_1, const Poly< Real > &p_2)
 Define the sum between two polynomials.
template<typename Real>
Poly< Real > operator+ (const Poly< Real > &p, Real s)
 Define the sum between a polynomial and a scalar.
template<typename Real>
Poly< Real > operator+ (Real s, const Poly< Real > &p)
 Define the sum between a polynomial and a scalar.
template<typename Real>
Poly< Real > operator- (const Poly< Real > &p_1, const Poly< Real > &p_2)
 Define the difference between two polynomials.
template<typename Real>
Poly< Real > operator- (const Poly< Real > &p, Real s)
 Define the difference between a scalar and a polynomial.
template<typename Real>
Poly< Real > operator- (Real s, const Poly< Real > &p)
 Define the difference between a scalar and a polynomial.
template<typename Real>
Poly< Real > operator* (const Poly< Real > &p_1, const Poly< Real > &p_2)
 Define the multiplication between two polynomials.
template<typename Real>
Poly< Real > operator* (Real p, const Poly< Real > &s)
 Define the multiplication between a scalar and a polynomial.
template<typename Real>
Poly< Real > operator* (const Poly< Real > &s, Real p)
 Define the multiplication between a scalar and a polynomial.
template<typename Real>
void divide (const Poly< Real > &p_1, const Poly< Real > &p_2, Poly< Real > &q, Poly< Real > &r)
 Divide the polynomial.
template<typename Real>
void GCD (const Poly< Real > &p_1, const Poly< Real > &p_2, Poly< Real > &gcd, Real eps=Poly< Real >::EPSILON)
 Compute the greatest common divisor of two polynomials.
template<typename Real>
std::ostream & operator<< (std::ostream &os, const Poly< Real > &p)
 Print the polynomial on an output stream.
template<typename Real>
std::ostream & operator<< (std::ostream &os, const Sequence< Real > &s)
 Print the Sturm sequence on an output stream.

Detailed Description

This namespace contains all the classes and functions of the Sturm library for the computation of the Sturm sequences and the greatest common divisor polynomials. Other basic functions to manipulate polynomials and sequences are also included.

Typedef Documentation

◆ Integer

The Integer type, #define the preprocessor symbol STURM_DEFAULT_INTEGER_TYPE. The default value is int.

Function Documentation

◆ divide()

template<typename Real>
void Sturm::divide ( const Poly< Real > & p_1,
const Poly< Real > & p_2,
Poly< Real > & q,
Poly< Real > & r )
inline

Divide the polynomial \( p_1(x) \) by \( p_2(x) \) with remainder \(r(x) \) and quotient \( q(x) \).

Parameters
[in]p_1Polynomial to divide.
[in]p_2Polynomial to divide by.
[out]qQuotient polynomial.
[out]rRemainder polynomial.
Template Parameters
RealScalar number type.

◆ GCD()

template<typename Real>
void Sturm::GCD ( const Poly< Real > & p_1,
const Poly< Real > & p_2,
Poly< Real > & gcd,
Real eps = Poly<Real>::EPSILON )
inline
Parameters
[in]p_1First polynomial.
[in]p_2Second polynomial.
[out]gcdGreatest common divisor polynomial.
[in]epsEpsilon value for purging coefficients.
Template Parameters
RealScalar number type.

◆ operator*() [1/3]

template<typename Real>
Poly< Real > Sturm::operator* ( const Poly< Real > & p_1,
const Poly< Real > & p_2 )
inline
Parameters
[in]p_1First polynomial to multiply.
[in]p_2Second polynomial to multiply.
Returns
The operation result.
Template Parameters
RealScalar number type.

◆ operator*() [2/3]

template<typename Real>
Poly< Real > Sturm::operator* ( const Poly< Real > & s,
Real p )
inline
Parameters
[in]sScalar to multiply.
[in]pPolynomial to multiply.
Returns
The operation result.
Template Parameters
RealScalar number type.

◆ operator*() [3/3]

template<typename Real>
Poly< Real > Sturm::operator* ( Real p,
const Poly< Real > & s )
inline
Parameters
[in]pPolynomial to multiply.
[in]sScalar to multiply.
Returns
The operation result.
Template Parameters
RealScalar number type.

◆ operator+() [1/3]

template<typename Real>
Poly< Real > Sturm::operator+ ( const Poly< Real > & p,
Real s )
inline
Parameters
[in]pPolynomial to sum.
[in]sScalar to sum.
Returns
The operation result.
Template Parameters
RealScalar number type.

◆ operator+() [2/3]

template<typename Real>
Poly< Real > Sturm::operator+ ( const Poly< Real > & p_1,
const Poly< Real > & p_2 )
inline
Parameters
[in]p_1First polynomial to sum.
[in]p_2Second polynomial to sum.
Returns
The operation result.
Template Parameters
RealScalar number type.

◆ operator+() [3/3]

template<typename Real>
Poly< Real > Sturm::operator+ ( Real s,
const Poly< Real > & p )
inline
Parameters
[in]sScalar to sum.
[in]pPolynomial to sum.
Returns
The operation result.
Template Parameters
RealScalar number type.

◆ operator-() [1/3]

template<typename Real>
Poly< Real > Sturm::operator- ( const Poly< Real > & p,
Real s )
inline
Parameters
[in]pPolynomial to subtract.
[in]sScalar to subtract.
Returns
The operation result.
Template Parameters
RealScalar number type.

◆ operator-() [2/3]

template<typename Real>
Poly< Real > Sturm::operator- ( const Poly< Real > & p_1,
const Poly< Real > & p_2 )
inline
Parameters
[in]p_1First polynomial to subtract.
[in]p_2Second polynomial to subtract.
Returns
The operation result.
Template Parameters
RealScalar number type.

◆ operator-() [3/3]

template<typename Real>
Poly< Real > Sturm::operator- ( Real s,
const Poly< Real > & p )
inline
Parameters
[in]sScalar to subtract.
[in]pPolynomial to subtract.
Returns
The operation result.
Template Parameters
RealScalar number type.

◆ operator<<() [1/2]

template<typename Real>
std::ostream & Sturm::operator<< ( std::ostream & os,
const Poly< Real > & p )
inline
Parameters
[in]osOutput stream.
[in]pPolynomial.
Returns
The output stream.
Template Parameters
RealScalar number type.

◆ operator<<() [2/2]

template<typename Real>
std::ostream & Sturm::operator<< ( std::ostream & os,
const Sequence< Real > & s )
inline
Parameters
[in]osOutput stream.
[in]sSturm sequence.
Returns
The output stream.
Template Parameters
RealScalar number type.