Givaro  4.2.2
Public Member Functions | Protected Member Functions
Rational Class Reference

Rationals. No doc. More...

#include <givrational.h>

+ Collaboration diagram for Rational:

Public Member Functions

 Rational (const Integer &f, const Integer &m, const Integer &k, bool recurs=false)
 Rational number reconstruction. More...
 

Protected Member Functions

bool ratrecon (const Integer &f, const Integer &m, const Integer &k, bool forcereduce=true, bool recurs=false)
 num/den 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
 

Comparison operators.

Compare with operators.

giv_all_inlined friend int32_t operator>= (uint32_t l, const Rational &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator>= (float l, const Rational &n)
 
giv_all_inlined friend int32_t operator>= (double l, const Rational &n)
 
giv_all_inlined friend int32_t operator>= (int32_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator>= (int64_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator>= (uint64_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator<= (uint32_t l, const Rational &n)
 less or equal More...
 
giv_all_inlined friend int32_t operator<= (float l, const Rational &n)
 
giv_all_inlined friend int32_t operator<= (double l, const Rational &n)
 
giv_all_inlined friend int32_t operator<= (int32_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator<= (int64_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator<= (uint64_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator!= (uint32_t l, const Rational &n)
 operator != (not equal) More...
 
giv_all_inlined friend int32_t operator!= (float l, const Rational &n)
 
giv_all_inlined friend int32_t operator!= (double l, const Rational &n)
 
giv_all_inlined friend int32_t operator!= (int32_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator!= (int64_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator!= (uint64_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator== (uint32_t l, const Rational &n)
 Equality. More...
 
giv_all_inlined friend int32_t operator== (float l, const Rational &n)
 
giv_all_inlined friend int32_t operator== (double l, const Rational &n)
 
giv_all_inlined friend int32_t operator== (int32_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator== (int64_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator== (uint64_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator> (uint32_t l, const Rational &n)
 greater (strict) More...
 
giv_all_inlined friend int32_t operator> (float l, const Rational &n)
 
giv_all_inlined friend int32_t operator> (double l, const Rational &n)
 
giv_all_inlined friend int32_t operator> (int32_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator> (int64_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator> (uint64_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator< (uint32_t l, const Rational &n)
 less (strict) More...
 
giv_all_inlined friend int32_t operator< (float l, const Rational &n)
 
giv_all_inlined friend int32_t operator< (double l, const Rational &n)
 
giv_all_inlined friend int32_t operator< (int32_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator< (int64_t l, const Rational &n)
 
giv_all_inlined friend int32_t operator< (uint64_t l, const Rational &n)
 
giv_all_inlined int32_t operator>= (const Integer &l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator>= (const int32_t l) const
 
giv_all_inlined int32_t operator>= (const int64_t l) const
 
giv_all_inlined int32_t operator>= (const uint64_t l) const
 
giv_all_inlined int32_t operator>= (const uint32_t l) const
 
giv_all_inlined int32_t operator>= (const double l) const
 
giv_all_inlined int32_t operator>= (const float l) const
 
giv_all_inlined int32_t operator<= (const Rational &l) const
 less or equal More...
 
giv_all_inlined int32_t operator<= (const int32_t l) const
 
giv_all_inlined int32_t operator<= (const int64_t l) const
 
giv_all_inlined int32_t operator<= (const uint64_t l) const
 
giv_all_inlined int32_t operator<= (const uint32_t l) const
 
giv_all_inlined int32_t operator<= (const double l) const
 
giv_all_inlined int32_t operator<= (const float l) const
 
giv_all_inlined int32_t operator!= (const Integer &l) const
 operator != (not equal) More...
 
giv_all_inlined int32_t operator!= (const int32_t l) const
 
giv_all_inlined int32_t operator!= (const int64_t l) const
 
giv_all_inlined int32_t operator!= (const uint64_t l) const
 
giv_all_inlined int32_t operator!= (const uint32_t l) const
 
giv_all_inlined int32_t operator!= (const double l) const
 
giv_all_inlined int32_t operator!= (const float l) const
 
giv_all_inlined int32_t operator== (const Integer &l) const
 Equality. More...
 
giv_all_inlined int32_t operator== (const int32_t l) const
 
giv_all_inlined int32_t operator== (const int64_t l) const
 
giv_all_inlined int32_t operator== (const uint64_t l) const
 
giv_all_inlined int32_t operator== (const uint32_t l) const
 
giv_all_inlined int32_t operator== (const double l) const
 
giv_all_inlined int32_t operator== (const float l) const
 
giv_all_inlined int32_t operator> (const Integer &l) const
 greater (strict) More...
 
giv_all_inlined int32_t operator> (const int32_t l) const
 
giv_all_inlined int32_t operator> (const int64_t l) const
 
giv_all_inlined int32_t operator> (const uint64_t l) const
 
giv_all_inlined int32_t operator> (const uint32_t l) const
 
giv_all_inlined int32_t operator> (const double l) const
 
giv_all_inlined int32_t operator> (const float l) const
 
giv_all_inlined int32_t operator< (const Integer &l) const
 less (strict) More...
 
giv_all_inlined int32_t operator< (const int32_t l) const
 
giv_all_inlined int32_t operator< (const int64_t l) const
 
giv_all_inlined int32_t operator< (const uint64_t l) const
 
giv_all_inlined int32_t operator< (const uint32_t l) const
 
giv_all_inlined int32_t operator< (const double l) const
 
giv_all_inlined int32_t operator< (const float l) const
 

Detailed Description

Rationals. No doc.

Examples:
examples/Rational/iratrecon.C.

Constructor & Destructor Documentation

◆ Rational()

Rational ( const Integer f,
const Integer m,
const Integer k,
bool  recurs = false 
)

Rational number reconstruction.

$ num/den \equiv f \mod m$, with $|num|<k$ and $0 < |den| \leq f/kf$

Bibliography:
  • von zur Gathen & Gerhard Modern Computer Algebra, 5.10, Cambridge Univ. Press 1999]

Member Function Documentation

◆ operator>=() [1/7]

giv_all_inlined int32_t operator>= ( const Integer l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator>=() [2/7]

giv_all_inlined int32_t operator>= ( const int32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>=() [3/7]

giv_all_inlined int32_t operator>= ( const int64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>=() [4/7]

giv_all_inlined int32_t operator>= ( const uint64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>=() [5/7]

giv_all_inlined int32_t operator>= ( const uint32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>=() [6/7]

giv_all_inlined int32_t operator>= ( const double  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>=() [7/7]

giv_all_inlined int32_t operator>= ( const float  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<=() [1/7]

giv_all_inlined int32_t operator<= ( const Rational l) const

less or equal

Parameters
lrational to be compared to

◆ operator<=() [2/7]

giv_all_inlined int32_t operator<= ( const int32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<=() [3/7]

giv_all_inlined int32_t operator<= ( const int64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<=() [4/7]

giv_all_inlined int32_t operator<= ( const uint64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<=() [5/7]

giv_all_inlined int32_t operator<= ( const uint32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<=() [6/7]

giv_all_inlined int32_t operator<= ( const double  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<=() [7/7]

giv_all_inlined int32_t operator<= ( const float  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator!=() [1/7]

giv_all_inlined int32_t operator!= ( const Integer l) const

operator != (not equal)

Parameters
lrational
Returns
1 iff l == this

◆ operator!=() [2/7]

giv_all_inlined int32_t operator!= ( const int32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator!=() [3/7]

giv_all_inlined int32_t operator!= ( const int64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator!=() [4/7]

giv_all_inlined int32_t operator!= ( const uint64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator!=() [5/7]

giv_all_inlined int32_t operator!= ( const uint32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator!=() [6/7]

giv_all_inlined int32_t operator!= ( const double  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator!=() [7/7]

giv_all_inlined int32_t operator!= ( const float  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator==() [1/7]

giv_all_inlined int32_t operator== ( const Integer l) const

Equality.

Parameters
lrational to be compared to

◆ operator==() [2/7]

giv_all_inlined int32_t operator== ( const int32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator==() [3/7]

giv_all_inlined int32_t operator== ( const int64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator==() [4/7]

giv_all_inlined int32_t operator== ( const uint64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator==() [5/7]

giv_all_inlined int32_t operator== ( const uint32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator==() [6/7]

giv_all_inlined int32_t operator== ( const double  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator==() [7/7]

giv_all_inlined int32_t operator== ( const float  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>() [1/7]

giv_all_inlined int32_t operator> ( const Integer l) const

greater (strict)

Parameters
lrational to be compared to

◆ operator>() [2/7]

giv_all_inlined int32_t operator> ( const int32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>() [3/7]

giv_all_inlined int32_t operator> ( const int64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>() [4/7]

giv_all_inlined int32_t operator> ( const uint64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>() [5/7]

giv_all_inlined int32_t operator> ( const uint32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>() [6/7]

giv_all_inlined int32_t operator> ( const double  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>() [7/7]

giv_all_inlined int32_t operator> ( const float  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<() [1/7]

giv_all_inlined int32_t operator< ( const Integer l) const

less (strict)

Parameters
lrational to be compared to

◆ operator<() [2/7]

giv_all_inlined int32_t operator< ( const int32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<() [3/7]

giv_all_inlined int32_t operator< ( const int64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<() [4/7]

giv_all_inlined int32_t operator< ( const uint64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<() [5/7]

giv_all_inlined int32_t operator< ( const uint32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<() [6/7]

giv_all_inlined int32_t operator< ( const double  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<() [7/7]

giv_all_inlined int32_t operator< ( const float  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Friends And Related Function Documentation

◆ operator>= [1/6]

giv_all_inlined friend int32_t operator>= ( uint32_t  l,
const Rational n 
)
friend

greater or equal.

Parameters
l,nrationals to compare

◆ operator>= [2/6]

giv_all_inlined friend int32_t operator>= ( float  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>= [3/6]

giv_all_inlined friend int32_t operator>= ( double  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>= [4/6]

giv_all_inlined friend int32_t operator>= ( int32_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>= [5/6]

giv_all_inlined friend int32_t operator>= ( int64_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator>= [6/6]

giv_all_inlined friend int32_t operator>= ( uint64_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<= [1/6]

giv_all_inlined friend int32_t operator<= ( uint32_t  l,
const Rational n 
)
friend

less or equal

Parameters
l,nrationals to compare

◆ operator<= [2/6]

giv_all_inlined friend int32_t operator<= ( float  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<= [3/6]

giv_all_inlined friend int32_t operator<= ( double  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<= [4/6]

giv_all_inlined friend int32_t operator<= ( int32_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<= [5/6]

giv_all_inlined friend int32_t operator<= ( int64_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<= [6/6]

giv_all_inlined friend int32_t operator<= ( uint64_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator!= [1/6]

giv_all_inlined friend int32_t operator!= ( uint32_t  l,
const Rational n 
)
friend

operator != (not equal)

Parameters
l,nrational
Returns
1 iff l == n

◆ operator!= [2/6]

giv_all_inlined friend int32_t operator!= ( float  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator!= [3/6]

giv_all_inlined friend int32_t operator!= ( double  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator!= [4/6]

giv_all_inlined friend int32_t operator!= ( int32_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator!= [5/6]

giv_all_inlined friend int32_t operator!= ( int64_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator!= [6/6]

giv_all_inlined friend int32_t operator!= ( uint64_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator== [1/6]

giv_all_inlined friend int32_t operator== ( uint32_t  l,
const Rational n 
)
friend

Equality.

Parameters
l,nrationals to compare

◆ operator== [2/6]

giv_all_inlined friend int32_t operator== ( float  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator== [3/6]

giv_all_inlined friend int32_t operator== ( double  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator== [4/6]

giv_all_inlined friend int32_t operator== ( int32_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator== [5/6]

giv_all_inlined friend int32_t operator== ( int64_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator== [6/6]

giv_all_inlined friend int32_t operator== ( uint64_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator> [1/6]

giv_all_inlined friend int32_t operator> ( uint32_t  l,
const Rational n 
)
friend

greater (strict)

Parameters
l,nrationals to compare

◆ operator> [2/6]

giv_all_inlined friend int32_t operator> ( float  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator> [3/6]

giv_all_inlined friend int32_t operator> ( double  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator> [4/6]

giv_all_inlined friend int32_t operator> ( int32_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator> [5/6]

giv_all_inlined friend int32_t operator> ( int64_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator> [6/6]

giv_all_inlined friend int32_t operator> ( uint64_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator< [1/6]

giv_all_inlined friend int32_t operator< ( uint32_t  l,
const Rational n 
)
friend

less (strict)

Parameters
l,nrationals to compare

◆ operator< [2/6]

giv_all_inlined friend int32_t operator< ( float  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator< [3/6]

giv_all_inlined friend int32_t operator< ( double  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator< [4/6]

giv_all_inlined friend int32_t operator< ( int32_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator< [5/6]

giv_all_inlined friend int32_t operator< ( int64_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator< [6/6]

giv_all_inlined friend int32_t operator< ( uint64_t  l,
const Rational n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


The documentation for this class was generated from the following files: