|
Givaro 4.2.1
|
Rationals. No doc. More...
#include <givrational.h>
Public Types | |
| enum | ReduceFlag { Reduce = 0x1 , NoReduce = 0x0 } |
Public Member Functions | |
| Rational (Neutral n=Neutral::zero) | |
| Rational (int32_t n) | |
| Rational (uint32_t n) | |
| Rational (int64_t n) | |
| Rational (uint64_t n) | |
| Rational (int64_t n, int64_t d) | |
| Rational (uint64_t n, uint64_t d) | |
| Rational (int32_t n, int32_t d) | |
| Rational (uint32_t n, uint32_t d) | |
| Rational (double x) | |
| Rational (const char *s) | |
| Rational (const Integer &n) | |
| Rational (const Integer &n, const Integer &d, int red=1) | |
| Rational (const Integer &f, const Integer &m, const Integer &k, bool recurs=false) | |
| Rational number reconstruction. | |
| Rational (const Rational &) | |
| Rational & | operator= (const Rational &) |
| Rational & | logcpy (const Rational &) |
| Rational & | copy (const Rational &) |
| Rational | operator+ (const Rational &r) const |
| Rational | operator- (const Rational &r) const |
| Rational | operator- () const |
| Rational | operator+ () const |
| Rational | operator* (const Rational &r) const |
| Rational | operator/ (const Rational &r) const |
| Rational & | operator+= (const Rational &r) |
| Rational & | operator-= (const Rational &r) |
| Rational & | operator*= (const Rational &r) |
| Rational & | operator/= (const Rational &r) |
| Integer | operator% (const Integer &r) const |
| const Integer | nume () const |
| const Integer | deno () const |
| std::ostream & | print (std::ostream &o) const |
| Rational | reduce (const Rational &R) const |
| operator short () const | |
| operator uint16_t () const | |
| operator uint8_t () const | |
| operator uint32_t () const | |
| operator int () const | |
| operator signed char () const | |
| operator uint64_t () const | |
| operator int64_t () const | |
| operator std::string () const | |
| operator float () const | |
| operator double () const | |
| Rational (givNoInit) | |
Static Public Member Functions | |
| static void | SetReduce () |
| static void | SetNoReduce () |
| static bool | ratrecon (Integer &num, Integer &den, const Integer &f, const Integer &m, const Integer &k, bool forcereduce=true, bool recurs=true) |
| static bool | RationalReconstruction (Integer &num, Integer &den, const Integer &f, const Integer &m) |
| static bool | RationalReconstruction (Integer &num, Integer &den, const Integer &f, const Integer &m, const Integer &numbound, bool forcereduce=true, bool recursive=true) |
| static bool | RationalReconstruction (Integer &num, Integer &den, const Integer &f, const Integer &m, const Integer &numbound, const Integer &denbound) |
Static Public Attributes | |
| static const Rational | zero |
| static const Rational | one |
| static const Rational | mOne |
| static GivModule | Module |
Protected Member Functions | |
| Rational & | reduce () |
| bool | ratrecon (const Integer &f, const Integer &m, const Integer &k, bool forcereduce=true, bool recurs=false) |
| num/den \equiv f modulo m, with a bound k on num forcereduce : must return a reduced fraction num/den recurs : tries to augment the given bound k if failure | |
Static Protected Member Functions | |
| static void | Init (int *argc, char ***argv) |
| static void | End () |
Protected Attributes | |
| Integer | num |
| Integer | den |
Static Protected Attributes | |
| static ReduceFlag | flags = Rational::Reduce |
Friends | |
| class | GivModule |
| class | QField< Rational > |
| int | compare (const Rational &a, const Rational &b) |
| int | absCompare (const Rational &a, const Rational &b) |
| const Rational | pow (const Rational &r, const int64_t l) |
| const Integer | floor (const Rational &r) |
| const Integer | ceil (const Rational &r) |
| const Integer | round (const Rational &r) |
| const Integer | trunc (const Rational &r) |
| const Rational | abs (const Rational &r) |
| const Rational | pow (const Rational &n, uint32_t l) |
| const Rational | pow (const Rational &n, uint64_t l) |
| uint64_t | length (const Rational &r) |
| int | sign (const Rational &r) |
| int | isZero (const Rational &r) |
| int | isOne (const Rational &r) |
| int | isMOne (const Rational &r) |
| int | isInteger (const Rational &r) |
Comparison operators. | |
Compare with operators. | |
| giv_all_inlined friend int32_t | operator>= (uint32_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator>= (float l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator>= (double l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator>= (int32_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator>= (int64_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator>= (uint64_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator<= (uint32_t l, const Rational &n) |
| less or equal | |
| giv_all_inlined friend int32_t | operator<= (float l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator<= (double l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator<= (int32_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator<= (int64_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator<= (uint64_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator!= (uint32_t l, const Rational &n) |
| operator != (not equal) | |
| giv_all_inlined friend int32_t | operator!= (float l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator!= (double l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator!= (int32_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator!= (int64_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator!= (uint64_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator== (uint32_t l, const Rational &n) |
| Equality. | |
| giv_all_inlined friend int32_t | operator== (float l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator== (double l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator== (int32_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator== (int64_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator== (uint64_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator> (uint32_t l, const Rational &n) |
| greater (strict) | |
| giv_all_inlined friend int32_t | operator> (float l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator> (double l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator> (int32_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator> (int64_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator> (uint64_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator< (uint32_t l, const Rational &n) |
| less (strict) | |
| giv_all_inlined friend int32_t | operator< (float l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator< (double l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator< (int32_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator< (int64_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined friend int32_t | operator< (uint64_t l, const Rational &n) |
| greater or equal. | |
| giv_all_inlined int32_t | operator>= (const Integer &l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator>= (const int32_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator>= (const int64_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator>= (const uint64_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator>= (const uint32_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator>= (const double l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator>= (const float l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator<= (const Rational &l) const |
| less or equal | |
| giv_all_inlined int32_t | operator<= (const int32_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator<= (const int64_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator<= (const uint64_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator<= (const uint32_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator<= (const double l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator<= (const float l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator!= (const Integer &l) const |
| operator != (not equal) | |
| giv_all_inlined int32_t | operator!= (const int32_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator!= (const int64_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator!= (const uint64_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator!= (const uint32_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator!= (const double l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator!= (const float l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator== (const Integer &l) const |
| Equality. | |
| giv_all_inlined int32_t | operator== (const int32_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator== (const int64_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator== (const uint64_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator== (const uint32_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator== (const double l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator== (const float l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator> (const Integer &l) const |
| greater (strict) | |
| giv_all_inlined int32_t | operator> (const int32_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator> (const int64_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator> (const uint64_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator> (const uint32_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator> (const double l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator> (const float l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator< (const Integer &l) const |
| less (strict) | |
| giv_all_inlined int32_t | operator< (const int32_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator< (const int64_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator< (const uint64_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator< (const uint32_t l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator< (const double l) const |
| greater or equal. | |
| giv_all_inlined int32_t | operator< (const float l) const |
| greater or equal. | |
Rationals. No doc.
| enum ReduceFlag |
| Rational | ( | Neutral | n = Neutral::zero | ) |
| Rational | ( | int32_t | n | ) |
| Rational | ( | uint32_t | n | ) |
| Rational | ( | int64_t | n | ) |
| Rational | ( | uint64_t | n | ) |
| Rational | ( | int64_t | n, |
| int64_t | d ) |
| Rational | ( | uint64_t | n, |
| uint64_t | d ) |
| Rational | ( | int32_t | n, |
| int32_t | d ) |
| Rational | ( | uint32_t | n, |
| uint32_t | d ) |
| Rational | ( | double | x | ) |
| Rational | ( | const char * | s | ) |
Rational number reconstruction.
\( num/den \equiv f \mod m\), with \(|num|<k\) and \(0 < |den| \leq f/kf\)
| Rational operator- | ( | ) | const |
|
inline |
| giv_all_inlined int32_t operator>= | ( | const Integer & | l | ) | const |
greater or equal.
| l | integer to be compared to |
| giv_all_inlined int32_t operator>= | ( | const int32_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator>= | ( | const int64_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator>= | ( | const uint64_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator>= | ( | const uint32_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator>= | ( | const double | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator>= | ( | const float | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator<= | ( | const Rational & | l | ) | const |
less or equal
| l | rational to be compared to |
| giv_all_inlined int32_t operator<= | ( | const int32_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator<= | ( | const int64_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator<= | ( | const uint64_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator<= | ( | const uint32_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator<= | ( | const double | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator<= | ( | const float | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator!= | ( | const Integer & | l | ) | const |
operator != (not equal)
| l | rational |
1 iff l == this | giv_all_inlined int32_t operator!= | ( | const int32_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator!= | ( | const int64_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator!= | ( | const uint64_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator!= | ( | const uint32_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator!= | ( | const double | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator!= | ( | const float | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator== | ( | const Integer & | l | ) | const |
Equality.
| l | rational to be compared to |
| giv_all_inlined int32_t operator== | ( | const int32_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator== | ( | const int64_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator== | ( | const uint64_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator== | ( | const uint32_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator== | ( | const double | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator== | ( | const float | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator> | ( | const Integer & | l | ) | const |
greater (strict)
| l | rational to be compared to |
| giv_all_inlined int32_t operator> | ( | const int32_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator> | ( | const int64_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator> | ( | const uint64_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator> | ( | const uint32_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator> | ( | const double | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator> | ( | const float | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator< | ( | const Integer & | l | ) | const |
less (strict)
| l | rational to be compared to |
| giv_all_inlined int32_t operator< | ( | const int32_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator< | ( | const int64_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator< | ( | const uint64_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator< | ( | const uint32_t | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator< | ( | const double | l | ) | const |
greater or equal.
| l,n | rationals to compare |
| giv_all_inlined int32_t operator< | ( | const float | l | ) | const |
greater or equal.
| l,n | rationals to compare |
|
inline |
|
inline |
| std::ostream & print | ( | std::ostream & | o | ) | const |
|
static |
|
static |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
num/den \equiv f modulo m, with a bound k on num forcereduce : must return a reduced fraction num/den recurs : tries to augment the given bound k if failure
|
static |
|
static |
|
static |
|
static |
|
friend |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
less or equal
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
operator != (not equal)
| l,n | rational |
1 iff l == n
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
Equality.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater (strict)
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
less (strict)
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
greater or equal.
| l,n | rationals to compare |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
static |
|
static |
|
static |
|
protected |
|
protected |
|
staticprotected |
|
static |