source: git/IntegerProgramming/BigInt.h @ 76f3a18

spielwiese
Last change on this file since 76f3a18 was 76f3a18, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
added building binary programs from IntegerProgramming: toric_ideal, solve_IP, change_cost, gen_test and LLL ADD: IntegerProgramming is a SUBPACKAGE of the main package CHG: removing obsolette stuff (gccversion.sh) CHG: use gmp.h instead of si_gmp.h! TODO: install help files properly (only distributed for now)
  • Property mode set to 100644
File size: 2.7 KB
Line 
1// BigInt.h
2
3// A BigInt-class with not much more functions than needed by the
4// LLL-algorithm. Wrapper class for the GNU MP library.
5
6#ifndef BIG_INT_H
7#define BIG_INT_H
8
9#include <stdlib.h>
10#include <float.h>
11#include <math.h>
12#include <ctype.h>
13#include <string.h>
14#include <gmp.h>
15
16class BigInt
17{
18    mpz_t value;
19
20    public:
21
22    BigInt( );
23    BigInt( int );
24    BigInt( const BigInt& );
25    ~BigInt( );
26
27    BigInt& operator = ( int );
28    BigInt& operator = ( const BigInt& );
29
30    operator bool( );
31    operator int( );
32    operator short( );
33
34    BigInt  operator - ( );
35    BigInt& operator += ( const BigInt& );
36    BigInt& operator -= ( const BigInt& );
37    BigInt& operator *= ( const BigInt& );
38    BigInt& operator /= ( const BigInt& );
39    BigInt& operator ++ ( );
40    BigInt  operator ++ ( int );
41    BigInt& operator -- ( );
42    BigInt  operator -- ( int );
43
44    friend BigInt operator - ( const BigInt& );
45 
46    friend bool operator <  ( const BigInt&, const BigInt& );
47    friend bool operator <= ( const BigInt&, const BigInt& );
48    friend bool operator >  ( const BigInt&, const BigInt& );
49    friend bool operator >= ( const BigInt&, const BigInt& );
50    friend bool operator == ( const BigInt&, const BigInt& );
51    friend bool operator != ( const BigInt&, const BigInt& );
52    friend bool operator <  ( const int&, const BigInt& );
53    friend bool operator <= ( const int&, const BigInt& );
54    friend bool operator >  ( const int&, const BigInt& );
55    friend bool operator >= ( const int&, const BigInt& );
56    friend bool operator == ( const int&, const BigInt& );
57    friend bool operator != ( const int&, const BigInt& );
58    friend bool operator <  ( const BigInt&, const int& );
59    friend bool operator <= ( const BigInt&, const int& );
60    friend bool operator >  ( const BigInt&, const int& );
61    friend bool operator >= ( const BigInt&, const int& );
62    friend bool operator == ( const BigInt&, const int& );
63    friend bool operator != ( const BigInt&, const int& );
64 
65    friend int    sgn ( const BigInt& );
66    friend BigInt abs ( const BigInt& );
67};
68
69BigInt operator + ( const BigInt&, const BigInt& );
70BigInt operator - ( const BigInt&, const BigInt& );
71BigInt operator * ( const BigInt&, const BigInt& );
72BigInt operator / ( const BigInt&, const BigInt& );
73BigInt operator + ( const int&, const BigInt& );
74BigInt operator - ( const int&, const BigInt& );
75BigInt operator * ( const int&, const BigInt& );
76BigInt operator / ( const int&, const BigInt& );
77BigInt operator + ( const BigInt&, const int& );
78BigInt operator - ( const BigInt&, const int& );
79BigInt operator * ( const BigInt&, const int& );
80BigInt operator / ( const BigInt&, const int& );
81
82#endif  // BIG_INT_H
Note: See TracBrowser for help on using the repository browser.