public class BigIntegerMath
extends java.lang.Object
Constructor | Description |
---|---|
BigIntegerMath() |
Modifier and Type | Method | Description |
---|---|---|
static java.math.BigInteger |
binomial(int n,
int k) |
Evaluate binomial(n,k).
|
static java.math.BigInteger |
binomial(java.math.BigInteger n,
java.math.BigInteger k) |
Evaluate binomial(n,k).
|
static Rational |
centrlFactNumt(int n,
int k) |
The central factorial number t(n,k) number at the indices provided.
|
static Rational |
centrlFactNumT(int n,
int k) |
The central factorial number T(n,k) number at the indices provided.
|
static java.math.BigInteger |
core(java.math.BigInteger n) |
Evaluate core(n).
|
static java.math.BigInteger |
det(java.math.BigInteger[][] A) |
Determinant of an integer square matrix.
|
static java.util.Vector<java.math.BigInteger> |
divisors(java.math.BigInteger n) |
Compute the list of positive divisors.
|
static int |
isqrt(int n) |
Evaluate floor(sqrt(n)).
|
static long |
isqrt(long n) |
Evaluate floor(sqrt(n)).
|
static java.math.BigInteger |
isqrt(java.math.BigInteger n) |
Evaluate floor(sqrt(n)).
|
static java.math.BigInteger |
lcm(java.math.BigInteger a,
java.math.BigInteger b) |
The lowest common multiple
|
static java.math.BigInteger[][] |
minor(java.math.BigInteger[][] A,
int r,
int c) |
Minor of an integer matrix.
|
static java.math.BigInteger |
sigma(int n) |
Evaluate sigma(n).
|
static java.math.BigInteger |
sigma(java.math.BigInteger n) |
Evaluate sigma(n).
|
static java.math.BigInteger |
sigmak(java.math.BigInteger n,
int k) |
Evaluate sigma_k(n).
|
static Rational[] |
solve(java.math.BigInteger[][] A,
java.math.BigInteger[] rhs) |
Solve a linear system of equations.
|
static java.math.BigInteger |
valueOf(java.util.Vector<java.math.BigInteger> c,
java.math.BigInteger x) |
Evaluate the value of an integer polynomial at some integer argument.
|
public static java.math.BigInteger binomial(int n, int k)
n
- The upper indexk
- The lower indexpublic static java.math.BigInteger binomial(java.math.BigInteger n, java.math.BigInteger k)
n
- The upper indexk
- The lower indexpublic static java.math.BigInteger sigmak(java.math.BigInteger n, int k)
n
- the main argument which defines the divisorsk
- the lower index, which defines the powerpublic static java.math.BigInteger sigma(int n)
n
- the argument for which divisors will be searched.public static java.util.Vector<java.math.BigInteger> divisors(java.math.BigInteger n)
n
- The integer of which the divisors are to be found.public static java.math.BigInteger sigma(java.math.BigInteger n)
n
- the argument for which divisors will be searched.public static int isqrt(int n)
n
- The non-negative argument.public static long isqrt(long n)
n
- The non-negative argument.
Arguments less than zero throw an ArithmeticException.public static java.math.BigInteger isqrt(java.math.BigInteger n)
n
- The non-negative argument.
Arguments less than zero throw an ArithmeticException.public static java.math.BigInteger core(java.math.BigInteger n)
n
- The non-negative argument.public static java.math.BigInteger[][] minor(java.math.BigInteger[][] A, int r, int c) throws java.lang.ArithmeticException
A
- The matrix.r
- The row index of the row to be removed (0-based).
An exception is thrown if this is outside the range 0 to the upper row index of A.c
- The column index of the column to be removed (0-based).
An exception is thrown if this is outside the range 0 to the upper column index of A.java.lang.ArithmeticException
public static java.math.BigInteger det(java.math.BigInteger[][] A) throws java.lang.ArithmeticException
A
- The square matrix.
If column and row dimensions are unequal, an ArithmeticException is thrown.java.lang.ArithmeticException
public static Rational[] solve(java.math.BigInteger[][] A, java.math.BigInteger[] rhs) throws java.lang.ArithmeticException
A
- The square matrix.
If it is not of full rank, an ArithmeticException is thrown.rhs
- The right hand side. The length of this vector must match the matrix size;
else an ArithmeticException is thrown.java.lang.ArithmeticException
public static java.math.BigInteger lcm(java.math.BigInteger a, java.math.BigInteger b)
a
- The first argumentb
- The second argumentpublic static java.math.BigInteger valueOf(java.util.Vector<java.math.BigInteger> c, java.math.BigInteger x)
c
- Represents the coefficients c[0]+c[1]*x+c[2]*x^2+.. of the polynomialx
- The abscissa point of the evaluationpublic static Rational centrlFactNumt(int n, int k)
n
- the first parameter, non-negative.k
- the second index, non-negative.public static Rational centrlFactNumT(int n, int k)
n
- the first parameter, non-negative.k
- the second index, non-negative.