GiNaCRA
0.6.4
|
This class encapsulates several representations of real algebraic numbers and provides crucial operations such as arithmetic, ordering or sign determination on them. More...
#include <RealAlgebraicNumber.h>
Public Member Functions | |
RealAlgebraicNumber (bool isRoot, bool isNumeric=false, const numeric &value=0) | |
Constructs a real algebraic number with a specified marking as to whether this number stems from a real root computation or not. | |
~RealAlgebraicNumber () | |
Destructor. | |
virtual std::tr1::shared_ptr < RealAlgebraicNumber > | clone () const |
Clone-"Constructor". | |
const bool | isRoot () const |
void | setIsRoot (bool isRoot) |
Set the flag marking whether the real algebraic number stems from a root computation or not. | |
bool | isNumeric () const |
Returns true if an exact numeric representation was found during the refinements. | |
const numeric | value () const |
Gives an exact numeric representation of this real algebraic number which could have been found during the refinement steps. | |
virtual const RealAlgebraicNumber & | operator= (const RealAlgebraicNumber &o) |
This real algebraic number gets all values of the other. | |
virtual GiNaC::sign | sgn () const |
Returns sign (GiNaC::ZERO_SIGN, GiNaC::POSITIVE_SIGN, GiNaC::NEGATIVE_SIGN) of this real algebraic number. | |
virtual GiNaC::sign | sgn (const RationalUnivariatePolynomial &p) const |
Returns sign (GiNaC::ZERO_SIGN, GiNaC::POSITIVE_SIGN, GiNaC::NEGATIVE_SIGN) of the specified univariate polynomial at this real algebraic number. | |
virtual const numeric | approximateValue () const |
Computes a numeric value for this real algebraic number approximating it. | |
Protected Attributes | |
bool | mIsRoot |
flag indicating whether this number represents a root of a polynomial or an intermediate point | |
bool | mIsNumeric |
flag indicating whether this number is representable by a numeric | |
numeric | mValue |
the exact numeric value of this number if available, otherwise mIsNumeric is false and mValue 0 |
This class encapsulates several representations of real algebraic numbers and provides crucial operations such as arithmetic, ordering or sign determination on them.
Definition at line 42 of file RealAlgebraicNumber.h.
GiNaCRA::RealAlgebraicNumber::RealAlgebraicNumber | ( | bool | isRoot, |
bool | isNumeric = false , |
||
const numeric & | value = 0 |
||
) |
Constructs a real algebraic number with a specified marking as to whether this number stems from a real root computation or not.
isRoot | true marks this real algebraic number to stem from a root computation |
isNumeric | true marks this real algebraic number to be representable as an exact numeric (standard is false) |
value | the exact numeric value of this number if available, otherwise mIsNumeric is false and mValue 0 |
Definition at line 41 of file RealAlgebraicNumber.cpp.
Referenced by clone().
Destructor.
Definition at line 47 of file RealAlgebraicNumber.cpp.
const numeric GiNaCRA::RealAlgebraicNumber::approximateValue | ( | ) | const [virtual] |
Computes a numeric value for this real algebraic number approximating it.
Reimplemented in GiNaCRA::RealAlgebraicNumberIR, and GiNaCRA::RealAlgebraicNumberNR.
Definition at line 63 of file RealAlgebraicNumber.cpp.
virtual std::tr1::shared_ptr<RealAlgebraicNumber> GiNaCRA::RealAlgebraicNumber::clone | ( | ) | const [inline, virtual] |
Clone-"Constructor".
Reimplemented in GiNaCRA::RealAlgebraicNumberIR, and GiNaCRA::RealAlgebraicNumberNR.
Definition at line 66 of file RealAlgebraicNumber.h.
References RealAlgebraicNumber().
bool GiNaCRA::RealAlgebraicNumber::isNumeric | ( | ) | const [inline] |
Returns true if an exact numeric representation was found during the refinements.
true
if an exact numeric representation was found during the refinements, false
otherwise. Definition at line 96 of file RealAlgebraicNumber.h.
References mIsNumeric.
Referenced by GiNaCRA::binaryOperator().
const bool GiNaCRA::RealAlgebraicNumber::isRoot | ( | ) | const [inline] |
Definition at line 78 of file RealAlgebraicNumber.h.
References mIsRoot.
Referenced by setIsRoot().
virtual const RealAlgebraicNumber& GiNaCRA::RealAlgebraicNumber::operator= | ( | const RealAlgebraicNumber & | o | ) | [inline, virtual] |
This real algebraic number gets all values of the other.
o | other real algebraic number |
Definition at line 120 of file RealAlgebraicNumber.h.
References mIsRoot.
void GiNaCRA::RealAlgebraicNumber::setIsRoot | ( | bool | isRoot | ) | [inline] |
Set the flag marking whether the real algebraic number stems from a root computation or not.
isRoot |
Definition at line 87 of file RealAlgebraicNumber.h.
GiNaC::sign GiNaCRA::RealAlgebraicNumber::sgn | ( | ) | const [virtual] |
Returns sign (GiNaC::ZERO_SIGN, GiNaC::POSITIVE_SIGN, GiNaC::NEGATIVE_SIGN) of this real algebraic number.
Reimplemented in GiNaCRA::RealAlgebraicNumberIR, and GiNaCRA::RealAlgebraicNumberNR.
Definition at line 53 of file RealAlgebraicNumber.cpp.
References GiNaC::ZERO_SIGN.
GiNaC::sign GiNaCRA::RealAlgebraicNumber::sgn | ( | const RationalUnivariatePolynomial & | p | ) | const [virtual] |
Returns sign (GiNaC::ZERO_SIGN, GiNaC::POSITIVE_SIGN, GiNaC::NEGATIVE_SIGN) of the specified univariate polynomial at this real algebraic number.
p | rational univariate polynomial |
Reimplemented in GiNaCRA::RealAlgebraicNumberIR, and GiNaCRA::RealAlgebraicNumberNR.
Definition at line 58 of file RealAlgebraicNumber.cpp.
References GiNaC::ZERO_SIGN.
const numeric GiNaCRA::RealAlgebraicNumber::value | ( | ) | const [inline] |
Gives an exact numeric representation of this real algebraic number which could have been found during the refinement steps.
The method returns 0 if the value was never set during refinement.
Definition at line 105 of file RealAlgebraicNumber.h.
References mValue.
Referenced by GiNaCRA::binaryOperator(), and GiNaCRA::RealAlgebraicNumberFactory::less().
bool GiNaCRA::RealAlgebraicNumber::mIsNumeric [protected] |
flag indicating whether this number is representable by a numeric
Definition at line 158 of file RealAlgebraicNumber.h.
Referenced by GiNaCRA::RealAlgebraicNumberIR::do_print(), GiNaCRA::RealAlgebraicNumberIR::is_equal_same_type(), GiNaCRA::RealAlgebraicNumberIR::isEqual(), isNumeric(), GiNaCRA::RealAlgebraicNumberIR::operator=(), GiNaCRA::RealAlgebraicNumberIR::refine(), and GiNaCRA::RealAlgebraicNumberIR::refineAvoiding().
bool GiNaCRA::RealAlgebraicNumber::mIsRoot [protected] |
flag indicating whether this number represents a root of a polynomial or an intermediate point
Definition at line 156 of file RealAlgebraicNumber.h.
Referenced by GiNaCRA::RealAlgebraicNumberNR::do_print(), GiNaCRA::RealAlgebraicNumberIR::do_print(), isRoot(), operator=(), GiNaCRA::RealAlgebraicNumberIR::operator=(), and setIsRoot().
numeric GiNaCRA::RealAlgebraicNumber::mValue [protected] |
the exact numeric value of this number if available, otherwise mIsNumeric is false and mValue 0
Definition at line 160 of file RealAlgebraicNumber.h.
Referenced by GiNaCRA::RealAlgebraicNumberIR::do_print(), GiNaCRA::RealAlgebraicNumberIR::is_equal_same_type(), GiNaCRA::RealAlgebraicNumberIR::isEqual(), GiNaCRA::RealAlgebraicNumberIR::operator=(), GiNaCRA::RealAlgebraicNumberNR::RealAlgebraicNumberNR(), GiNaCRA::RealAlgebraicNumberIR::refine(), GiNaCRA::RealAlgebraicNumberIR::refineAvoiding(), and value().