PPL
1.2
|
A wrapper for numeric types implementing a given policy. More...
#include <Checked_Number_defs.hh>
Public Member Functions | |
bool | OK () const |
Checks if all the invariants are satisfied. More... | |
Result | classify (bool nan=true, bool inf=true, bool sign=true) const |
Classifies *this. More... | |
template<typename From > | |
Checked_Number< T, Policy > & | operator= (const From &y) |
Constructors | |
Checked_Number () | |
Default constructor. More... | |
Checked_Number (const Checked_Number &y) | |
Copy constructor. More... | |
template<typename From , typename From_Policy > | |
Checked_Number (const Checked_Number< From, From_Policy > &y, Rounding_Dir dir) | |
Direct initialization from a Checked_Number and rounding mode. More... | |
Checked_Number (char y, Rounding_Dir dir) | |
Direct initialization from a plain char and rounding mode. More... | |
Checked_Number (signed char y, Rounding_Dir dir) | |
Direct initialization from a signed char and rounding mode. More... | |
Checked_Number (signed short y, Rounding_Dir dir) | |
Direct initialization from a signed short and rounding mode. More... | |
Checked_Number (signed int y, Rounding_Dir dir) | |
Direct initialization from a signed int and rounding mode. More... | |
Checked_Number (signed long y, Rounding_Dir dir) | |
Direct initialization from a signed long and rounding mode. More... | |
Checked_Number (signed long long y, Rounding_Dir dir) | |
Direct initialization from a signed long long and rounding mode. More... | |
Checked_Number (unsigned char y, Rounding_Dir dir) | |
Direct initialization from an unsigned char and rounding mode. More... | |
Checked_Number (unsigned short y, Rounding_Dir dir) | |
Direct initialization from an unsigned short and rounding mode. More... | |
Checked_Number (unsigned int y, Rounding_Dir dir) | |
Direct initialization from an unsigned int and rounding mode. More... | |
Checked_Number (unsigned long y, Rounding_Dir dir) | |
Direct initialization from an unsigned long and rounding mode. More... | |
Checked_Number (unsigned long long y, Rounding_Dir dir) | |
Direct initialization from an unsigned long long and rounding mode. More... | |
Checked_Number (const mpq_class &y, Rounding_Dir dir) | |
Direct initialization from a rational and rounding mode. More... | |
Checked_Number (const mpz_class &y, Rounding_Dir dir) | |
Direct initialization from an unbounded integer and rounding mode. More... | |
Checked_Number (const char *y, Rounding_Dir dir) | |
Direct initialization from a C string and rounding mode. More... | |
template<typename From > | |
Checked_Number (const From &, Rounding_Dir dir, typename Enable_If< Is_Special< From >::value, bool >::type ignored=false) | |
Direct initialization from special and rounding mode. More... | |
template<typename From , typename From_Policy > | |
Checked_Number (const Checked_Number< From, From_Policy > &y) | |
Direct initialization from a Checked_Number, default rounding mode. More... | |
Checked_Number (char y) | |
Direct initialization from a plain char, default rounding mode. More... | |
Checked_Number (signed char y) | |
Direct initialization from a signed char, default rounding mode. More... | |
Checked_Number (signed short y) | |
Direct initialization from a signed short, default rounding mode. More... | |
Checked_Number (signed int y) | |
Direct initialization from a signed int, default rounding mode. More... | |
Checked_Number (signed long y) | |
Direct initialization from a signed long, default rounding mode. More... | |
Checked_Number (signed long long y) | |
Direct initialization from a signed long long, default rounding mode. More... | |
Checked_Number (unsigned char y) | |
Direct initialization from an unsigned char, default rounding mode. More... | |
Checked_Number (unsigned short y) | |
Direct initialization from an unsigned short, default rounding mode. More... | |
Checked_Number (unsigned int y) | |
Direct initialization from an unsigned int, default rounding mode. More... | |
Checked_Number (unsigned long y) | |
Direct initialization from an unsigned long, default rounding mode. More... | |
Checked_Number (unsigned long long y) | |
Direct initialization from an unsigned long long, default rounding mode. More... | |
Checked_Number (float y) | |
Direct initialization from a float, default rounding mode. More... | |
Checked_Number (double y) | |
Direct initialization from a double, default rounding mode. More... | |
Checked_Number (long double y) | |
Direct initialization from a long double, default rounding mode. More... | |
Checked_Number (const mpq_class &y) | |
Direct initialization from a rational, default rounding mode. More... | |
Checked_Number (const mpz_class &y) | |
Direct initialization from an unbounded integer, default rounding mode. More... | |
Checked_Number (const char *y) | |
Direct initialization from a C string, default rounding mode. More... | |
template<typename From > | |
Checked_Number (const From &, typename Enable_If< Is_Special< From >::value, bool >::type ignored=false) | |
Direct initialization from special, default rounding mode. More... | |
Accessors and Conversions | |
operator T () const | |
Conversion operator: returns a copy of the underlying numeric value. More... | |
T & | raw_value () |
Returns a reference to the underlying numeric value. More... | |
const T & | raw_value () const |
Returns a const reference to the underlying numeric value. More... | |
Assignment Operators | |
Checked_Number & | operator= (const Checked_Number &y) |
Assignment operator. More... | |
template<typename From > | |
Checked_Number & | operator= (const From &y) |
Assignment operator. More... | |
template<typename From_Policy > | |
Checked_Number & | operator+= (const Checked_Number< T, From_Policy > &y) |
Add and assign operator. More... | |
Checked_Number & | operator+= (const T &y) |
Add and assign operator. More... | |
template<typename From > | |
Enable_If< Is_Native_Or_Checked< From >::value, Checked_Number< T, Policy > & >::type | operator+= (const From &y) |
Add and assign operator. More... | |
template<typename From_Policy > | |
Checked_Number & | operator-= (const Checked_Number< T, From_Policy > &y) |
Subtract and assign operator. More... | |
Checked_Number & | operator-= (const T &y) |
Subtract and assign operator. More... | |
template<typename From > | |
Enable_If< Is_Native_Or_Checked< From >::value, Checked_Number< T, Policy > & >::type | operator-= (const From &y) |
Subtract and assign operator. More... | |
template<typename From_Policy > | |
Checked_Number & | operator*= (const Checked_Number< T, From_Policy > &y) |
Multiply and assign operator. More... | |
Checked_Number & | operator*= (const T &y) |
Multiply and assign operator. More... | |
template<typename From > | |
Enable_If< Is_Native_Or_Checked< From >::value, Checked_Number< T, Policy > & >::type | operator*= (const From &y) |
Multiply and assign operator. More... | |
template<typename From_Policy > | |
Checked_Number & | operator/= (const Checked_Number< T, From_Policy > &y) |
Divide and assign operator. More... | |
Checked_Number & | operator/= (const T &y) |
Divide and assign operator. More... | |
template<typename From > | |
Enable_If< Is_Native_Or_Checked< From >::value, Checked_Number< T, Policy > & >::type | operator/= (const From &y) |
Divide and assign operator. More... | |
template<typename From_Policy > | |
Checked_Number & | operator%= (const Checked_Number< T, From_Policy > &y) |
Compute remainder and assign operator. More... | |
Checked_Number & | operator%= (const T &y) |
Compute remainder and assign operator. More... | |
template<typename From > | |
Enable_If< Is_Native_Or_Checked< From >::value, Checked_Number< T, Policy > & >::type | operator%= (const From &y) |
Compute remainder and assign operator. More... | |
Increment and Decrement Operators | |
Checked_Number & | operator++ () |
Pre-increment operator. More... | |
Checked_Number | operator++ (int) |
Post-increment operator. More... | |
Checked_Number & | operator-- () |
Pre-decrement operator. More... | |
Checked_Number | operator-- (int) |
Post-decrement operator. More... | |
Private Attributes | |
T | v |
The underlying numeric value. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T > | |
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type | is_not_a_number (const T &x) |
template<typename T > | |
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type | is_minus_infinity (const T &x) |
template<typename T > | |
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type | is_plus_infinity (const T &x) |
template<typename T > | |
Enable_If< Is_Native_Or_Checked< T >::value, int >::type | infinity_sign (const T &x) |
template<typename T > | |
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type | is_integer (const T &x) |
template<typename To , typename From > | |
Enable_If< Is_Native_Or_Checked< To >::value &&Is_Special< From >::value, Result >::type | construct (To &to, const From &x, Rounding_Dir dir) |
template<typename To , typename From > | |
Enable_If< Is_Native_Or_Checked< To >::value &&Is_Special< From >::value, Result >::type | assign_r (To &to, const From &x, Rounding_Dir dir) |
template<typename To > | |
Enable_If< Is_Native_Or_Checked< To >::value, Result >::type | assign_r (To &to, const char *x, Rounding_Dir dir) |
template<typename To , typename To_Policy > | |
Enable_If< Is_Native_Or_Checked< To >::value, Result >::type | assign_r (To &to, char *x, Rounding_Dir dir) |
template<typename T , typename Policy > | |
void | swap (Checked_Number< T, Policy > &x, Checked_Number< T, Policy > &y) |
Swaps x with y . More... | |
template<typename T , typename Policy > | |
const T & | raw_value (const Checked_Number< T, Policy > &x) |
template<typename T , typename Policy > | |
T & | raw_value (Checked_Number< T, Policy > &x) |
template<typename T , typename Policy > | |
memory_size_type | total_memory_in_bytes (const Checked_Number< T, Policy > &x) |
template<typename T , typename Policy > | |
memory_size_type | external_memory_in_bytes (const Checked_Number< T, Policy > &x) |
template<typename To > | |
Enable_If< Is_Native_Or_Checked< To >::value, Result >::type | assign_r (To &to, const char *x, Rounding_Dir dir) |
template<typename T , typename Policy > | |
Checked_Number< T, Policy > | operator+ (const Checked_Number< T, Policy > &x) |
template<typename T , typename Policy > | |
Checked_Number< T, Policy > | operator- (const Checked_Number< T, Policy > &x) |
template<typename From > | |
Enable_If< Is_Native_Or_Checked< From >::value, int >::type | sgn (const From &x) |
template<typename From1 , typename From2 > | |
Enable_If< Is_Native_Or_Checked< From1 >::value &&Is_Native_Or_Checked< From2 >::value, int >::type | cmp (const From1 &x, const From2 &y) |
template<typename T > | |
Enable_If< Is_Native_Or_Checked< T >::value, Result >::type | output (std::ostream &os, const T &x, const Numeric_Format &format, Rounding_Dir dir) |
template<typename T , typename Policy > | |
std::ostream & | operator<< (std::ostream &os, const Checked_Number< T, Policy > &x) |
template<typename T > | |
Enable_If< Is_Native_Or_Checked< T >::value, Result >::type | input (T &x, std::istream &is, Rounding_Dir dir) |
template<typename T , typename Policy > | |
std::istream & | operator>> (std::istream &is, Checked_Number< T, Policy > &x) |
template<typename T , typename Policy > | |
void | swap (Checked_Number< T, Policy > &x, Checked_Number< T, Policy > &y) |
Memory Size Inspection Functions | |
template<typename T , typename Policy > | |
memory_size_type | total_memory_in_bytes (const Checked_Number< T, Policy > &x) |
Returns the total size in bytes of the memory occupied by x . More... | |
template<typename T , typename Policy > | |
memory_size_type | external_memory_in_bytes (const Checked_Number< T, Policy > &x) |
Returns the size in bytes of the memory managed by x . More... | |
Arithmetic Operators | |
template<typename T , typename Policy > | |
Checked_Number< T, Policy > | operator+ (const Checked_Number< T, Policy > &x) |
Unary plus operator. More... | |
template<typename T , typename Policy > | |
Checked_Number< T, Policy > | operator- (const Checked_Number< T, Policy > &x) |
Unary minus operator. More... | |
template<typename T , typename Policy > | |
void | floor_assign (Checked_Number< T, Policy > &x) |
Assigns to x largest integral value not greater than x . More... | |
template<typename T , typename Policy > | |
void | floor_assign (Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y) |
Assigns to x largest integral value not greater than y . More... | |
template<typename T , typename Policy > | |
void | ceil_assign (Checked_Number< T, Policy > &x) |
Assigns to x smallest integral value not less than x . More... | |
template<typename T , typename Policy > | |
void | ceil_assign (Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y) |
Assigns to x smallest integral value not less than y . More... | |
template<typename T , typename Policy > | |
void | trunc_assign (Checked_Number< T, Policy > &x) |
Round x to the nearest integer not larger in absolute value. More... | |
template<typename T , typename Policy > | |
void | trunc_assign (Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y) |
Assigns to x the value of y rounded to the nearest integer not larger in absolute value. More... | |
template<typename T , typename Policy > | |
void | neg_assign (Checked_Number< T, Policy > &x) |
Assigns to x its negation. More... | |
template<typename T , typename Policy > | |
void | neg_assign (Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y) |
Assigns to x the negation of y . More... | |
template<typename T , typename Policy > | |
void | abs_assign (Checked_Number< T, Policy > &x) |
Assigns to x its absolute value. More... | |
template<typename T , typename Policy > | |
void | abs_assign (Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y) |
Assigns to x the absolute value of y . More... | |
template<typename T , typename Policy > | |
void | add_mul_assign (Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y, const Checked_Number< T, Policy > &z) |
Assigns to x the value x + y * z . More... | |
template<typename T , typename Policy > | |
void | sub_mul_assign (Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y, const Checked_Number< T, Policy > &z) |
Assigns to x the value x - y * z . More... | |
template<typename T , typename Policy > | |
void | gcd_assign (Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y, const Checked_Number< T, Policy > &z) |
Assigns to x the greatest common divisor of y and z . More... | |
template<typename T , typename Policy > | |
void | gcdext_assign (Checked_Number< T, Policy > &x, Checked_Number< T, Policy > &s, Checked_Number< T, Policy > &t, const Checked_Number< T, Policy > &y, const Checked_Number< T, Policy > &z) |
Assigns to x the greatest common divisor of y and z , setting s and t such that s*y + t*z = x = gcd(y, z). More... | |
template<typename T , typename Policy > | |
void | lcm_assign (Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y, const Checked_Number< T, Policy > &z) |
Assigns to x the least common multiple of y and z . More... | |
template<typename T , typename Policy > | |
void | mul_2exp_assign (Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y, unsigned int exp) |
Assigns to x the value ![]() | |
template<typename T , typename Policy > | |
void | div_2exp_assign (Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y, unsigned int exp) |
Assigns to x the value ![]() | |
template<typename T , typename Policy > | |
void | exact_div_assign (Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y, const Checked_Number< T, Policy > &z) |
If z divides y , assigns to x the quotient of the integer division of y and z . More... | |
template<typename T , typename Policy > | |
void | sqrt_assign (Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y) |
Assigns to x the integer square root of y . More... | |
Relational Operators and Comparison Functions | |
template<typename T1 , typename T2 > | |
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value &&(Is_Checked< T1 >::value||Is_Checked< T2 >::value), bool >::type | operator== (const T1 &x, const T2 &y) |
Equality operator. More... | |
template<typename T1 , typename T2 > | |
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value, bool >::type | equal (const T1 &x, const T2 &y) |
template<typename T1 , typename T2 > | |
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value &&(Is_Checked< T1 >::value||Is_Checked< T2 >::value), bool >::type | operator!= (const T1 &x, const T2 &y) |
Disequality operator. More... | |
template<typename T1 , typename T2 > | |
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value, bool >::type | not_equal (const T1 &x, const T2 &y) |
template<typename T1 , typename T2 > | |
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value &&(Is_Checked< T1 >::value||Is_Checked< T2 >::value), bool >::type | operator>= (const T1 &x, const T2 &y) |
Greater than or equal to operator. More... | |
template<typename T1 , typename T2 > | |
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value, bool >::type | greater_or_equal (const T1 &x, const T2 &y) |
template<typename T1 , typename T2 > | |
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value &&(Is_Checked< T1 >::value||Is_Checked< T2 >::value), bool >::type | operator> (const T1 &x, const T2 &y) |
Greater than operator. More... | |
template<typename T1 , typename T2 > | |
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value, bool >::type | greater_than (const T1 &x, const T2 &y) |
template<typename T1 , typename T2 > | |
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value &&(Is_Checked< T1 >::value||Is_Checked< T2 >::value), bool >::type | operator<= (const T1 &x, const T2 &y) |
Less than or equal to operator. More... | |
template<typename T1 , typename T2 > | |
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value, bool >::type | less_or_equal (const T1 &x, const T2 &y) |
template<typename T1 , typename T2 > | |
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value &&(Is_Checked< T1 >::value||Is_Checked< T2 >::value), bool >::type | operator< (const T1 &x, const T2 &y) |
Less than operator. More... | |
template<typename T1 , typename T2 > | |
Enable_If< Is_Native_Or_Checked< T1 >::value &&Is_Native_Or_Checked< T2 >::value, bool >::type | less_than (const T1 &x, const T2 &y) |
template<typename From > | |
Enable_If< Is_Native_Or_Checked< From >::value, int >::type | sgn (const From &x) |
Returns ![]() ![]() ![]() x is negative, zero or positive, respectively. More... | |
template<typename From1 , typename From2 > | |
Enable_If< Is_Native_Or_Checked< From1 >::value &&Is_Native_Or_Checked< From2 >::value, int >::type | cmp (const From1 &x, const From2 &y) |
Returns a negative, zero or positive value depending on whether x is lower than, equal to or greater than y , respectively. More... | |
Input-Output Operators | |
template<typename T > | |
Enable_If< Is_Native_Or_Checked< T >::value, Result >::type | output (std::ostream &os, const T &x, const Numeric_Format &format, Rounding_Dir dir) |
template<typename T , typename Policy > | |
std::ostream & | operator<< (std::ostream &os, const Checked_Number< T, Policy > &x) |
Output operator. More... | |
template<typename T > | |
Enable_If< Is_Native_Or_Checked< T >::value, void >::type | ascii_dump (std::ostream &s, const T &t) |
Ascii dump for native or checked. More... | |
template<typename T > | |
Enable_If< Is_Native_Or_Checked< T >::value, Result >::type | input (T &x, std::istream &is, Rounding_Dir dir) |
Input function. More... | |
template<typename T , typename Policy > | |
std::istream & | operator>> (std::istream &is, Checked_Number< T, Policy > &x) |
Input operator. More... | |
template<typename T > | |
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type | ascii_load (std::ostream &s, T &t) |
Ascii load for native or checked. More... | |
A wrapper for numeric types implementing a given policy.
The wrapper and related functions implement an interface which is common to all kinds of coefficient types, therefore allowing for a uniform coding style. This class also implements the policy encoded by the second template parameter. The default policy is to perform the detection of overflow errors.
Definition at line 170 of file Checked_Number_defs.hh.
|
inline |
Default constructor.
Definition at line 73 of file Checked_Number_inlines.hh.
|
inline |
Copy constructor.
Definition at line 79 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::Checked_Number< T, Policy >::raw_value().
|
inline |
Direct initialization from a Checked_Number and rounding mode.
Definition at line 88 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::check_result(), Parma_Polyhedra_Library::Checked_Number< T, Policy >::raw_value(), and Parma_Polyhedra_Library::rounding_dir().
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | char | y, |
Rounding_Dir | dir | ||
) |
Direct initialization from a plain char and rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | signed char | y, |
Rounding_Dir | dir | ||
) |
Direct initialization from a signed char and rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | signed short | y, |
Rounding_Dir | dir | ||
) |
Direct initialization from a signed short and rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | signed int | y, |
Rounding_Dir | dir | ||
) |
Direct initialization from a signed int and rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | signed long | y, |
Rounding_Dir | dir | ||
) |
Direct initialization from a signed long and rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | signed long long | y, |
Rounding_Dir | dir | ||
) |
Direct initialization from a signed long long and rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | unsigned char | y, |
Rounding_Dir | dir | ||
) |
Direct initialization from an unsigned char and rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | unsigned short | y, |
Rounding_Dir | dir | ||
) |
Direct initialization from an unsigned short and rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | unsigned int | y, |
Rounding_Dir | dir | ||
) |
Direct initialization from an unsigned int and rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | unsigned long | y, |
Rounding_Dir | dir | ||
) |
Direct initialization from an unsigned long and rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | unsigned long long | y, |
Rounding_Dir | dir | ||
) |
Direct initialization from an unsigned long long and rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | const mpq_class & | y, |
Rounding_Dir | dir | ||
) |
Direct initialization from a rational and rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | const mpz_class & | y, |
Rounding_Dir | dir | ||
) |
Direct initialization from an unbounded integer and rounding mode.
|
inline |
Direct initialization from a C string and rounding mode.
Definition at line 161 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::check_result(), and Parma_Polyhedra_Library::rounding_dir().
|
inline |
Direct initialization from special and rounding mode.
Definition at line 184 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::check_result(), and Parma_Polyhedra_Library::rounding_dir().
|
inlineexplicit |
Direct initialization from a Checked_Number, default rounding mode.
Definition at line 103 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::check_result(), Parma_Polyhedra_Library::Checked_Number< T, Policy >::raw_value(), and Parma_Polyhedra_Library::rounding_dir().
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | char | y | ) |
Direct initialization from a plain char, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | signed char | y | ) |
Direct initialization from a signed char, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | signed short | y | ) |
Direct initialization from a signed short, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | signed int | y | ) |
Direct initialization from a signed int, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | signed long | y | ) |
Direct initialization from a signed long, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | signed long long | y | ) |
Direct initialization from a signed long long, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | unsigned char | y | ) |
Direct initialization from an unsigned char, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | unsigned short | y | ) |
Direct initialization from an unsigned short, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | unsigned int | y | ) |
Direct initialization from an unsigned int, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | unsigned long | y | ) |
Direct initialization from an unsigned long, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | unsigned long long | y | ) |
Direct initialization from an unsigned long long, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | float | y | ) |
Direct initialization from a float, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | double | y | ) |
Direct initialization from a double, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | long double | y | ) |
Direct initialization from a long double, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | const mpq_class & | y | ) |
Direct initialization from a rational, default rounding mode.
Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number | ( | const mpz_class & | y | ) |
Direct initialization from an unbounded integer, default rounding mode.
|
inline |
Direct initialization from a C string, default rounding mode.
Definition at line 171 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::check_result(), and Parma_Polyhedra_Library::rounding_dir().
|
inline |
Direct initialization from special, default rounding mode.
Definition at line 196 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::check_result(), and Parma_Polyhedra_Library::rounding_dir().
|
inline |
Classifies *this.
Returns the appropriate Result characterizing:
*this
is NaN, if nan
is true
;*this
is a (positive or negative) infinity, if inf
is true
;*this
, if sign
is true
. Definition at line 301 of file Checked_Number_inlines.hh.
|
inline |
Checks if all the invariants are satisfied.
Definition at line 295 of file Checked_Number_inlines.hh.
|
inline |
Conversion operator: returns a copy of the underlying numeric value.
Definition at line 261 of file Checked_Number_inlines.hh.
Checked_Number& Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator%= | ( | const Checked_Number< T, From_Policy > & | y | ) |
Compute remainder and assign operator.
Checked_Number& Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator%= | ( | const T & | y | ) |
Compute remainder and assign operator.
Enable_If<Is_Native_Or_Checked<From>::value, Checked_Number<T, Policy>& >::type Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator%= | ( | const From & | y | ) |
Compute remainder and assign operator.
Checked_Number& Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator*= | ( | const Checked_Number< T, From_Policy > & | y | ) |
Multiply and assign operator.
Checked_Number& Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator*= | ( | const T & | y | ) |
Multiply and assign operator.
Enable_If<Is_Native_Or_Checked<From>::value, Checked_Number<T, Policy>&>::type Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator*= | ( | const From & | y | ) |
Multiply and assign operator.
Checked_Number& Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator++ | ( | ) |
Pre-increment operator.
Checked_Number Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator++ | ( | int | ) |
Post-increment operator.
Checked_Number& Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator+= | ( | const Checked_Number< T, From_Policy > & | y | ) |
Add and assign operator.
Checked_Number& Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator+= | ( | const T & | y | ) |
Add and assign operator.
Enable_If<Is_Native_Or_Checked<From>::value, Checked_Number<T, Policy>&>::type Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator+= | ( | const From & | y | ) |
Add and assign operator.
Checked_Number& Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator-- | ( | ) |
Pre-decrement operator.
Checked_Number Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator-- | ( | int | ) |
Post-decrement operator.
Checked_Number& Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator-= | ( | const Checked_Number< T, From_Policy > & | y | ) |
Subtract and assign operator.
Checked_Number& Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator-= | ( | const T & | y | ) |
Subtract and assign operator.
Enable_If<Is_Native_Or_Checked<From>::value, Checked_Number<T, Policy>&>::type Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator-= | ( | const From & | y | ) |
Subtract and assign operator.
Checked_Number& Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator/= | ( | const Checked_Number< T, From_Policy > & | y | ) |
Divide and assign operator.
Checked_Number& Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator/= | ( | const T & | y | ) |
Divide and assign operator.
Enable_If<Is_Native_Or_Checked<From>::value, Checked_Number<T, Policy>&>::type Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator/= | ( | const From & | y | ) |
Divide and assign operator.
|
inline |
Assignment operator.
Definition at line 492 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::Checked_Number< T, Policy >::raw_value().
Checked_Number& Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator= | ( | const From & | y | ) |
Assignment operator.
|
inline |
Definition at line 499 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::assign_r().
|
inline |
Returns a reference to the underlying numeric value.
Definition at line 269 of file Checked_Number_inlines.hh.
Referenced by Parma_Polyhedra_Library::Checked_Number< T, Policy >::Checked_Number(), Parma_Polyhedra_Library::BD_Shape< T >::export_interval_constraints(), Parma_Polyhedra_Library::Checked_Number< T, Policy >::external_memory_in_bytes(), std::numeric_limits< Checked_Number< mpz_class, Policy > >::infinity(), std::numeric_limits< Checked_Number< mpq_class, Policy > >::infinity(), Parma_Polyhedra_Library::is_minus_infinity(), Parma_Polyhedra_Library::is_not_a_number(), Parma_Polyhedra_Library::is_plus_infinity(), Parma_Polyhedra_Library::Checked_Number< T, Policy >::operator=(), std::numeric_limits< Checked_Number< mpz_class, Policy > >::quiet_NaN(), std::numeric_limits< Checked_Number< mpq_class, Policy > >::quiet_NaN(), Parma_Polyhedra_Library::Native_Checked_From_Wrapper< Checked_Number< T, P > >::raw_value(), Parma_Polyhedra_Library::Native_Checked_To_Wrapper< Checked_Number< T, P > >::raw_value(), Parma_Polyhedra_Library::Checked_Number< T, Policy >::raw_value(), Parma_Polyhedra_Library::Checked_Number< T, Policy >::swap(), and Parma_Polyhedra_Library::Checked_Number< T, Policy >::total_memory_in_bytes().
|
inline |
Returns a const reference to the underlying numeric value.
Definition at line 275 of file Checked_Number_inlines.hh.
|
related |
Assigns to x
its absolute value.
|
related |
Assigns to x
the absolute value of y
.
|
related |
Assigns to x
the value x + y * z
.
|
related |
Ascii dump for native or checked.
Definition at line 35 of file Checked_Number_templates.hh.
Referenced by Parma_Polyhedra_Library::Grid::Status::OK().
|
related |
Ascii load for native or checked.
|
related |
Definition at line 341 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::check_result(), and Parma_Polyhedra_Library::rounding_dir().
|
related |
Definition at line 207 of file Checked_Number_inlines.hh.
|
related |
|
related |
|
related |
Assigns to x
smallest integral value not less than x
.
|
related |
Assigns to x
smallest integral value not less than y
.
|
related |
Definition at line 743 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::raw_value(), Parma_Polyhedra_Library::VR_EQ, Parma_Polyhedra_Library::VR_GT, and Parma_Polyhedra_Library::VR_LT.
|
related |
Returns a negative, zero or positive value depending on whether x
is lower than, equal to or greater than y
, respectively.
|
related |
Definition at line 217 of file Checked_Number_inlines.hh.
|
related |
Assigns to x
the value .
|
related |
|
related |
If z
divides y
, assigns to x
the quotient of the integer division of y
and z
.
The behavior is undefined if z
does not divide y
.
Definition at line 713 of file Checked_Number_inlines.hh.
|
related |
Definition at line 333 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::external_memory_in_bytes(), and Parma_Polyhedra_Library::Checked_Number< T, Policy >::raw_value().
|
related |
Returns the size in bytes of the memory managed by x
.
|
related |
Assigns to x
largest integral value not greater than x
.
|
related |
Assigns to x
largest integral value not greater than y
.
|
related |
Assigns to x
the greatest common divisor of y
and z
.
|
related |
Assigns to x
the greatest common divisor of y
and z
, setting s
and t
such that s*y + t*z = x = gcd(y, z).
|
related |
|
related |
|
related |
Definition at line 241 of file Checked_Number_inlines.hh.
|
related |
Definition at line 785 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::check_result(), Parma_Polyhedra_Library::Checked::input_ext(), and Parma_Polyhedra_Library::rounding_dir().
|
related |
Input function.
is | Input stream to read from; |
x | Number (possibly extended) to assign to in case of successful reading; |
dir | Rounding mode to be applied. |
This function attempts reading a (possibly extended) number from the given stream is
, possibly rounding as specified by dir
, assigning the result to x
upon success, and returning the appropriate Result.
The input syntax allows the specification of:
34976098
, -77
and +13
;15e2
and 15*^2
(both meaning 9200e-2
and -18*^+11111111111111111
;15/3
and 15/-3
;15/30e-1
(meaning 15*^-3/29e2
(meaning 71.3
(meaning -0.123456
(meaning 2.2e-1
(meaning -2.20001*^+3
(meaning 2^^11
(meaning 36^^z
(meaning 36^^xyz
(meaning 2^^11.1
(meaning 10^^2e3
(meaning 8^^2e3
(meaning 8^^2.1e3
(meaning 8^^20402543.120347e7
(meaning 8^^2.1
(meaning e
is interpreted as a digit, so that 16^^1e2
(meaning 16^^1*^2
(meaning 0x
is interpreted as the Mathematica-style prefix 16^^
;p
can only be used when base 16 has been specified; if used, the exponent will be applied to base 2 (instead of base 16, as is the case when the indicator e
is used);inf
and +inf
(meaning -inf
(meaning nan
(meaning "not a number").The rationale behind the accepted syntax can be summarized as follows:
Valid syntax is more formally and completely specified by the following grammar, with the additional provisos that everything is case insensitive, that the syntactic category BDIGIT
is further restricted by the current base and that for all bases above 14, any e
is always interpreted as a digit and never as a delimiter for the exponent part (if such a delimiter is desired, it has to be written as *^
).
|
related |
Definition at line 254 of file Checked_Number_inlines.hh.
|
related |
Definition at line 227 of file Checked_Number_inlines.hh.
|
related |
Definition at line 247 of file Checked_Number_inlines.hh.
|
related |
Definition at line 234 of file Checked_Number_inlines.hh.
|
related |
Assigns to x
the least common multiple of y
and z
.
|
related |
|
related |
|
related |
Assigns to x
the value .
|
related |
Assigns to x
its negation.
|
related |
Assigns to x
the negation of y
.
|
related |
|
related |
Disequality operator.
Definition at line 185 of file Interval_inlines.hh.
|
related |
Unary plus operator.
|
related |
Definition at line 620 of file Checked_Number_inlines.hh.
|
related |
Unary minus operator.
|
related |
Definition at line 627 of file Checked_Number_inlines.hh.
|
related |
Less than operator.
|
related |
Definition at line 777 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::ROUND_IGNORE.
|
related |
Output operator.
|
related |
Less than or equal to operator.
|
related |
Equality operator.
Definition at line 164 of file Interval_inlines.hh.
|
related |
Greater than operator.
|
related |
Greater than or equal to operator.
|
related |
Definition at line 795 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::V_CVT_STR_UNK.
|
related |
Input operator.
|
related |
Definition at line 764 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::check_result(), Parma_Polyhedra_Library::Checked::output_ext(), and Parma_Polyhedra_Library::rounding_dir().
|
related |
|
related |
Definition at line 282 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::Checked_Number< T, Policy >::raw_value().
|
related |
Definition at line 289 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::Checked_Number< T, Policy >::raw_value().
|
related |
Definition at line 722 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::raw_value(), Parma_Polyhedra_Library::VR_EQ, Parma_Polyhedra_Library::VR_GT, and Parma_Polyhedra_Library::VR_LT.
|
related |
Returns ,
or
depending on whether the value of
x
is negative, zero or positive, respectively.
Referenced by Parma_Polyhedra_Library::Octagonal_Shape< T >::extract_octagonal_difference().
|
related |
Assigns to x
the integer square root of y
.
|
related |
Assigns to x
the value x - y * z
.
|
related |
Definition at line 828 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::Checked_Number< T, Policy >::raw_value(), and Parma_Polyhedra_Library::swap().
|
related |
Swaps x
with y
.
|
related |
Definition at line 326 of file Checked_Number_inlines.hh.
References Parma_Polyhedra_Library::Checked_Number< T, Policy >::raw_value(), and Parma_Polyhedra_Library::total_memory_in_bytes().
|
related |
Returns the total size in bytes of the memory occupied by x
.
|
related |
Round x
to the nearest integer not larger in absolute value.
|
related |
Assigns to x
the value of y
rounded to the nearest integer not larger in absolute value.
|
private |
The underlying numeric value.
Definition at line 437 of file Checked_Number_defs.hh.