My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
kernel
spectrum
GMPrat.h
Go to the documentation of this file.
1
// ----------------------------------------------------------------------------
2
// GMPrat.h
3
// begin of file
4
// originally written by Gerd Sussner, sussner@mi.uni-erlangen.de
5
// copied by Stephan Endrass, endrass@mathematik.uni-mainz.de
6
// 23.7.99
7
// ----------------------------------------------------------------------------
8
9
#ifndef GMPRAT_H
10
#define GMPRAT_H
11
12
#include "
coeffs/si_gmp.h
"
13
14
class
Rational
15
{
16
struct
rep
17
{
18
mpq_t
rat
;
19
int
n
;
20
rep
() {
n
=1; }
21
};
22
23
rep
*
p
;
24
25
void
disconnect
();
26
27
public
:
28
29
Rational
( );
30
Rational
(
int
);
31
Rational
(
const
Rational
& );
32
Rational
(
const
Rational
&,
const
Rational
& );
33
Rational
(
int
,
int
);
34
~Rational
( );
35
36
Rational
&
operator =
(
int
);
37
Rational
&
operator =
(
char
*
s
);
38
Rational
&
operator =
(
const
Rational
& );
39
40
unsigned
int
length
( )
const
;
41
Rational
get_num
( );
42
Rational
get_den
( );
43
int
get_num_si
( );
44
int
get_den_si
( );
45
operator
int( );
46
47
Rational
operator -
( );
48
Rational
operator ~
( );
49
Rational
&
operator +=
(
const
Rational
& );
50
Rational
&
operator -=
(
const
Rational
& );
51
Rational
&
operator *=
(
const
Rational
& );
52
Rational
&
operator /=
(
const
Rational
& );
53
Rational
&
operator ++
( );
54
Rational
operator ++
(
int
);
55
Rational
&
operator --
( );
56
Rational
operator --
(
int
);
57
58
friend
Rational
operator -
(
const
Rational
& );
59
60
friend
bool
operator <
(
const
Rational
&,
const
Rational
& );
61
friend
bool
operator <=
(
const
Rational
&,
const
Rational
& );
62
friend
bool
operator >
(
const
Rational
&,
const
Rational
& );
63
friend
bool
operator >=
(
const
Rational
&,
const
Rational
& );
64
friend
bool
operator ==
(
const
Rational
&,
const
Rational
& );
65
friend
bool
operator !=
(
const
Rational
&,
const
Rational
& );
66
67
#ifdef GMPRAT_PRINT
68
friend
ostream&
operator<<
( ostream&,
const
Rational
& );
69
#endif
70
71
friend
int
sgn
(
const
Rational
& );
72
friend
Rational
abs
(
const
Rational
& );
73
friend
Rational
pow
(
const
Rational
&,
int
);
74
75
double
complexity
( )
const
;
76
77
friend
Rational
gcd
(
const
Rational
&,
const
Rational
& );
78
friend
Rational
lcm
(
const
Rational
&,
const
Rational
& );
79
friend
Rational
gcd
(
Rational
*,
int
);
80
friend
Rational
lcm
(
Rational
*,
int
);
81
};
82
83
Rational
operator +
(
const
Rational
&,
const
Rational
& );
84
Rational
operator -
(
const
Rational
&,
const
Rational
& );
85
Rational
operator *
(
const
Rational
&,
const
Rational
& );
86
Rational
operator /
(
const
Rational
&,
const
Rational
& );
87
88
#endif
/* GMPRAT_H */
89
90
// ----------------------------------------------------------------------------
91
// GMPrat.h
92
// end of file
93
// ----------------------------------------------------------------------------
94
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
Generated on
for My Project by
doxygen 1.17.0
for
Singular