GiNaCRA  0.6.4
GiNaC Namespace Reference

Data Structures

struct  infinitesimal_symbol_struct
 Type for infinitesimal values. More...
struct  ex_is_lessdeg
 Prototypal ordering on expressions which are terms. More...
struct  ex_is_less_deggrlex
 Graded lexicographic ordering on expressions which are terms. More...
struct  ex_is_less_degrevlex
 Lexicographic degree-reverse ordering on expressions which are terms. More...
struct  ex_is_under_the_staircase
 Relation determining whether the given expression is a monomial under the staircase, which is determined by computing the remainders dividing by the corners of a staircase. More...
struct  expair_is_lesseq
 Prototypal ordering on pairs of expressions which represent terms. More...
class  UnivariateRepresentation
 An implementation of a multi dimensional real algebraic number providing arithmetic and relational operations. More...

Typedefs

typedef
GiNaC::infinitesimal_symbol_struct 
infinitesimal_symbol
 Type for infinitesimal values.

Enumerations

enum  sign { NEGATIVE_SIGN, ZERO_SIGN, POSITIVE_SIGN }
 type for signs More...

Functions

const infinitesimal_symbol EPSILON ("€")
const infinitesimal_symbol DELTA ("ð")
const infinitesimal_symbol GAMMA ("đ")
const infinitesimal_symbol ZETA ("¢")
const symbol X ("X")
 standard variable for standard polynomial objects
const numeric ZERO (0)
 unique representation of zero
const ex prod (const lst &l) throw ( invalid_argument )
 Computes the product of a list of expressions.
const ex lcm (const lst &l) throw ( invalid_argument )
 Computes the least common multiple of a list of expressions.
long lcm (long a, long b)
 Computes the least common multiple of two machine integers a and b.
long gcd (long a, long b)
 Computes the greatest common divisor of two integers a and b.
long numerator (long a, long b)
 Computes the numerator q such that b / a = q / r and q and r are coprime.
long denominator (long a, long b)
 Computes the numerator r such that b / a = q / r and q and r are coprime.
bool is_constant (const ex &polynomial, const vector< symbol > &symbolLst)
 Determines whether the given polynomial expression is constant in the given list of variables.
bool is_rational_polynomial (const ex &p, const symbol &x)
 Tests whether the given expression p is a rational polynomial in x.
bool is_realalgebraic_polynomial (const ex &p, const symbol &x)
 Tests whether the given expression p is a polynomial in x with real algebraic coefficients, i.e.
bool is_realalgebraic_term (const ex &p)
 Tests whether the given expression p is a term only containing only numbers returning true on info(info_flags::numeric) && (info(info_flags::rational) || (info(info_flags::real) && info_flags::algebraic)).
sign sgn (const numeric &n)
 Determines the sign of the given numeric.
const ex monpart (const ex &polynomial, const vector< symbol > &symbolLst)
 For internal use only! Computes the monomial underlying the given polynomial in case the polynomial is a single term.
const ex coeffpart (const ex &polynomial, const vector< symbol > &symbolLst)
 For internal use only! Computes the polynomial coefficient underlying the given polynomial in case the polynomial is a single term.
void isolateByVariables (const ex &polynomial, const vector< symbol > &symbolLst, ex &coefficient, ex &monomial)
 For internal use only! Determins the monomial and its coefficient of the given polynomial w.r.t.
const GiNaC::ex rationalize (const GiNaC::ex &p, const vector< GiNaC::symbol > &symbolLst)
 Converts all coefficients of the given rational polynomial in the variables symbolLst to an exact rational numeric, so that is_rational_polynomial returns true.
const GiNaC::ex rationalize (const GiNaC::ex &p, const GiNaC::symbol &s)
 Converts all coefficients of the given rational polynomial in the variable s to an exact rational numeric, so that is_rational_polynomial returns true.
const GiNaC::numeric rationalize (const GiNaC::numeric &n)
 Converts the given numeric value to an exact numeric one.
const vector< symbol > sortVariables (const vector< symbol > &l)
 Sorts the given list of symbols lexicographicly.
bool symbol_is_lesseq_lex (const symbol &a, const symbol &b)
 Compares two expressions lexicographically by their string representations.
bool symbol_is_less_lex (const symbol &a, const symbol &b)
 Compares two expressions lexicographically by their string representations.
const map< int, ex > signedSubresultants (const ex &A, const ex &B, const symbol &sym)
 Returns the signed Subresultant sequence.
const vector< ex > signedSubresultantsCoefficients (const ex &A, const ex &B, const symbol &sym) throw ( invalid_argument )
 Returns the Signed Subresultant Coefficient sequence.

Detailed Description

Author:
Ulrich Loup
Since:
2011-04-30
Version:
2011-04-30
See also:
ISBN 0-387-94090-1 and ISBN-13: 978-3642069642

Notation is following http://www.possibility.com/Cpp/CppCodingStandard.html.


Typedef Documentation

Type for infinitesimal values.


Enumeration Type Documentation

type for signs

Enumerator:
NEGATIVE_SIGN 
ZERO_SIGN 
POSITIVE_SIGN 

Definition at line 99 of file constants.h.


Function Documentation

const ex GiNaC::coeffpart ( const ex &  polynomial,
const vector< symbol > &  symbolLst 
)

For internal use only! Computes the polynomial coefficient underlying the given polynomial in case the polynomial is a single term.

Otherwise the method returns 1.

Parameters:
polynomial
symbolLst
Returns:
the (polynomial) coefficient underlying the given polynomial or 1 in case the expression is a sum.

Definition at line 160 of file utilities.cpp.

References isolateByVariables().

long GiNaC::denominator ( long  a,
long  b 
)

Computes the numerator r such that b / a = q / r and q and r are coprime.

Parameters:
a
b
Returns:
b / gcd(a, b)
Runtime complexity:
O( digits( min(a, b) ) ) + integer division

Definition at line 87 of file utilities.cpp.

References gcd().

Referenced by GiNaCRA::OpenInterval::findSample(), and GiNaCRA::OpenInterval::sample().

long GiNaC::gcd ( long  a,
long  b 
)

Computes the greatest common divisor of two integers a and b.

Parameters:
a
b
Returns:
gcd(a, b)
Runtime complexity:
O( digits( min(a, b) ) )

Definition at line 68 of file utilities.cpp.

Referenced by denominator(), GiNaCRA::OpenInterval::findSample(), GiNaCRA::UnivariatePolynomial::gcd(), lcm(), and numerator().

bool GiNaC::is_constant ( const ex &  polynomial,
const vector< symbol > &  symbolLst 
)

Determines whether the given polynomial expression is constant in the given list of variables.

Parameters:
polynomial
symbolLst
Returns:
the monomial underlying the given polynomial or 1 in case the expression is a sum.

Definition at line 92 of file utilities.cpp.

Referenced by isolateByVariables(), and GiNaCRA::MultivariatePolynomialMR::MultivariatePolynomialMR().

bool GiNaC::is_rational_polynomial ( const ex &  p,
const symbol &  x 
)

Tests whether the given expression p is a rational polynomial in x.

Parameters:
p
x
Returns:
false in case the polynomial was found to be not rational, true otherwise

Definition at line 100 of file utilities.cpp.

Referenced by GiNaCRA::RationalUnivariatePolynomial::RationalUnivariatePolynomial().

bool GiNaC::is_realalgebraic_polynomial ( const ex &  p,
const symbol &  x 
)

Tests whether the given expression p is a polynomial in x with real algebraic coefficients, i.e.

coefficients being rational or mixed terms with RealAlgebraicNumberIRs.

Parameters:
p
x
Returns:
false in case the polynomial was found to be not real algebraic, true otherwise

Definition at line 113 of file utilities.cpp.

References is_realalgebraic_term().

bool GiNaC::is_realalgebraic_term ( const ex &  p)

Tests whether the given expression p is a term only containing only numbers returning true on info(info_flags::numeric) && (info(info_flags::rational) || (info(info_flags::real) && info_flags::algebraic)).

Parameters:
p
Returns:
false in case the term was found to be not real algebraic, true otherwise

Definition at line 123 of file utilities.cpp.

Referenced by is_realalgebraic_polynomial().

void GiNaC::isolateByVariables ( const ex &  polynomial,
const vector< symbol > &  symbolLst,
ex &  coefficient,
ex &  monomial 
)

For internal use only! Determins the monomial and its coefficient of the given polynomial w.r.t.

the given list of variables, in case the polynomial is a single term. Otherwise the method returns 1.

Parameters:
polynomial
symbolLst
coefficientrefernce to the coefficient to isolate
monomialreference to the monomial to isolate
Returns:
the monomial underlying the given polynomial or 1 in case the expression is a sum.

Definition at line 168 of file utilities.cpp.

References is_constant().

Referenced by GiNaCRA::Constraint::checkVariables(), coeffpart(), monpart(), and rationalize().

const ex GiNaC::lcm ( const lst &  l) throw ( invalid_argument )

Computes the least common multiple of a list of expressions.

Parameters:
llist of expressions
Returns:
lcm
Runtime complexity:
linearly (in the length of l) many calls of GiNaC::lcm

Definition at line 52 of file utilities.cpp.

Referenced by GiNaCRA::MultivariatePolynomialFactory::coefficientLcm(), and GiNaCRA::OpenInterval::findSample().

long GiNaC::lcm ( long  a,
long  b 
)

Computes the least common multiple of two machine integers a and b.

Parameters:
a
b
Returns:
lcm(a, b)
Runtime complexity:
the complexity of gcd(a, b)

Definition at line 62 of file utilities.cpp.

References gcd().

const ex GiNaC::monpart ( const ex &  polynomial,
const vector< symbol > &  symbolLst 
)

For internal use only! Computes the monomial underlying the given polynomial in case the polynomial is a single term.

Otherwise the method returns 1.

Parameters:
polynomial
symbolLst
Returns:
the monomial underlying the given polynomial or 1 in case the expression is a sum.

Definition at line 152 of file utilities.cpp.

References isolateByVariables().

long GiNaC::numerator ( long  a,
long  b 
)

Computes the numerator q such that b / a = q / r and q and r are coprime.

Parameters:
a
b
Returns:
a / gcd(a, b)
Runtime complexity:
O( digits( min(a, b) ) ) + one integer division

Definition at line 82 of file utilities.cpp.

References gcd().

Referenced by GiNaCRA::OpenInterval::findSample(), and GiNaCRA::OpenInterval::sample().

const ex GiNaC::prod ( const lst &  l) throw ( invalid_argument )

Computes the product of a list of expressions.

Parameters:
llist of expressions
Returns:
prod

Definition at line 42 of file utilities.cpp.

Referenced by GiNaCRA::MultivariatePolynomialFactory::specialGroebnerBasis().

const GiNaC::ex GiNaC::rationalize ( const GiNaC::ex &  p,
const vector< GiNaC::symbol > &  symbolLst 
)

Converts all coefficients of the given rational polynomial in the variables symbolLst to an exact rational numeric, so that is_rational_polynomial returns true.

Parameters:
p
symbolLst
Returns:
p with all coefficients converted to an exact rational numeric

Definition at line 216 of file utilities.cpp.

References isolateByVariables().

Referenced by rationalize().

const GiNaC::ex GiNaC::rationalize ( const GiNaC::ex &  p,
const GiNaC::symbol &  s 
) [inline]

Converts all coefficients of the given rational polynomial in the variable s to an exact rational numeric, so that is_rational_polynomial returns true.

Parameters:
p
s
Returns:
p with all coefficients converted to an exact rational numeric

Definition at line 236 of file utilities.cpp.

References rationalize().

const GiNaC::numeric GiNaC::rationalize ( const GiNaC::numeric &  n) [inline]

Converts the given numeric value to an exact numeric one.

Parameters:
n
Returns:
an exact rational numeric of n

Definition at line 241 of file utilities.cpp.

References rationalize().

sign GiNaC::sgn ( const numeric &  n)

Determines the sign of the given numeric.

Parameters:
nnumeric
Returns:
the sign of the given numeric

Definition at line 147 of file utilities.cpp.

References NEGATIVE_SIGN, POSITIVE_SIGN, and ZERO_SIGN.

Referenced by GiNaCRA::OpenInterval::abs(), and GiNaCRA::Constraint::satisfiedBy().

const map< int, ex > GiNaC::signedSubresultants ( const ex &  A,
const ex &  B,
const symbol &  sym 
)

Returns the signed Subresultant sequence.

The algorithm is originally from "New structure theorem for subresultants" - Henri Lombardi, Marie-Francoise Roy and Mohab Safey El Din. See page 11-12 for the algorithm and page 5 for the notation.

Parameters:
Athe first Polynomial
Bthe second Polynomial
symthe main variable
Runtime complexity:
O( deg(A)*deg(B) )
Returns:
a map from int to ex, where the i-th index corresponds to the i-th subresultant in the subresultant sequence

Definition at line 269 of file utilities.cpp.

Referenced by signedSubresultantsCoefficients().

const vector< ex > GiNaC::signedSubresultantsCoefficients ( const ex &  A,
const ex &  B,
const symbol &  sym 
) throw ( invalid_argument )

Returns the Signed Subresultant Coefficient sequence.

The vectors contains the i-th coefficient of the i-th element of Signed Subresultant sequence in the i-th position. The Algorithm calls calculateSignedSubresultants for the computation.

Parameters:
Athe first Polynomial
Bthe second Polynomial
symthe main variable
Runtime complexity:
O( deg(A)*deg(B) )
Returns:
a vector of ex with the coefficients

Definition at line 381 of file utilities.cpp.

References signedSubresultants().

const vector< symbol > GiNaC::sortVariables ( const vector< symbol > &  l)

Sorts the given list of symbols lexicographicly.

Returns:
new symbol list sorted lexicographicly

Definition at line 246 of file utilities.cpp.

References symbol_is_less_lex().

Referenced by GiNaCRA::MultivariatePolynomialFactory::generalPositionTemplate().

bool GiNaC::symbol_is_less_lex ( const symbol &  a,
const symbol &  b 
)

Compares two expressions lexicographically by their string representations.

Parameters:
a
b
Returns:
true in case a is strictly less than b

Definition at line 261 of file utilities.cpp.

Referenced by sortVariables().

bool GiNaC::symbol_is_lesseq_lex ( const symbol &  a,
const symbol &  b 
)

Compares two expressions lexicographically by their string representations.

Parameters:
a
b
Returns:
true in case a is less or equal to b

Definition at line 253 of file utilities.cpp.

const symbol GiNaC::X ( "X"  )

standard variable for standard polynomial objects

const numeric GiNaC::ZERO ( )

unique representation of zero

Referenced by GiNaCRA::CAD::samples().