edu.jas.arith
Class BigInteger

java.lang.Object
  extended by edu.jas.arith.BigInteger
All Implemented Interfaces:
Coefficient, java.io.Serializable

public class BigInteger
extends java.lang.Object
implements Coefficient, java.io.Serializable

BigInteger class to make java.math.BigInteger available with Coefficient interface and with the familiar SAC method names.

See Also:
BigInteger, Serialized Form

Field Summary
static BigInteger ONE
           
static BigInteger ZERO
           
 
Constructor Summary
BigInteger()
           
BigInteger(java.math.BigInteger a)
          Constructors for BigInteger
BigInteger(long a)
           
BigInteger(java.lang.String s)
           
 
Method Summary
 Coefficient abs()
           
 Coefficient add(Coefficient S)
           
 int compareTo(java.lang.Object b)
           
 Coefficient divide(Coefficient S)
           
 Coefficient[] divideAndRemainder(Coefficient S)
           
 boolean equals(java.lang.Object b)
           
 Coefficient fromInteger(java.math.BigInteger a)
           
 Coefficient fromInteger(long a)
           
 Coefficient gcd(Coefficient S)
           
 java.math.BigInteger getval()
           
static BigInteger IABS(BigInteger A)
           
static int ICOMP(BigInteger A, BigInteger B)
           
static BigInteger IDIF(BigInteger A, BigInteger B)
           
static BigInteger IGCD(BigInteger A, BigInteger B)
           
static BigInteger INEG(BigInteger A)
           
 Coefficient inverse()
          Integer inverse.
static BigInteger IPROD(BigInteger A, BigInteger B)
           
static BigInteger IQ(BigInteger A, BigInteger B)
           
static BigInteger[] IQR(BigInteger A, BigInteger B)
          Integer quotient and remainder.
static BigInteger IRAND(int NL)
           
static BigInteger IREM(BigInteger A, BigInteger B)
           
static int ISIGN(BigInteger A)
           
 boolean isONE()
           
static BigInteger ISUM(BigInteger A, BigInteger B)
           
 boolean isZERO()
           
static BigInteger MIHOM(BigInteger M, BigInteger A)
           
static BigInteger MIINV(BigInteger M, BigInteger A)
           
 Coefficient mod(Coefficient M)
           
 Coefficient modInverse(Coefficient M)
           
 Coefficient multiply(Coefficient S)
           
 Coefficient negate()
           
 Coefficient random(int n)
           
 Coefficient remainder(Coefficient S)
           
 int signum()
           
 Coefficient subtract(Coefficient S)
           
 java.lang.String toString()
           
static BigInteger valueOf(java.math.BigInteger a)
           
static BigInteger valueOf(long a)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final BigInteger ZERO

ONE

public static final BigInteger ONE
Constructor Detail

BigInteger

public BigInteger(java.math.BigInteger a)
Constructors for BigInteger


BigInteger

public BigInteger(long a)

BigInteger

public BigInteger(java.lang.String s)

BigInteger

public BigInteger()
Method Detail

getval

public java.math.BigInteger getval()

fromInteger

public Coefficient fromInteger(java.math.BigInteger a)
Specified by:
fromInteger in interface Coefficient

valueOf

public static BigInteger valueOf(java.math.BigInteger a)

fromInteger

public Coefficient fromInteger(long a)
Specified by:
fromInteger in interface Coefficient

valueOf

public static BigInteger valueOf(long a)

isZERO

public boolean isZERO()
Specified by:
isZERO in interface Coefficient

isONE

public boolean isONE()
Specified by:
isONE in interface Coefficient

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(java.lang.Object b)
Specified by:
compareTo in interface Coefficient

ICOMP

public static int ICOMP(BigInteger A,
                        BigInteger B)

equals

public boolean equals(java.lang.Object b)
Overrides:
equals in class java.lang.Object

abs

public Coefficient abs()
Specified by:
abs in interface Coefficient

IABS

public static BigInteger IABS(BigInteger A)

negate

public Coefficient negate()
Specified by:
negate in interface Coefficient

INEG

public static BigInteger INEG(BigInteger A)

signum

public int signum()
Specified by:
signum in interface Coefficient

ISIGN

public static int ISIGN(BigInteger A)

subtract

public Coefficient subtract(Coefficient S)
Specified by:
subtract in interface Coefficient

IDIF

public static BigInteger IDIF(BigInteger A,
                              BigInteger B)

divide

public Coefficient divide(Coefficient S)
Specified by:
divide in interface Coefficient

IQ

public static BigInteger IQ(BigInteger A,
                            BigInteger B)

inverse

public Coefficient inverse()
Integer inverse. R is a non-zero integer. S=1/R if defined else 0.

Specified by:
inverse in interface Coefficient

remainder

public Coefficient remainder(Coefficient S)

IREM

public static BigInteger IREM(BigInteger A,
                              BigInteger B)

divideAndRemainder

public Coefficient[] divideAndRemainder(Coefficient S)

IQR

public static BigInteger[] IQR(BigInteger A,
                               BigInteger B)
Integer quotient and remainder. A and B are integers, B ne 0. Q is the quotient, integral part of A/B, and R is the remainder A-B*Q.


gcd

public Coefficient gcd(Coefficient S)

IGCD

public static BigInteger IGCD(BigInteger A,
                              BigInteger B)

random

public Coefficient random(int n)
Specified by:
random in interface Coefficient

IRAND

public static BigInteger IRAND(int NL)

multiply

public Coefficient multiply(Coefficient S)
Specified by:
multiply in interface Coefficient

IPROD

public static BigInteger IPROD(BigInteger A,
                               BigInteger B)

add

public Coefficient add(Coefficient S)
Specified by:
add in interface Coefficient

ISUM

public static BigInteger ISUM(BigInteger A,
                              BigInteger B)

modInverse

public Coefficient modInverse(Coefficient M)

MIINV

public static BigInteger MIINV(BigInteger M,
                               BigInteger A)

mod

public Coefficient mod(Coefficient M)

MIHOM

public static BigInteger MIHOM(BigInteger M,
                               BigInteger A)