Loading...
Searching...
No Matches
GMPrat.h
Go to the documentation of this file.
// ----------------------------------------------------------------------------
// GMPrat.h
// begin of file
// originally written by Gerd Sussner, sussner@mi.uni-erlangen.de
// copied by Stephan Endrass, endrass@mathematik.uni-mainz.de
// 23.7.99
// ----------------------------------------------------------------------------
#ifndef GMPRAT_H
#define GMPRAT_H
#include "coeffs/si_gmp.h"
class Rational
{
struct rep
{
mpq_t rat;
int n;
rep() { n=1; }
};
rep *p;
void disconnect();
public:
Rational( );
Rational( int );
Rational( const Rational& );
Rational( const Rational&,const Rational& );
Rational( int,int );
~Rational( );
Rational& operator = ( int );
Rational& operator = ( char *s );
Rational& operator = ( const Rational& );
unsigned int length( ) const;
Rational get_num( );
Rational get_den( );
int get_num_si( );
int get_den_si( );
operator int( );
Rational operator - ( );
Rational operator ~ ( );
Rational& operator += ( const Rational& );
Rational& operator -= ( const Rational& );
Rational& operator *= ( const Rational& );
Rational& operator /= ( const Rational& );
Rational& operator ++ ( );
Rational operator ++ ( int );
Rational& operator -- ( );
Rational operator -- ( int );
friend Rational operator - ( const Rational& );
friend bool operator < ( const Rational&,const Rational& );
friend bool operator <= ( const Rational&,const Rational& );
friend bool operator > ( const Rational&,const Rational& );
friend bool operator >= ( const Rational&,const Rational& );
friend bool operator == ( const Rational&,const Rational& );
friend bool operator != ( const Rational&,const Rational& );
#ifdef GMPRAT_PRINT
friend ostream& operator<<( ostream&,const Rational& );
#endif
friend int sgn ( const Rational& );
friend Rational abs ( const Rational& );
friend Rational pow ( const Rational&,int );
double complexity( ) const;
friend Rational gcd ( const Rational&, const Rational& );
friend Rational lcm ( const Rational&, const Rational& );
friend Rational gcd ( Rational*, int );
friend Rational lcm ( Rational*, int );
};
Rational operator + ( const Rational&, const Rational& );
Rational operator - ( const Rational&, const Rational& );
Rational operator * ( const Rational&, const Rational& );
Rational operator / ( const Rational&, const Rational& );
#endif /* GMPRAT_H */
// ----------------------------------------------------------------------------
// GMPrat.h
// end of file
// ----------------------------------------------------------------------------
operator+
Rational operator+(const Rational &, const Rational &)
Definition GMPrat.cc:385
operator*
Rational operator*(const Rational &, const Rational &)
Definition GMPrat.cc:403
operator-
Rational operator-(const Rational &, const Rational &)
Definition GMPrat.cc:394
operator/
Rational operator/(const Rational &, const Rational &)
Definition GMPrat.cc:422
Rational
Definition GMPrat.h:15
Rational::operator*=
Rational & operator*=(const Rational &)
Definition GMPrat.cc:229
Rational::get_num_si
int get_num_si()
Definition GMPrat.cc:138
Rational::p
rep * p
Definition GMPrat.h:23
Rational::operator!=
friend bool operator!=(const Rational &, const Rational &)
Definition GMPrat.cc:318
Rational::Rational
Rational()
Definition GMPrat.cc:45
Rational::lcm
friend Rational lcm(const Rational &, const Rational &)
Definition GMPrat.cc:495
Rational::operator--
Rational & operator--()
Definition GMPrat.cc:267
Rational::operator<
friend bool operator<(const Rational &, const Rational &)
Definition GMPrat.cc:288
Rational::operator-=
Rational & operator-=(const Rational &)
Definition GMPrat.cc:221
Rational::~Rational
~Rational()
Definition GMPrat.cc:88
Rational::pow
friend Rational pow(const Rational &, int)
Definition GMPrat.cc:411
Rational::operator==
friend bool operator==(const Rational &, const Rational &)
Definition GMPrat.cc:312
Rational::operator~
Rational operator~()
Definition GMPrat.cc:200
Rational::complexity
double complexity() const
Definition GMPrat.cc:526
Rational::get_den_si
int get_den_si()
Definition GMPrat.cc:152
Rational::operator++
Rational & operator++()
Definition GMPrat.cc:249
Rational::get_num
Rational get_num()
Definition GMPrat.cc:129
Rational::sgn
friend int sgn(const Rational &)
Definition GMPrat.cc:430
Rational::abs
friend Rational abs(const Rational &)
Definition GMPrat.cc:436
Rational::operator-
Rational operator-()
Definition GMPrat.cc:179
Rational::length
unsigned int length() const
Definition GMPrat.cc:362
Rational::operator+=
Rational & operator+=(const Rational &)
Definition GMPrat.cc:213
Rational::operator>
friend bool operator>(const Rational &, const Rational &)
Definition GMPrat.cc:300
Rational::operator<=
friend bool operator<=(const Rational &, const Rational &)
Definition GMPrat.cc:294
Rational::operator=
Rational & operator=(int)
Definition GMPrat.cc:101
Rational::disconnect
void disconnect()
Definition GMPrat.cc:29
Rational::get_den
Rational get_den()
Definition GMPrat.cc:143
Rational::operator>=
friend bool operator>=(const Rational &, const Rational &)
Definition GMPrat.cc:306
Rational::operator/=
Rational & operator/=(const Rational &)
Definition GMPrat.cc:237
Rational::gcd
friend Rational gcd(const Rational &, const Rational &)
Definition GMPrat.cc:448
s
const CanonicalForm int s
Definition facAbsFact.cc:51
operator<<
ostream & operator<<(ostream &s, const spectrum &spec)
Definition semic.cc:249
si_gmp.h
Rational::rep
Definition GMPrat.h:17
Rational::rep::n
int n
Definition GMPrat.h:19
Rational::rep::rep
rep()
Definition GMPrat.h:20
Rational::rep::rat
mpq_t rat
Definition GMPrat.h:18