ch.javasoft.smx.ops.matrix
Class LongMatrixOperations

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

public class LongMatrixOperations
extends Object
implements MatrixOperations<Long>, ExtendedMatrixOperations<Long,BigFraction>

The LongMatrixOperations ... TODO javadoc-LongMatrixOperations-type


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

Constructor Detail

LongMatrixOperations

public LongMatrixOperations()
Method Detail

instance

public static LongMatrixOperations instance()

createReadableMatrix

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

createReadableMatrix

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

createWritableMatrix

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

createWritableMatrix

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

createReadableVector

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

createWritableVector

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

createReadableVector

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

createWritableVector

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

getNumberOperations

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

add

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

add

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

multiply

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

multiply

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

negate

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

subtract

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

subtract

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

transpose

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

rank

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

nullity

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

invert

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

nullspace

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