ch.javasoft.smx.ops.matrix
Class IntMatrixOperations

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

public class IntMatrixOperations
extends Object
implements MatrixOperations<Integer>, ExtendedMatrixOperations<Integer,BigFraction>

The IntegerMatrixOperations ... TODO javadoc-IntegerMatrixOperations-type


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

Constructor Detail

IntMatrixOperations

public IntMatrixOperations()
Method Detail

instance

public static IntMatrixOperations instance()

createReadableMatrix

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

createReadableMatrix

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

createWritableMatrix

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

createWritableMatrix

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

createReadableVector

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

createWritableVector

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

createReadableVector

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

createWritableVector

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

getNumberOperations

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

add

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

add

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

multiply

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

multiply

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

negate

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

subtract

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

subtract

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

transpose

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

rank

public int rank(ReadableMatrix<Integer> 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<Integer,BigFraction>

nullity

public int nullity(ReadableMatrix<Integer> 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<Integer,BigFraction>

invert

public ReadableMatrix<BigFraction> invert(ReadableMatrix<Integer> 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<Integer,BigFraction>

nullspace

public ReadableMatrix<BigFraction> nullspace(ReadableMatrix<Integer> 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<Integer,BigFraction>