|
GiNaC
1.6.2
|
This class is a wrapper around CLN-numbers within the GiNaC class hierarchy. More...
#include <numeric.h>
Public Member Functions | |
| numeric (int i) | |
| numeric (unsigned int i) | |
| numeric (long i) | |
| numeric (unsigned long i) | |
| numeric (long numer, long denom) | |
| Constructor for rational numerics a/b. | |
| numeric (double d) | |
| numeric (const char *) | |
| ctor from C-style string. | |
| unsigned | precedence () const |
| Return relative operator precedence (for parenthezing output). | |
| bool | info (unsigned inf) const |
| Information about the object. | |
| bool | is_polynomial (const ex &var) const |
| Check whether this is a polynomial in the given variables. | |
| int | degree (const ex &s) const |
| Return degree of highest power in object s. | |
| int | ldegree (const ex &s) const |
| Return degree of lowest power in object s. | |
| ex | coeff (const ex &s, int n=1) const |
| Return coefficient of degree n in object s. | |
| bool | has (const ex &other, unsigned options=0) const |
| Disassemble real part and imaginary part to scan for the occurrence of a single number. | |
| ex | eval (int level=0) const |
| Evaluation of numbers doesn't do anything at all. | |
| ex | evalf (int level=0) const |
| Cast numeric into a floating-point object. | |
| ex | subs (const exmap &m, unsigned options=0) const |
| Substitute a set of objects by arbitrary expressions. | |
| ex | normal (exmap &repl, exmap &rev_lookup, int level=0) const |
| Implementation of ex::normal() for a numeric. | |
| ex | to_rational (exmap &repl) const |
| Implementation of ex::to_rational() for a numeric. | |
| ex | to_polynomial (exmap &repl) const |
| Implementation of ex::to_polynomial() for a numeric. | |
| numeric | integer_content () const |
| ex | smod (const numeric &xi) const |
| Apply symmetric modular homomorphism to an expanded multivariate polynomial. | |
| numeric | max_coefficient () const |
| Implementation ex::max_coefficient(). | |
| ex | conjugate () const |
| ex | real_part () const |
| ex | imag_part () const |
| void | archive (archive_node &n) const |
| Save (a.k.a. | |
| void | read_archive (const archive_node &n, lst &syms) |
| Read (a.k.a. | |
| const numeric | add (const numeric &other) const |
| Numerical addition method. | |
| const numeric | sub (const numeric &other) const |
| Numerical subtraction method. | |
| const numeric | mul (const numeric &other) const |
| Numerical multiplication method. | |
| const numeric | div (const numeric &other) const |
| Numerical division method. | |
| const numeric | power (const numeric &other) const |
| Numerical exponentiation. | |
| const numeric & | add_dyn (const numeric &other) const |
| Numerical addition method. | |
| const numeric & | sub_dyn (const numeric &other) const |
| Numerical subtraction method. | |
| const numeric & | mul_dyn (const numeric &other) const |
| Numerical multiplication method. | |
| const numeric & | div_dyn (const numeric &other) const |
| Numerical division method. | |
| const numeric & | power_dyn (const numeric &other) const |
| Numerical exponentiation. | |
| const numeric & | operator= (int i) |
| const numeric & | operator= (unsigned int i) |
| const numeric & | operator= (long i) |
| const numeric & | operator= (unsigned long i) |
| const numeric & | operator= (double d) |
| const numeric & | operator= (const char *s) |
| const numeric | inverse () const |
| Inverse of a number. | |
| numeric | step () const |
| Return the step function of a numeric. | |
| int | csgn () const |
| Return the complex half-plane (left or right) in which the number lies. | |
| int | compare (const numeric &other) const |
| This method establishes a canonical order on all numbers. | |
| bool | is_equal (const numeric &other) const |
| bool | is_zero () const |
| True if object is zero. | |
| bool | is_positive () const |
| True if object is not complex and greater than zero. | |
| bool | is_negative () const |
| True if object is not complex and less than zero. | |
| bool | is_integer () const |
| True if object is a non-complex integer. | |
| bool | is_pos_integer () const |
| True if object is an exact integer greater than zero. | |
| bool | is_nonneg_integer () const |
| True if object is an exact integer greater or equal zero. | |
| bool | is_even () const |
| True if object is an exact even integer. | |
| bool | is_odd () const |
| True if object is an exact odd integer. | |
| bool | is_prime () const |
| Probabilistic primality test. | |
| bool | is_rational () const |
| True if object is an exact rational number, may even be complex (denominator may be unity). | |
| bool | is_real () const |
| True if object is a real integer, rational or float (but not complex). | |
| bool | is_cinteger () const |
| True if object is element of the domain of integers extended by I, i.e. | |
| bool | is_crational () const |
| True if object is an exact rational number, may even be complex (denominator may be unity). | |
| bool | operator== (const numeric &other) const |
| bool | operator!= (const numeric &other) const |
| bool | operator< (const numeric &other) const |
| Numerical comparison: less. | |
| bool | operator<= (const numeric &other) const |
| Numerical comparison: less or equal. | |
| bool | operator> (const numeric &other) const |
| Numerical comparison: greater. | |
| bool | operator>= (const numeric &other) const |
| Numerical comparison: greater or equal. | |
| int | to_int () const |
| Converts numeric types to machine's int. | |
| long | to_long () const |
| Converts numeric types to machine's long. | |
| double | to_double () const |
| Converts numeric types to machine's double. | |
| cln::cl_N | to_cl_N () const |
| Returns a new CLN object of type cl_N, representing the value of *this. | |
| const numeric | real () const |
| Real part of a number. | |
| const numeric | imag () const |
| Imaginary part of a number. | |
| const numeric | numer () const |
| Numerator. | |
| const numeric | denom () const |
| Denominator. | |
| int | int_length () const |
| Size in binary notation. | |
| numeric (const cln::cl_N &z) | |
| Ctor from CLN types. | |
Protected Member Functions | |
| ex | derivative (const symbol &s) const |
| Implementation of ex::diff for a numeric always returns 0. | |
| bool | is_equal_same_type (const basic &other) const |
| Returns true if two objects of same type are equal. | |
| unsigned | calchash () const |
| Compute the hash value of an object and if it makes sense to store it in the objects status_flags, do so. | |
| void | print_numeric (const print_context &c, const char *par_open, const char *par_close, const char *imag_sym, const char *mul_sym, unsigned level) const |
| void | do_print (const print_context &c, unsigned level) const |
| Default output to stream. | |
| void | do_print_latex (const print_latex &c, unsigned level) const |
| void | do_print_csrc (const print_csrc &c, unsigned level) const |
| void | do_print_csrc_cl_N (const print_csrc_cl_N &c, unsigned level) const |
| void | do_print_tree (const print_tree &c, unsigned level) const |
| Tree output to stream. | |
| void | do_print_python_repr (const print_python_repr &c, unsigned level) const |
| Python parsable output to stream. | |
Protected Attributes | |
| cln::cl_N | value |
This class is a wrapper around CLN-numbers within the GiNaC class hierarchy.
Objects of this type may directly be created by the user.
| GiNaC::numeric::numeric | ( | int | i | ) |
Definition at line 88 of file numeric.cpp.
References GiNaC::status_flags::evaluated, GiNaC::status_flags::expanded, GiNaC::basic::setflag(), and value.
Referenced by add(), add_dyn(), conjugate(), denom(), div(), div_dyn(), evalf(), imag(), imag_part(), inverse(), mul(), mul_dyn(), numer(), operator=(), power(), power_dyn(), real(), real_part(), step(), sub(), and sub_dyn().
| GiNaC::numeric::numeric | ( | unsigned int | i | ) |
Definition at line 109 of file numeric.cpp.
References GiNaC::status_flags::evaluated, GiNaC::status_flags::expanded, GiNaC::basic::setflag(), and value.
| GiNaC::numeric::numeric | ( | long | i | ) |
Definition at line 130 of file numeric.cpp.
References GiNaC::status_flags::evaluated, GiNaC::status_flags::expanded, GiNaC::basic::setflag(), and value.
| GiNaC::numeric::numeric | ( | unsigned long | i | ) |
Definition at line 137 of file numeric.cpp.
References GiNaC::status_flags::evaluated, GiNaC::status_flags::expanded, GiNaC::basic::setflag(), and value.
| GiNaC::numeric::numeric | ( | long | numer, |
| long | denom | ||
| ) |
Constructor for rational numerics a/b.
| overflow_error | (division by zero) |
Definition at line 147 of file numeric.cpp.
References GiNaC::status_flags::evaluated, GiNaC::status_flags::expanded, GiNaC::basic::setflag(), and value.
| GiNaC::numeric::numeric | ( | double | d | ) |
Definition at line 156 of file numeric.cpp.
References GiNaC::status_flags::evaluated, GiNaC::status_flags::expanded, GiNaC::basic::setflag(), and value.
| GiNaC::numeric::numeric | ( | const char * | s | ) |
ctor from C-style string.
It also accepts complex numbers in GiNaC notation like "2+5*I".
Definition at line 168 of file numeric.cpp.
References GiNaC::Digits, GiNaC::status_flags::evaluated, GiNaC::status_flags::expanded, GiNaC::basic::setflag(), GiNaC::ToString(), and value.
| GiNaC::numeric::numeric | ( | const cln::cl_N & | z | ) | [explicit] |
Ctor from CLN types.
This is for the initiated user or internal use only.
Definition at line 247 of file numeric.cpp.
References GiNaC::status_flags::evaluated, GiNaC::status_flags::expanded, GiNaC::basic::setflag(), and value.
| unsigned GiNaC::numeric::precedence | ( | ) | const [inline, virtual] |
Return relative operator precedence (for parenthezing output).
Reimplemented from GiNaC::basic.
Definition at line 105 of file numeric.h.
Referenced by print_numeric().
| bool GiNaC::numeric::info | ( | unsigned | inf | ) | const [virtual] |
Information about the object.
Reimplemented from GiNaC::basic.
Definition at line 676 of file numeric.cpp.
References GiNaC::info_flags::algebraic, GiNaC::info_flags::cinteger, GiNaC::info_flags::cinteger_polynomial, GiNaC::info_flags::crational, GiNaC::info_flags::crational_polynomial, GiNaC::info_flags::even, GiNaC::info_flags::expanded, GiNaC::info_flags::integer, GiNaC::info_flags::integer_polynomial, is_cinteger(), is_crational(), is_even(), is_integer(), is_negative(), is_nonneg_integer(), is_odd(), is_pos_integer(), is_positive(), is_prime(), is_rational(), is_real(), GiNaC::info_flags::negative, GiNaC::info_flags::negint, GiNaC::info_flags::nonnegative, GiNaC::info_flags::nonnegint, GiNaC::info_flags::numeric, GiNaC::info_flags::odd, GiNaC::info_flags::polynomial, GiNaC::info_flags::posint, GiNaC::info_flags::positive, GiNaC::info_flags::prime, GiNaC::info_flags::rational, GiNaC::info_flags::rational_function, GiNaC::info_flags::rational_polynomial, and GiNaC::info_flags::real.
Referenced by GiNaC::mul::info(), and GiNaC::zeta1_eval().
| bool GiNaC::numeric::is_polynomial | ( | const ex & | var | ) | const [virtual] |
Check whether this is a polynomial in the given variables.
Reimplemented from GiNaC::basic.
Definition at line 722 of file numeric.cpp.
| int GiNaC::numeric::degree | ( | const ex & | s | ) | const [virtual] |
Return degree of highest power in object s.
Reimplemented from GiNaC::basic.
Definition at line 727 of file numeric.cpp.
Referenced by GiNaC::pseries::degree().
| int GiNaC::numeric::ldegree | ( | const ex & | s | ) | const [virtual] |
Return degree of lowest power in object s.
Reimplemented from GiNaC::basic.
Definition at line 732 of file numeric.cpp.
Referenced by GiNaC::pseries::ldegree().
Return coefficient of degree n in object s.
Reimplemented from GiNaC::basic.
Definition at line 737 of file numeric.cpp.
References GiNaC::_ex0.
Referenced by GiNaC::pseries::mul_const().
| bool GiNaC::numeric::has | ( | const ex & | other, |
| unsigned | options = 0 |
||
| ) | const [virtual] |
Disassemble real part and imaginary part to scan for the occurrence of a single number.
Also handles the imaginary unit. It ignores the sign on both this and the argument, which may lead to what might appear as funny results: (2+I).has(-2) -> true. But this is consistent, since we also would like to have (-2+I).has(2) -> true and we want to think about the sign as a multiplicative factor.
Reimplemented from GiNaC::basic.
Definition at line 748 of file numeric.cpp.
References GiNaC::_num0_p, GiNaC::I, imag(), is_equal(), is_real(), is_zero(), and real().
| ex GiNaC::numeric::eval | ( | int | level = 0 | ) | const [virtual] |
Evaluation of numbers doesn't do anything at all.
Reimplemented from GiNaC::basic.
Definition at line 777 of file numeric.cpp.
References GiNaC::basic::hold().
| ex GiNaC::numeric::evalf | ( | int | level = 0 | ) | const [virtual] |
Cast numeric into a floating-point object.
For example exact numeric(1) is returned as a 1.0000000000000000000000 and so on according to how Digits is currently set. In case the object already was a floating point number the precision is trimmed to match the currently set default.
| level | ignored, only needed for overriding basic::evalf. |
Reimplemented from GiNaC::basic.
Definition at line 792 of file numeric.cpp.
Substitute a set of objects by arbitrary expressions.
The ex returned will already be evaluated.
Reimplemented from GiNaC::basic.
Definition at line 114 of file numeric.h.
References options, and GiNaC::basic::subs_one_level().
Implementation of ex::normal() for a numeric.
It splits complex numbers into re+I*im and replaces I and non-rational real numbers with a temporary symbol.
Reimplemented from GiNaC::basic.
Definition at line 2085 of file normal.cpp.
References denom(), GiNaC::status_flags::dynallocated, GiNaC::I, imag(), is_integer(), is_rational(), is_real(), numer(), real(), and GiNaC::replace_with_symbol().
Implementation of ex::to_rational() for a numeric.
It splits complex numbers into re+I*im and replaces I and non-rational real numbers with a temporary symbol.
Reimplemented from GiNaC::basic.
Definition at line 2508 of file normal.cpp.
References GiNaC::I, imag(), is_rational(), is_real(), real(), and GiNaC::replace_with_symbol().
Implementation of ex::to_polynomial() for a numeric.
It splits complex numbers into re+I*im and replaces I and non-integer real numbers with a temporary symbol.
Reimplemented from GiNaC::basic.
Definition at line 2526 of file normal.cpp.
References GiNaC::I, imag(), is_integer(), is_real(), real(), and GiNaC::replace_with_symbol().
| numeric GiNaC::numeric::integer_content | ( | ) | const [virtual] |
Reimplemented from GiNaC::basic.
Definition at line 317 of file normal.cpp.
References GiNaC::abs().
Referenced by GiNaC::gcd().
Apply symmetric modular homomorphism to an expanded multivariate polynomial.
This function is usually used internally by heur_gcd().
| xi | modulus |
Reimplemented from GiNaC::basic.
Definition at line 1209 of file normal.cpp.
| numeric GiNaC::numeric::max_coefficient | ( | ) | const [virtual] |
Implementation ex::max_coefficient().
Reimplemented from GiNaC::basic.
Definition at line 1161 of file normal.cpp.
References GiNaC::abs().
| ex GiNaC::numeric::conjugate | ( | ) | const [virtual] |
Reimplemented from GiNaC::basic.
Definition at line 798 of file numeric.cpp.
References GiNaC::conjugate(), is_real(), numeric(), and value.
| ex GiNaC::numeric::real_part | ( | ) | const [virtual] |
Reimplemented from GiNaC::basic.
Definition at line 806 of file numeric.cpp.
| ex GiNaC::numeric::imag_part | ( | ) | const [virtual] |
Reimplemented from GiNaC::basic.
Definition at line 811 of file numeric.cpp.
| void GiNaC::numeric::archive | ( | archive_node & | n | ) | const [virtual] |
Save (a.k.a.
serialize) object into archive.
Reimplemented from GiNaC::basic.
Definition at line 336 of file numeric.cpp.
References GiNaC::archive_node::add_string(), value, and GiNaC::write_real_float().
| void GiNaC::numeric::read_archive | ( | const archive_node & | n, |
| lst & | syms | ||
| ) | [virtual] |
Read (a.k.a.
deserialize) object from archive.
Reimplemented from GiNaC::basic.
Definition at line 281 of file numeric.cpp.
References c, GiNaC::status_flags::evaluated, GiNaC::status_flags::expanded, GiNaC::archive_node::find_string(), GiNaC::read_real_float(), GiNaC::basic::setflag(), and value.
Implementation of ex::diff for a numeric always returns 0.
Reimplemented from GiNaC::basic.
| bool GiNaC::numeric::is_equal_same_type | ( | const basic & | other | ) | const [protected, virtual] |
Returns true if two objects of same type are equal.
Normally needs not be reimplemented as long as it wasn't overwritten by some parent class, since it just calls compare_same_type(). The reason why this function exists is that sometimes it is easier to determine equality than an order relation and then it can be overridden.
Reimplemented from GiNaC::basic.
Definition at line 827 of file numeric.cpp.
References GINAC_ASSERT, and is_equal().
| unsigned GiNaC::numeric::calchash | ( | ) | const [protected, virtual] |
Compute the hash value of an object and if it makes sense to store it in the objects status_flags, do so.
The method inherited from class basic computes a hash value based on the type and hash values of possible members. For this reason it is well suited for container classes but atomic classes should override this implementation because otherwise they would all end up with the same hashvalue.
Reimplemented from GiNaC::basic.
Definition at line 836 of file numeric.cpp.
References GiNaC::golden_ratio_hash(), GiNaC::status_flags::hash_calculated, GiNaC::basic::hashvalue, GiNaC::basic::setflag(), and value.
Numerical addition method.
Adds argument to *this and returns result as a numeric object.
Definition at line 862 of file numeric.cpp.
References numeric(), and value.
Referenced by GiNaC::operator+(), GiNaC::operator++(), GiNaC::operator+=(), and GiNaC::operator--().
Numerical subtraction method.
Subtracts argument from *this and returns result as a numeric object.
Definition at line 870 of file numeric.cpp.
References numeric(), and value.
Referenced by GiNaC::operator-(), GiNaC::operator-=(), and GiNaC::tgamma_eval().
Numerical multiplication method.
Multiplies *this and argument and returns result as a numeric object.
Definition at line 878 of file numeric.cpp.
References numeric(), and value.
Referenced by GiNaC::add::eval(), GiNaC::mul::eval(), GiNaC::power::eval(), GiNaC::power::expand_add_2(), GiNaC::lcm(), GiNaC::operator*(), GiNaC::operator*=(), GiNaC::operator-(), GiNaC::matrix::pow(), GiNaC::basic::series(), and GiNaC::tgamma_eval().
Numerical division method.
Divides *this by argument and returns result as a numeric object.
| overflow_error | (division by zero) |
Definition at line 888 of file numeric.cpp.
References numeric(), and value.
Referenced by GiNaC::power::eval(), GiNaC::operator/(), and GiNaC::operator/=().
Numerical exponentiation.
Raises *this to the power given as argument and returns result as a numeric object.
Definition at line 898 of file numeric.cpp.
References GiNaC::_num0_p, GiNaC::_num1_p, numeric(), and value.
Referenced by GiNaC::binomial(), GiNaC::power::eval(), and GiNaC::pow().
Numerical addition method.
Adds argument to *this and returns result as a numeric object on the heap. Use internally only for direct wrapping into an ex object, where the result would end up on the heap anyways.
Definition at line 923 of file numeric.cpp.
References GiNaC::_num0_p, GiNaC::status_flags::dynallocated, numeric(), GiNaC::basic::setflag(), and value.
Numerical subtraction method.
Subtracts argument from *this and returns result as a numeric object on the heap. Use internally only for direct wrapping into an ex object, where the result would end up on the heap anyways.
Definition at line 941 of file numeric.cpp.
References GiNaC::_num0_p, GiNaC::status_flags::dynallocated, numeric(), GiNaC::basic::setflag(), and value.
Numerical multiplication method.
Multiplies *this and argument and returns result as a numeric object on the heap. Use internally only for direct wrapping into an ex object, where the result would end up on the heap anyways.
Definition at line 957 of file numeric.cpp.
References GiNaC::_num1_p, GiNaC::status_flags::dynallocated, numeric(), GiNaC::basic::setflag(), and value.
Referenced by GiNaC::power::expand_add_2().
Numerical division method.
Divides *this by argument and returns result as a numeric object on the heap. Use internally only for direct wrapping into an ex object, where the result would end up on the heap anyways.
| overflow_error | (division by zero) |
Definition at line 977 of file numeric.cpp.
References GiNaC::_num1_p, GiNaC::status_flags::dynallocated, numeric(), GiNaC::basic::setflag(), and value.
Numerical exponentiation.
Raises *this to the power given as argument and returns result as a numeric object on the heap. Use internally only for direct wrapping into an ex object, where the result would end up on the heap anyways.
Definition at line 994 of file numeric.cpp.
References GiNaC::_num0_p, GiNaC::_num1_p, GiNaC::status_flags::dynallocated, numeric(), GiNaC::basic::setflag(), and value.
| const numeric & GiNaC::numeric::operator= | ( | int | i | ) |
| const numeric & GiNaC::numeric::operator= | ( | unsigned int | i | ) |
Definition at line 1023 of file numeric.cpp.
References numeric(), and operator=().
| const numeric & GiNaC::numeric::operator= | ( | long | i | ) |
Definition at line 1029 of file numeric.cpp.
References numeric(), and operator=().
| const numeric & GiNaC::numeric::operator= | ( | unsigned long | i | ) |
Definition at line 1035 of file numeric.cpp.
References numeric(), and operator=().
| const numeric & GiNaC::numeric::operator= | ( | double | d | ) |
Definition at line 1041 of file numeric.cpp.
References numeric(), and operator=().
| const numeric & GiNaC::numeric::operator= | ( | const char * | s | ) |
Definition at line 1047 of file numeric.cpp.
References numeric(), and operator=().
| const numeric GiNaC::numeric::inverse | ( | ) | const |
Inverse of a number.
Definition at line 1054 of file numeric.cpp.
References numeric(), and value.
Referenced by GiNaC::divide_in_z(), GiNaC::power::eval(), GiNaC::heur_gcd_z(), GiNaC::interpolate(), GiNaC::inverse(), GiNaC::psi1_eval(), and GiNaC::basic::series().
| numeric GiNaC::numeric::step | ( | ) | const |
Return the step function of a numeric.
The imaginary part of it is ignored because the step function is generally considered real but a numeric may develop a small imaginary part due to rounding errors.
Definition at line 1065 of file numeric.cpp.
References numeric(), r, and value.
Referenced by GiNaC::step().
| int GiNaC::numeric::csgn | ( | ) | const |
Return the complex half-plane (left or right) in which the number lies.
csgn(x)==0 for x==0, csgn(x)==1 for Re(x)>0 or Re(x)=0 and Im(x)>0, csgn(x)==-1 for Re(x)<0 or Re(x)=0 and Im(x)<0.
Definition at line 1079 of file numeric.cpp.
Referenced by GiNaC::csgn(), GiNaC::add::print_add(), and GiNaC::mul::print_overall_coeff().
| int GiNaC::numeric::compare | ( | const numeric & | other | ) | const |
This method establishes a canonical order on all numbers.
For complex numbers this is not possible in a mathematically consistent way but we need to establish some order and it ought to be fast. So we simply define it to be compatible with our method csgn.
Definition at line 1105 of file numeric.cpp.
References value.
Referenced by GiNaC::binomial(), and GiNaC::power::eval().
| bool GiNaC::numeric::is_equal | ( | const numeric & | other | ) | const |
Definition at line 1123 of file numeric.cpp.
References value.
Referenced by GiNaC::cos_eval(), GiNaC::doublefactorial(), GiNaC::power::eval(), GiNaC::exp_eval(), has(), is_equal_same_type(), GiNaC::add::print_add(), GiNaC::mul::print_overall_coeff(), GiNaC::sin_eval(), GiNaC::tan_eval(), and GiNaC::zeta1_eval().
| bool GiNaC::numeric::is_zero | ( | ) | const |
True if object is zero.
Definition at line 1130 of file numeric.cpp.
References value.
Referenced by GiNaC::asinh_conjugate(), GiNaC::atan(), GiNaC::atan_conjugate(), GiNaC::expairseq::construct_from_2_expairseq(), GiNaC::expairseq::construct_from_expairseq_ex(), GiNaC::cosh_eval(), GiNaC::csgn_eval(), GiNaC::csgn_series(), GiNaC::power::eval(), GiNaC::power::expand_mul(), GiNaC::fibonacci(), GiNaC::fsolve(), GiNaC::gcd(), has(), GiNaC::iquo(), GiNaC::irem(), GiNaC::is_zero(), GiNaC::log(), GiNaC::matrix::pivot(), GiNaC::matrix::pow(), GiNaC::pseries::power_const(), GiNaC::sinh_eval(), GiNaC::add::smod(), GiNaC::step_eval(), GiNaC::step_series(), GiNaC::tanh_eval(), and GiNaC::zeta1_eval().
| bool GiNaC::numeric::is_positive | ( | ) | const |
True if object is not complex and greater than zero.
Definition at line 1137 of file numeric.cpp.
References value.
Referenced by GiNaC::power::eval(), GiNaC::power::expand_mul(), info(), GiNaC::is_positive(), GiNaC::psi1_eval(), and GiNaC::tgamma_eval().
| bool GiNaC::numeric::is_negative | ( | ) | const |
True if object is not complex and less than zero.
Definition at line 1146 of file numeric.cpp.
References value.
Referenced by GiNaC::bernoulli(), GiNaC::beta_eval(), GiNaC::eta_eval(), GiNaC::eta_evalf(), GiNaC::power::eval(), GiNaC::fibonacci(), info(), GiNaC::is_negative(), GiNaC::pseries::power_const(), GiNaC::add::print_add(), and GiNaC::mul::print_overall_coeff().
| bool GiNaC::numeric::is_integer | ( | ) | const |
True if object is a non-complex integer.
Definition at line 1155 of file numeric.cpp.
References value.
Referenced by GiNaC::bernoulli(), GiNaC::beta_eval(), GiNaC::binomial(), GiNaC::binomial_sym(), GiNaC::mul::eval(), GiNaC::power::eval(), GiNaC::power::expand_mul(), GiNaC::fibonacci(), GiNaC::gcd(), info(), GiNaC::iquo(), GiNaC::irem(), GiNaC::is_integer(), GiNaC::isqrt(), GiNaC::lcm(), GiNaC::mod(), normal(), GiNaC::psi1_eval(), GiNaC::smod(), GiNaC::tgamma_eval(), to_int(), to_long(), to_polynomial(), and GiNaC::zeta1_eval().
| bool GiNaC::numeric::is_pos_integer | ( | ) | const |
True if object is an exact integer greater than zero.
Definition at line 1162 of file numeric.cpp.
References value.
Referenced by GiNaC::mul::eval(), GiNaC::power::eval(), info(), and GiNaC::is_pos_integer().
| bool GiNaC::numeric::is_nonneg_integer | ( | ) | const |
True if object is an exact integer greater or equal zero.
Definition at line 1169 of file numeric.cpp.
References value.
Referenced by GiNaC::binomial(), GiNaC::binomial_sym(), GiNaC::doublefactorial(), GiNaC::factorial(), info(), GiNaC::is_nonneg_integer(), and print_numeric().
| bool GiNaC::numeric::is_even | ( | ) | const |
True if object is an exact even integer.
Definition at line 1176 of file numeric.cpp.
References value.
Referenced by GiNaC::fibonacci(), info(), GiNaC::is_even(), and GiNaC::tgamma_eval().
| bool GiNaC::numeric::is_odd | ( | ) | const |
True if object is an exact odd integer.
Definition at line 1183 of file numeric.cpp.
References value.
Referenced by info(), GiNaC::is_odd(), and GiNaC::matrix::pow().
| bool GiNaC::numeric::is_prime | ( | ) | const |
Probabilistic primality test.
Definition at line 1192 of file numeric.cpp.
References value.
Referenced by info(), and GiNaC::is_prime().
| bool GiNaC::numeric::is_rational | ( | ) | const |
True if object is an exact rational number, may even be complex (denominator may be unity).
Definition at line 1202 of file numeric.cpp.
References value.
Referenced by GiNaC::power::eval(), info(), GiNaC::is_rational(), normal(), GiNaC::add::print_add(), GiNaC::mul::print_overall_coeff(), and to_rational().
| bool GiNaC::numeric::is_real | ( | ) | const |
True if object is a real integer, rational or float (but not complex).
Definition at line 1209 of file numeric.cpp.
References value.
Referenced by GiNaC::atan(), GiNaC::beta_eval(), conjugate(), GiNaC::csgn_eval(), denom(), do_print_csrc(), do_print_csrc_cl_N(), GiNaC::eta_eval(), GiNaC::eta_evalf(), GiNaC::power::eval(), GiNaC::fsolve(), has(), info(), is_cinteger(), is_crational(), GiNaC::is_real(), normal(), numer(), operator<(), operator<=(), operator>(), operator>=(), GiNaC::step_eval(), to_double(), to_polynomial(), to_rational(), and GiNaC::zeta().
| bool GiNaC::numeric::is_cinteger | ( | ) | const |
True if object is element of the domain of integers extended by I, i.e.
is of the form a+b*I, where a and b are integers.
Definition at line 1229 of file numeric.cpp.
References is_real(), and value.
Referenced by info(), and GiNaC::is_cinteger().
| bool GiNaC::numeric::is_crational | ( | ) | const |
True if object is an exact rational number, may even be complex (denominator may be unity).
Definition at line 1244 of file numeric.cpp.
References is_real(), and value.
Referenced by GiNaC::power::eval(), info(), and GiNaC::is_crational().
| bool GiNaC::numeric::operator== | ( | const numeric & | other | ) | const |
Definition at line 1215 of file numeric.cpp.
References value.
| bool GiNaC::numeric::operator!= | ( | const numeric & | other | ) | const |
Definition at line 1221 of file numeric.cpp.
References value.
| bool GiNaC::numeric::operator< | ( | const numeric & | other | ) | const |
Numerical comparison: less.
| invalid_argument | (complex inequality) |
Definition at line 1260 of file numeric.cpp.
| bool GiNaC::numeric::operator<= | ( | const numeric & | other | ) | const |
Numerical comparison: less or equal.
| invalid_argument | (complex inequality) |
Definition at line 1271 of file numeric.cpp.
| bool GiNaC::numeric::operator> | ( | const numeric & | other | ) | const |
Numerical comparison: greater.
| invalid_argument | (complex inequality) |
Definition at line 1282 of file numeric.cpp.
| bool GiNaC::numeric::operator>= | ( | const numeric & | other | ) | const |
Numerical comparison: greater or equal.
| invalid_argument | (complex inequality) |
Definition at line 1293 of file numeric.cpp.
| int GiNaC::numeric::to_int | ( | ) | const |
Converts numeric types to machine's int.
You should check with is_integer() if the number is really an integer before calling this method. You may also consider checking the range first.
Definition at line 1304 of file numeric.cpp.
References GINAC_ASSERT, is_integer(), and value.
Referenced by GiNaC::bernoulli(), GiNaC::binomial(), GiNaC::binomial_sym(), GiNaC::doublefactorial(), GiNaC::power::eval(), GiNaC::power::expand(), GiNaC::power::expand_mul(), GiNaC::factorial(), and GiNaC::to_int().
| long GiNaC::numeric::to_long | ( | ) | const |
Converts numeric types to machine's long.
You should check with is_integer() if the number is really an integer before calling this method. You may also consider checking the range first.
Definition at line 1314 of file numeric.cpp.
References GINAC_ASSERT, is_integer(), and value.
Referenced by GiNaC::to_long().
| double GiNaC::numeric::to_double | ( | ) | const |
Converts numeric types to machine's double.
You should check with is_real() if the number is really not complex before calling this method.
Definition at line 1323 of file numeric.cpp.
References GINAC_ASSERT, is_real(), and value.
Referenced by GiNaC::to_double().
| cln::cl_N GiNaC::numeric::to_cl_N | ( | ) | const |
Returns a new CLN object of type cl_N, representing the value of *this.
This method may be used when mixing GiNaC and CLN in one project.
Definition at line 1333 of file numeric.cpp.
References value.
Referenced by GiNaC::abs(), GiNaC::acos(), GiNaC::acosh(), GiNaC::asin(), GiNaC::asinh(), GiNaC::atan(), GiNaC::atanh(), GiNaC::cos(), GiNaC::cosh(), GiNaC::exp(), GiNaC::fibonacci(), GiNaC::gcd(), GiNaC::iquo(), GiNaC::irem(), GiNaC::isqrt(), GiNaC::lcm(), GiNaC::lgamma(), GiNaC::Li2(), GiNaC::log(), GiNaC::mod(), GiNaC::sin(), GiNaC::sinh(), GiNaC::smod(), GiNaC::sqrt(), GiNaC::tan(), GiNaC::tanh(), GiNaC::tgamma(), and GiNaC::zeta().
| const numeric GiNaC::numeric::real | ( | ) | const |
Real part of a number.
Definition at line 1340 of file numeric.cpp.
References numeric(), and value.
Referenced by GiNaC::atan(), GiNaC::csgn_eval(), GiNaC::power::eval(), has(), normal(), GiNaC::pseries::power_const(), GiNaC::real(), GiNaC::step_eval(), to_polynomial(), and to_rational().
| const numeric GiNaC::numeric::imag | ( | ) | const |
Imaginary part of a number.
Definition at line 1347 of file numeric.cpp.
References numeric(), and value.
Referenced by GiNaC::atan(), GiNaC::csgn_eval(), has(), GiNaC::imag(), normal(), GiNaC::step_eval(), to_polynomial(), and to_rational().
| const numeric GiNaC::numeric::numer | ( | ) | const |
Numerator.
Computes the numerator of rational numbers, rationalized numerator of complex if real and imaginary part are both rational numbers (i.e numer(4/3+5/6*I) == 8+5*I), the number carrying the sign in all other cases.
Definition at line 1357 of file numeric.cpp.
References is_real(), GiNaC::lcm(), numeric(), r, and value.
Referenced by GiNaC::power::eval(), GiNaC::frac_cancel(), normal(), and GiNaC::numer().
| const numeric GiNaC::numeric::denom | ( | ) | const |
Denominator.
Computes the denominator of rational numbers, common integer denominator of complex if real and imaginary part are both rational numbers (i.e denom(4/3+5/6*I) == 6), one in all other cases.
Definition at line 1388 of file numeric.cpp.
References GiNaC::_num1_p, is_real(), GiNaC::lcm(), numeric(), r, and value.
Referenced by GiNaC::denom(), GiNaC::power::eval(), GiNaC::frac_cancel(), and normal().
| int GiNaC::numeric::int_length | ( | ) | const |
Size in binary notation.
For integers, this is the smallest n >= 0 such that -2^n <= x < 2^n. If x > 0, this is the unique n > 0 such that 2^(n-1) <= x < 2^n.
Definition at line 1419 of file numeric.cpp.
References value.
Referenced by GiNaC::heur_gcd_z().
| void GiNaC::numeric::print_numeric | ( | const print_context & | c, |
| const char * | par_open, | ||
| const char * | par_close, | ||
| const char * | imag_sym, | ||
| const char * | mul_sym, | ||
| unsigned | level | ||
| ) | const [protected] |
Definition at line 534 of file numeric.cpp.
References is_nonneg_integer(), precedence(), GiNaC::print_real_number(), r, GiNaC::print_context::s, and value.
Referenced by do_print(), do_print_latex(), and do_print_python_repr().
| void GiNaC::numeric::do_print | ( | const print_context & | c, |
| unsigned | level | ||
| ) | const [protected] |
Default output to stream.
Reimplemented from GiNaC::basic.
Definition at line 597 of file numeric.cpp.
References print_numeric().
| void GiNaC::numeric::do_print_latex | ( | const print_latex & | c, |
| unsigned | level | ||
| ) | const [protected] |
Definition at line 602 of file numeric.cpp.
References print_numeric().
| void GiNaC::numeric::do_print_csrc | ( | const print_csrc & | c, |
| unsigned | level | ||
| ) | const [protected] |
Definition at line 607 of file numeric.cpp.
References is_real(), GiNaC::print_real_csrc(), GiNaC::print_context::s, and value.
| void GiNaC::numeric::do_print_csrc_cl_N | ( | const print_csrc_cl_N & | c, |
| unsigned | level | ||
| ) | const [protected] |
Definition at line 643 of file numeric.cpp.
References is_real(), GiNaC::print_real_cl_N(), GiNaC::print_context::s, and value.
| void GiNaC::numeric::do_print_tree | ( | const print_tree & | c, |
| unsigned | level | ||
| ) | const [protected] |
Tree output to stream.
Reimplemented from GiNaC::basic.
Definition at line 661 of file numeric.cpp.
References GiNaC::basic::flags, GiNaC::basic::hashvalue, GiNaC::print_context::s, and value.
| void GiNaC::numeric::do_print_python_repr | ( | const print_python_repr & | c, |
| unsigned | level | ||
| ) | const [protected] |
Python parsable output to stream.
Reimplemented from GiNaC::basic.
Definition at line 669 of file numeric.cpp.
References print_numeric(), and GiNaC::print_context::s.
cln::cl_N GiNaC::numeric::value [protected] |
Definition at line 204 of file numeric.h.
Referenced by add(), add_dyn(), archive(), calchash(), compare(), conjugate(), csgn(), denom(), div(), div_dyn(), do_print_csrc(), do_print_csrc_cl_N(), do_print_tree(), evalf(), imag(), imag_part(), int_length(), inverse(), is_cinteger(), is_crational(), is_equal(), is_even(), is_integer(), is_negative(), is_nonneg_integer(), is_odd(), is_pos_integer(), is_positive(), is_prime(), is_rational(), is_real(), is_zero(), mul(), mul_dyn(), numer(), numeric(), operator!=(), operator<(), operator<=(), operator==(), operator>(), operator>=(), power(), power_dyn(), print_numeric(), read_archive(), real(), real_part(), step(), sub(), sub_dyn(), to_cl_N(), to_double(), to_int(), and to_long().