|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
ObjectMatrix
A general interface for m × n matrices.
The interface specifies whether operations are
destructive--whether they alter this matrix or any of
their arguments. Consult the individual implementations for
whether a method is supported, whether it checks for errors in its
arguments, or whether null can be a return value.
Vectors are thought of as column vectors throughout. If the vector space V has dimension n and W has dimension m, then a map V → W is represented by an m × n matrix A. If x is an n-dimensional column vector giving a point of V with respect to standard coordinates, then the coordinates of its image are given by the m-dimensional column vector Ax.
| Constructor Summary | |
Matrix()
|
|
| Method Summary | |
abstract Matrix |
add(Matrix b)
The sum of two matrices. |
abstract SparseElt |
get(int i,
int j)
Returns a SparseElt whose value is the i,j value
of the matrix. |
abstract int |
getNumCols()
Returns the number n of columns. |
abstract int |
getNumRows()
Returns the number m of rows. |
abstract Matrix |
inverse()
Check the implementation for whether it's supported, and whether it's destructive. |
abstract boolean |
isIdentity()
Whether this is an n × n identity matrix. |
abstract boolean |
isProductZero(Matrix b)
Says whether this * b is zero, without storing the
product. |
abstract boolean |
isZero()
Whether every entry in this matrix is zero. |
abstract Matrix |
mult(Matrix b)
Returns this * b. |
abstract void |
set(SparseElt rowIndexAndVal,
int colIndex)
Check the implementation for whether it throws an UnsupportedOperationException. |
String |
toString()
Formats the matrix with each column left-justified. |
abstract Matrix |
transpose()
Non-destructive. |
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Matrix()
| Method Detail |
public abstract Matrix add(Matrix b)
IllegalArgumentException - If the dimensions don't
match.
public abstract SparseElt get(int i,
int j)
SparseElt whose value is the i,j value
of the matrix. May return null for a zero entry. The index of
the SparseElt is unspecified--there is no guarantee it is
either i or j.
public abstract int getNumCols()
public abstract int getNumRows()
public abstract Matrix inverse()
public abstract boolean isIdentity()
public abstract boolean isProductZero(Matrix b)
this * b is zero, without storing the
product. Is not destructive.
public abstract boolean isZero()
public abstract Matrix mult(Matrix b)
this * b. Check the implementation for
whether it's destructive.
UnsupportedOperationException - If there is no
implementation for multiplying the class of this
by the class of b.
IllegalArgumentException - The implementation may (or
may not) throw this if the inner dimensions don't match.
public abstract void set(SparseElt rowIndexAndVal,
int colIndex)
UnsupportedOperationException.
public String toString()
public abstract Matrix transpose()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||