ch.javasoft.smx.ops.matrix
Class BigIntegerMatrixOperations

java.lang.Object
  extended by ch.javasoft.smx.ops.matrix.BigIntegerMatrixOperations
All Implemented Interfaces:
ExtendedMatrixOperations<BigInteger,BigFraction>, MatrixOperations<BigInteger>

public class BigIntegerMatrixOperations
extends Object
implements MatrixOperations<BigInteger>, ExtendedMatrixOperations<BigInteger,BigFraction>

The BigIntegerMatrixOperations


Constructor Summary
BigIntegerMatrixOperations()
           
 
Method Summary
 ReadableMatrix<BigInteger> add(ReadableMatrix<BigInteger> mxA, BigInteger value)
           
 ReadableMatrix<BigInteger> add(ReadableMatrix<BigInteger> mxA, ReadableMatrix<BigInteger> mxB)
           
 ReadableMatrix<BigInteger> createReadableMatrix(BigInteger[][] values, boolean rowsInFirstDim)
           
 ReadableMatrix<BigInteger> createReadableMatrix(int rows, int cols)
           
 ReadableVector<BigInteger> createReadableVector(BigInteger[] values, boolean columnVector)
           
 ReadableVector<BigInteger> createReadableVector(int size, boolean columnVector)
           
 WritableMatrix<BigInteger> createWritableMatrix(BigInteger[][] values, boolean rowsInFirstDim)
           
 WritableMatrix<BigInteger> createWritableMatrix(int rows, int cols)
           
 WritableVector<BigInteger> createWritableVector(BigInteger[] values, boolean columnVector)
           
 WritableVector<BigInteger> createWritableVector(int size, boolean columnVector)
           
 NumberOperations<BigInteger> getNumberOperations()
           
static BigIntegerMatrixOperations instance()
           
 ReadableMatrix<BigFraction> invert(ReadableMatrix<BigInteger> mx)
          Returns the matrix inverse of a square matrix mx, that is, a matrix res = null(mx), such that
 ReadableMatrix<BigInteger> multiply(ReadableMatrix<BigInteger> mxA, BigInteger value)
           
 ReadableMatrix<BigInteger> multiply(ReadableMatrix<BigInteger> mxA, ReadableMatrix<BigInteger> mxB)
           
 ReadableMatrix<BigInteger> negate(ReadableMatrix<BigInteger> matrix)
           
 int nullity(ReadableMatrix<BigInteger> mx)
          Returns the nullity of the given matrix, that is, the dimension of the nullspace of mx.
 ReadableMatrix<BigFraction> nullspace(ReadableMatrix<BigInteger> mx)
          Returns a basis for the kernel (or nullspace) of mx, that is, a matrix res, such that it spans the nullspace:
 int rank(ReadableMatrix<BigInteger> mx)
          Returns the rank of the given matrix.
 ReadableMatrix<BigInteger> subtract(ReadableMatrix<BigInteger> mxA, BigInteger value)
           
 ReadableMatrix<BigInteger> subtract(ReadableMatrix<BigInteger> mxA, ReadableMatrix<BigInteger> mxB)
           
 ReadableMatrix<BigInteger> transpose(ReadableMatrix<BigInteger> matrix)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BigIntegerMatrixOperations

public BigIntegerMatrixOperations()
Method Detail

instance

public static BigIntegerMatrixOperations instance()

createReadableMatrix

public ReadableMatrix<BigInteger> createReadableMatrix(BigInteger[][] values,
                                                       boolean rowsInFirstDim)
Specified by:
createReadableMatrix in interface MatrixOperations<BigInteger>

createReadableMatrix

public ReadableMatrix<BigInteger> createReadableMatrix(int rows,
                                                       int cols)
Specified by:
createReadableMatrix in interface MatrixOperations<BigInteger>

createWritableMatrix

public WritableMatrix<BigInteger> createWritableMatrix(BigInteger[][] values,
                                                       boolean rowsInFirstDim)
Specified by:
createWritableMatrix in interface MatrixOperations<BigInteger>

createWritableMatrix

public WritableMatrix<BigInteger> createWritableMatrix(int rows,
                                                       int cols)
Specified by:
createWritableMatrix in interface MatrixOperations<BigInteger>

createReadableVector

public ReadableVector<BigInteger> createReadableVector(BigInteger[] values,
                                                       boolean columnVector)
Specified by:
createReadableVector in interface MatrixOperations<BigInteger>

createWritableVector

public WritableVector<BigInteger> createWritableVector(BigInteger[] values,
                                                       boolean columnVector)
Specified by:
createWritableVector in interface MatrixOperations<BigInteger>

createReadableVector

public ReadableVector<BigInteger> createReadableVector(int size,
                                                       boolean columnVector)
Specified by:
createReadableVector in interface MatrixOperations<BigInteger>

createWritableVector

public WritableVector<BigInteger> createWritableVector(int size,
                                                       boolean columnVector)
Specified by:
createWritableVector in interface MatrixOperations<BigInteger>

getNumberOperations

public NumberOperations<BigInteger> getNumberOperations()
Specified by:
getNumberOperations in interface MatrixOperations<BigInteger>

add

public ReadableMatrix<BigInteger> add(ReadableMatrix<BigInteger> mxA,
                                      BigInteger value)
Specified by:
add in interface MatrixOperations<BigInteger>

add

public ReadableMatrix<BigInteger> add(ReadableMatrix<BigInteger> mxA,
                                      ReadableMatrix<BigInteger> mxB)
Specified by:
add in interface MatrixOperations<BigInteger>

multiply

public ReadableMatrix<BigInteger> multiply(ReadableMatrix<BigInteger> mxA,
                                           BigInteger value)
Specified by:
multiply in interface MatrixOperations<BigInteger>

multiply

public ReadableMatrix<BigInteger> multiply(ReadableMatrix<BigInteger> mxA,
                                           ReadableMatrix<BigInteger> mxB)
Specified by:
multiply in interface MatrixOperations<BigInteger>

negate

public ReadableMatrix<BigInteger> negate(ReadableMatrix<BigInteger> matrix)
Specified by:
negate in interface MatrixOperations<BigInteger>

subtract

public ReadableMatrix<BigInteger> subtract(ReadableMatrix<BigInteger> mxA,
                                           BigInteger value)
Specified by:
subtract in interface MatrixOperations<BigInteger>

subtract

public ReadableMatrix<BigInteger> subtract(ReadableMatrix<BigInteger> mxA,
                                           ReadableMatrix<BigInteger> mxB)
Specified by:
subtract in interface MatrixOperations<BigInteger>

transpose

public ReadableMatrix<BigInteger> transpose(ReadableMatrix<BigInteger> matrix)
Specified by:
transpose in interface MatrixOperations<BigInteger>

rank

public int rank(ReadableMatrix<BigInteger> mx)
Description copied from interface: ExtendedMatrixOperations
Returns the rank of the given matrix.

Usually, Gaussian elimination is used to compute the rank

Specified by:
rank in interface ExtendedMatrixOperations<BigInteger,BigFraction>

nullity

public int nullity(ReadableMatrix<BigInteger> mx)
Description copied from interface: ExtendedMatrixOperations
Returns the nullity of the given matrix, that is, the dimension of the nullspace of mx. Note that by the rank-nullity theorem,
   rank(mx) + nullity(mx) = n
 
where n is the number of columns of mx.

Usually, Gaussian elimination is used to compute the nullity.

Specified by:
nullity in interface ExtendedMatrixOperations<BigInteger,BigFraction>

invert

public ReadableMatrix<BigFraction> invert(ReadableMatrix<BigInteger> mx)
Description copied from interface: ExtendedMatrixOperations
Returns the matrix inverse of a square matrix mx, that is, a matrix res = null(mx), such that
   mx * res = I
 
where I is the identity matrix.

Usually, Gaussian elimination is used to compute the inverse matrix.

Specified by:
invert in interface ExtendedMatrixOperations<BigInteger,BigFraction>

nullspace

public ReadableMatrix<BigFraction> nullspace(ReadableMatrix<BigInteger> mx)
Description copied from interface: ExtendedMatrixOperations
Returns a basis for the kernel (or nullspace) of mx, that is, a matrix res, such that it spans the nullspace:
   span(res) = null(mx) = { x : mx * x = 0}
 

Usually, Gaussian elimination is used to compute the kernel matrix.

Specified by:
nullspace in interface ExtendedMatrixOperations<BigInteger,BigFraction>