GiNaCRA
0.6.4
|
A real algebraic number exactly represented as a numeric. More...
#include <RealAlgebraicNumberNR.h>
Public Member Functions | |
RealAlgebraicNumberNR (const numeric &n, bool isRoot=true) | |
Construct a real algebraic number from a numeric n . | |
RealAlgebraicNumberNR (const RealAlgebraicNumberNR &n) | |
Copy constructor. | |
RealAlgebraicNumberPtr | clone () const |
Clone-"Constructor". | |
GiNaC::sign | sgn () const |
Returns sign (GiNaC::ZERO_SIGN, GiNaC::POSITIVE_SIGN, GiNaC::NEGATIVE_SIGN) of this real algebraic number. | |
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. | |
const numeric | approximateValue () const |
Computes a numeric value for this real algebraic number approximating it. | |
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. | |
Protected Member Functions | |
void | do_print (const print_context &c, unsigned level=0) const |
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 |
A real algebraic number exactly represented as a numeric.
Definition at line 41 of file RealAlgebraicNumberNR.h.
GiNaCRA::RealAlgebraicNumberNR::RealAlgebraicNumberNR | ( | const numeric & | n, |
bool | isRoot = true |
||
) |
Construct a real algebraic number from a numeric n
.
n | |
isRoot | true marks this real algebraic number to stem from a root computation |
Definition at line 46 of file RealAlgebraicNumberNR.cpp.
References GiNaCRA::RealAlgebraicNumber::mValue.
Referenced by clone().
Copy constructor.
n |
Definition at line 53 of file RealAlgebraicNumberNR.cpp.
References GiNaCRA::RealAlgebraicNumber::mValue.
const numeric GiNaCRA::RealAlgebraicNumberNR::approximateValue | ( | ) | const [inline, virtual] |
Computes a numeric value for this real algebraic number approximating it.
Reimplemented from GiNaCRA::RealAlgebraicNumber.
Definition at line 93 of file RealAlgebraicNumberNR.h.
RealAlgebraicNumberPtr GiNaCRA::RealAlgebraicNumberNR::clone | ( | ) | const [inline, virtual] |
Clone-"Constructor".
Reimplemented from GiNaCRA::RealAlgebraicNumber.
Definition at line 67 of file RealAlgebraicNumberNR.h.
References RealAlgebraicNumberNR().
void GiNaCRA::RealAlgebraicNumberNR::do_print | ( | const print_context & | c, |
unsigned | level = 0 |
||
) | const [protected] |
Definition at line 92 of file RealAlgebraicNumberNR.cpp.
References GiNaCRA::RealAlgebraicNumber::mIsRoot.
bool GiNaCRA::RealAlgebraicNumber::isNumeric | ( | ) | const [inline, inherited] |
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 GiNaCRA::RealAlgebraicNumber::mIsNumeric.
Referenced by GiNaCRA::binaryOperator().
const bool GiNaCRA::RealAlgebraicNumber::isRoot | ( | ) | const [inline, inherited] |
Definition at line 78 of file RealAlgebraicNumber.h.
References GiNaCRA::RealAlgebraicNumber::mIsRoot.
Referenced by GiNaCRA::RealAlgebraicNumber::setIsRoot().
void GiNaCRA::RealAlgebraicNumber::setIsRoot | ( | bool | isRoot | ) | [inline, inherited] |
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.
References GiNaCRA::RealAlgebraicNumber::isRoot(), and GiNaCRA::RealAlgebraicNumber::mIsRoot.
GiNaC::sign GiNaCRA::RealAlgebraicNumberNR::sgn | ( | ) | const [virtual] |
Returns sign (GiNaC::ZERO_SIGN, GiNaC::POSITIVE_SIGN, GiNaC::NEGATIVE_SIGN) of this real algebraic number.
Reimplemented from GiNaCRA::RealAlgebraicNumber.
Definition at line 64 of file RealAlgebraicNumberNR.cpp.
References GiNaC::NEGATIVE_SIGN, GiNaC::POSITIVE_SIGN, and GiNaC::ZERO_SIGN.
GiNaC::sign GiNaCRA::RealAlgebraicNumberNR::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 from GiNaCRA::RealAlgebraicNumber.
Definition at line 74 of file RealAlgebraicNumberNR.cpp.
References GiNaC::NEGATIVE_SIGN, GiNaC::POSITIVE_SIGN, GiNaCRA::RationalUnivariatePolynomial::sgn(), and GiNaC::ZERO_SIGN.
const numeric GiNaCRA::RealAlgebraicNumber::value | ( | ) | const [inline, inherited] |
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 GiNaCRA::RealAlgebraicNumber::mValue.
Referenced by GiNaCRA::binaryOperator(), and GiNaCRA::RealAlgebraicNumberFactory::less().
bool GiNaCRA::RealAlgebraicNumber::mIsNumeric [protected, inherited] |
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(), GiNaCRA::RealAlgebraicNumber::isNumeric(), GiNaCRA::RealAlgebraicNumberIR::operator=(), GiNaCRA::RealAlgebraicNumberIR::refine(), and GiNaCRA::RealAlgebraicNumberIR::refineAvoiding().
bool GiNaCRA::RealAlgebraicNumber::mIsRoot [protected, inherited] |
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 do_print(), GiNaCRA::RealAlgebraicNumberIR::do_print(), GiNaCRA::RealAlgebraicNumber::isRoot(), GiNaCRA::RealAlgebraicNumber::operator=(), GiNaCRA::RealAlgebraicNumberIR::operator=(), and GiNaCRA::RealAlgebraicNumber::setIsRoot().
numeric GiNaCRA::RealAlgebraicNumber::mValue [protected, inherited] |
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=(), RealAlgebraicNumberNR(), GiNaCRA::RealAlgebraicNumberIR::refine(), GiNaCRA::RealAlgebraicNumberIR::refineAvoiding(), and GiNaCRA::RealAlgebraicNumber::value().