JSci.maths
Class Matrix

java.lang.Object
  extended by JSci.maths.Matrix
All Implemented Interfaces:
java.io.Serializable, Algebra.Member, Module.Member, VectorSpace.Member, Ring.Member, AbelianGroup.Member, Member
Direct Known Subclasses:
ComplexMatrix, DoubleMatrix, IntegerMatrix, RingMatrix

public abstract class Matrix
extends java.lang.Object
implements Algebra.Member

The Matrix superclass provides an abstract encapsulation for matrices.

Version:
2.1
Author:
Mark Hale
See Also:
Serialized Form

Field Summary
protected static int CLASS_SPECIFIC
          Storage format identifier.
protected  int numCols
          The number of columns.
protected  int numRows
          The number of rows.
protected  int storageFormat
           
 
Constructor Summary
Matrix(int rows, int cols)
          Constructs a matrix.
 
Method Summary
 int columns()
          Returns the number of columns.
protected static java.lang.String getInvalidElementMsg(int i, int j)
          Returns an "invalid element" error message.
 int rows()
          Returns the number of rows.
abstract  Matrix transpose()
          Returns the transpose of this matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface JSci.maths.algebras.VectorSpace.Member
scalarDivide
 
Methods inherited from interface JSci.maths.algebras.Module.Member
scalarMultiply
 
Methods inherited from interface JSci.maths.groups.AbelianGroup.Member
add, negate, subtract
 
Methods inherited from interface JSci.maths.fields.Ring.Member
multiply
 

Field Detail

CLASS_SPECIFIC

protected static final int CLASS_SPECIFIC
Storage format identifier. Strictly for internal use only.

See Also:
Constant Field Values

storageFormat

protected int storageFormat

numRows

protected final int numRows
The number of rows.


numCols

protected final int numCols
The number of columns.

Constructor Detail

Matrix

public Matrix(int rows,
              int cols)
Constructs a matrix.

Method Detail

rows

public final int rows()
Returns the number of rows.


columns

public final int columns()
Returns the number of columns.


transpose

public abstract Matrix transpose()
Returns the transpose of this matrix.


getInvalidElementMsg

protected static java.lang.String getInvalidElementMsg(int i,
                                                       int j)
Returns an "invalid element" error message.

Parameters:
i - row index of the element
j - column index of the element