summaryrefslogtreecommitdiff
path: root/libjava/java/math/BigInteger.h
blob: a3ace698ab1c65259fc8bb65472ecbec25071752 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-

#ifndef __java_math_BigInteger__
#define __java_math_BigInteger__

#pragma interface

#include <java/lang/Number.h>
#include <gcj/array.h>

extern "Java"
{
  namespace gnu
  {
    namespace java
    {
      namespace lang
      {
          class CPStringBuilder;
      }
      namespace math
      {
          class GMP;
      }
    }
  }
  namespace java
  {
    namespace math
    {
        class BigInteger;
    }
  }
}

class java::math::BigInteger : public ::java::lang::Number
{

  BigInteger();
  BigInteger(jint);
public:
  BigInteger(::java::lang::String *, jint);
  BigInteger(::java::lang::String *);
  BigInteger(JArray< jbyte > *);
  BigInteger(jint, JArray< jbyte > *);
  BigInteger(jint, ::java::util::Random *);
private:
  void init(jint, ::java::util::Random *);
public:
  BigInteger(jint, jint, ::java::util::Random *);
  static ::java::math::BigInteger * probablePrime(jint, ::java::util::Random *);
  static ::java::math::BigInteger * valueOf(jlong);
private:
  static jboolean initializeLibrary();
  static ::java::math::BigInteger * make(JArray< jint > *, jint);
  static JArray< jint > * byteArrayToIntArray(JArray< jbyte > *, jint);
  static ::java::math::BigInteger * alloc(jint);
  void realloc(jint);
  jboolean isNegative();
public:
  virtual jint signum();
private:
  static jint compareTo(::java::math::BigInteger *, ::java::math::BigInteger *);
public:
  virtual jint BigInteger$compareTo(::java::math::BigInteger *);
  virtual ::java::math::BigInteger * min(::java::math::BigInteger *);
  virtual ::java::math::BigInteger * max(::java::math::BigInteger *);
private:
  jboolean isZero();
  jboolean isOne();
  static jint wordsNeeded(JArray< jint > *, jint);
  ::java::math::BigInteger * canonicalize();
  static ::java::math::BigInteger * add(jint, jint);
  static ::java::math::BigInteger * add(::java::math::BigInteger *, jint);
  void setAdd(::java::math::BigInteger *, jint);
  void setAdd(jint);
  void set(jlong);
  void set(JArray< jint > *, jint);
  void set(::java::math::BigInteger *);
  static ::java::math::BigInteger * add(::java::math::BigInteger *, ::java::math::BigInteger *, jint);
public:
  virtual ::java::math::BigInteger * add(::java::math::BigInteger *);
  virtual ::java::math::BigInteger * subtract(::java::math::BigInteger *);
private:
  static ::java::math::BigInteger * times(::java::math::BigInteger *, jint);
  static ::java::math::BigInteger * times(::java::math::BigInteger *, ::java::math::BigInteger *);
public:
  virtual ::java::math::BigInteger * multiply(::java::math::BigInteger *);
private:
  static void divide(jlong, jlong, ::java::math::BigInteger *, ::java::math::BigInteger *, jint);
  static void divide(::java::math::BigInteger *, ::java::math::BigInteger *, ::java::math::BigInteger *, ::java::math::BigInteger *, jint);
public:
  virtual ::java::math::BigInteger * divide(::java::math::BigInteger *);
  virtual ::java::math::BigInteger * remainder(::java::math::BigInteger *);
  virtual JArray< ::java::math::BigInteger * > * divideAndRemainder(::java::math::BigInteger *);
  virtual ::java::math::BigInteger * mod(::java::math::BigInteger *);
  virtual ::java::math::BigInteger * pow(jint);
private:
  static JArray< jint > * euclidInv(jint, jint, jint);
  static void euclidInv(::java::math::BigInteger *, ::java::math::BigInteger *, ::java::math::BigInteger *, JArray< ::java::math::BigInteger * > *);
public:
  virtual ::java::math::BigInteger * modInverse(::java::math::BigInteger *);
  virtual ::java::math::BigInteger * modPow(::java::math::BigInteger *, ::java::math::BigInteger *);
private:
  static jint gcd(jint, jint);
public:
  virtual ::java::math::BigInteger * gcd(::java::math::BigInteger *);
  virtual jboolean isProbablePrime(jint);
private:
  void setInvert();
  void setShiftLeft(::java::math::BigInteger *, jint);
  void setShiftRight(::java::math::BigInteger *, jint);
  void setShift(::java::math::BigInteger *, jint);
  static ::java::math::BigInteger * shift(::java::math::BigInteger *, jint);
public:
  virtual ::java::math::BigInteger * shiftLeft(jint);
  virtual ::java::math::BigInteger * shiftRight(jint);
private:
  void format(jint, ::gnu::java::lang::CPStringBuilder *);
public:
  virtual ::java::lang::String * toString();
  virtual ::java::lang::String * toString(jint);
  virtual jint intValue();
  virtual jlong longValue();
  virtual jint hashCode();
private:
  static jboolean equals(::java::math::BigInteger *, ::java::math::BigInteger *);
public:
  virtual jboolean equals(::java::lang::Object *);
private:
  static ::java::math::BigInteger * valueOf(JArray< jbyte > *, jint, jboolean, jint);
public:
  virtual jdouble doubleValue();
  virtual jfloat floatValue();
private:
  jboolean checkBits(jint);
  jdouble roundToDouble(jint, jboolean, jboolean);
  void getAbsolute(JArray< jint > *);
  static jboolean negate(JArray< jint > *, JArray< jint > *, jint);
  void setNegative(::java::math::BigInteger *);
  void setNegative();
  static ::java::math::BigInteger * abs(::java::math::BigInteger *);
public:
  virtual ::java::math::BigInteger * abs();
private:
  static ::java::math::BigInteger * neg(::java::math::BigInteger *);
public:
  virtual ::java::math::BigInteger * negate();
  virtual jint bitLength();
  virtual JArray< jbyte > * toByteArray();
private:
  static jint swappedOp(jint);
  static ::java::math::BigInteger * bitOp(jint, ::java::math::BigInteger *, ::java::math::BigInteger *);
  static void setBitOp(::java::math::BigInteger *, jint, ::java::math::BigInteger *, ::java::math::BigInteger *);
  static ::java::math::BigInteger * and$(::java::math::BigInteger *, jint);
public:
  virtual ::java::math::BigInteger * and$(::java::math::BigInteger *);
  virtual ::java::math::BigInteger * or$(::java::math::BigInteger *);
  virtual ::java::math::BigInteger * xor$(::java::math::BigInteger *);
  virtual ::java::math::BigInteger * not$();
  virtual ::java::math::BigInteger * andNot(::java::math::BigInteger *);
  virtual ::java::math::BigInteger * clearBit(jint);
  virtual ::java::math::BigInteger * setBit(jint);
  virtual jboolean testBit(jint);
  virtual ::java::math::BigInteger * flipBit(jint);
  virtual jint getLowestSetBit();
private:
  static jint bitCount(jint);
  static jint bitCount(JArray< jint > *, jint);
public:
  virtual jint bitCount();
private:
  void readObject(::java::io::ObjectInputStream *);
  void writeObject(::java::io::ObjectOutputStream *);
public:
  virtual jint compareTo(::java::lang::Object *);
private:
  static ::java::util::logging::Logger * log;
  jint __attribute__((aligned(__alignof__( ::java::lang::Number)))) ival;
  JArray< jint > * words;
  jint bitCount__;
  jint bitLength__;
  jint lowestSetBit;
  JArray< jbyte > * magnitude;
  jint signum__;
  static const jlong serialVersionUID = -8287574255936472291LL;
  static const jint minFixNum = -100;
  static const jint maxFixNum = 1024;
  static const jint numFixNum = 1125;
  static JArray< ::java::math::BigInteger * > * smallFixNums;
  ::gnu::java::math::GMP * mpz;
  static jboolean USING_NATIVE;
public:
  static ::java::math::BigInteger * ZERO;
  static ::java::math::BigInteger * ONE;
  static ::java::math::BigInteger * TEN;
private:
  static const jint FLOOR = 1;
  static const jint CEILING = 2;
  static const jint TRUNCATE = 3;
  static const jint ROUND = 4;
  static JArray< jint > * primes;
  static JArray< jint > * k;
  static JArray< jint > * t;
  static JArray< jbyte > * bit4_count;
public:
  static ::java::lang::Class class$;
};

#endif // __java_math_BigInteger__