source: git/IntegerProgramming/BigInt.h @ 1bc154

spielwiese
Last change on this file since 1bc154 was 6ba162, checked in by Hans Schönemann <hannes@…>, 24 years ago
This commit was generated by cvs2svn to compensate for changes in r4282, which included commits to RCS files with non-trunk default branches. git-svn-id: file:///usr/local/Singular/svn/trunk@4283 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.4 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( long int );
24    BigInt( unsigned long int );
25    BigInt( int );
26    BigInt( unsigned int );
27    BigInt( short int );
28    BigInt( unsigned short int );
29    BigInt( char );
30    BigInt( unsigned char );
31    BigInt( const BigInt& );
32    ~BigInt( );
33
34    BigInt& operator = ( long int );
35    BigInt& operator = ( unsigned long int );
36    BigInt& operator = ( int );
37    BigInt& operator = ( unsigned int );
38    BigInt& operator = ( short int );
39    BigInt& operator = ( unsigned short int );
40    BigInt& operator = ( char );
41    BigInt& operator = ( unsigned char );
42    BigInt& operator = ( const BigInt& );
43
44    operator bool( );
45    operator long int( );
46    operator unsigned long int( );
47    operator int( );
48    operator unsigned int( );
49    operator short int( );
50    operator unsigned short int( );
51    operator char( );
52    operator unsigned char( );
53
54    BigInt  operator - ( );
55    BigInt& operator += ( const BigInt& );
56    BigInt& operator -= ( const BigInt& );
57    BigInt& operator *= ( const BigInt& );
58    BigInt& operator /= ( const BigInt& );
59    BigInt& operator ++ ( );
60    BigInt  operator ++ ( int );
61    BigInt& operator -- ( );
62    BigInt  operator -- ( int );
63
64    friend BigInt operator - ( const BigInt& );
65 
66    friend bool operator <  ( const BigInt&, const BigInt& );
67    friend bool operator <= ( const BigInt&, const BigInt& );
68    friend bool operator >  ( const BigInt&, const BigInt& );
69    friend bool operator >= ( const BigInt&, const BigInt& );
70    friend bool operator == ( const BigInt&, const BigInt& );
71    friend bool operator != ( const BigInt&, const BigInt& );
72    friend bool operator <  ( const long int&, const BigInt& );
73    friend bool operator <= ( const long int&, const BigInt& );
74    friend bool operator >  ( const long int&, const BigInt& );
75    friend bool operator >= ( const long int&, const BigInt& );
76    friend bool operator == ( const long int&, const BigInt& );
77    friend bool operator != ( const long int&, const BigInt& );
78    friend bool operator <  ( const BigInt&, const long int& );
79    friend bool operator <= ( const BigInt&, const long int& );
80    friend bool operator >  ( const BigInt&, const long int& );
81    friend bool operator >= ( const BigInt&, const long int& );
82    friend bool operator == ( const BigInt&, const long int& );
83    friend bool operator != ( const BigInt&, const long int& );
84 
85    friend int    sgn ( const BigInt& );
86    friend BigInt abs ( const BigInt& );
87};
88
89BigInt operator + ( const BigInt&, const BigInt& );
90BigInt operator - ( const BigInt&, const BigInt& );
91BigInt operator * ( const BigInt&, const BigInt& );
92BigInt operator / ( const BigInt&, const BigInt& );
93BigInt operator + ( const long int&, const BigInt& );
94BigInt operator - ( const long int&, const BigInt& );
95BigInt operator * ( const long int&, const BigInt& );
96BigInt operator / ( const long int&, const BigInt& );
97BigInt operator + ( const BigInt&, const long int& );
98BigInt operator - ( const BigInt&, const long int& );
99BigInt operator * ( const BigInt&, const long int& );
100BigInt operator / ( const BigInt&, const long int& );
101
102#endif  // BIG_INT_H
Note: See TracBrowser for help on using the repository browser.