|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jutil.math.matrix.NMatrix
This is a class of N-dimensional matrices The name Matrix has been reserved for 2D matrices since they are use more frequently than a general N-dimensional matrix. Since java has no generic classes, a matrix contains double values.
Field Summary | |
static java.lang.String |
CVS_REVISION
|
Constructor Summary | |
NMatrix()
|
Method Summary | |
abstract double |
elementAt(int[] index)
pre validIndex(index); Return the element at the given index. |
abstract int[] |
getDimensions()
post \result.length == getNbDimensions(); Return the dimensions of this matrix |
abstract int |
getNbDimensions()
public invariant getDimensions().length == getNbDimensions(); public invariant (\forall int i; i>=0 && i Return the number of dimensions of this matrix. |
abstract void |
setElementAt(int[] index,
double value)
pre validIndex(index); post elementAt(index) == value; Set the element at the given index to the given value. |
boolean |
validIndex(int[] index)
post \result == (index != null) && (index.length == getNbDimensions()) && (\forall int i; i>=0 && i Check whether or not the given index is a valid index for this matrix. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CVS_REVISION
Constructor Detail |
public NMatrix()
Method Detail |
public abstract int getNbDimensions()
public abstract int[] getDimensions()
public abstract double elementAt(int[] index)
index
- The index of the requested element.public abstract void setElementAt(int[] index, double value)
index
- The index of the element to be changed.value
- The new value for the element at index public boolean validIndex(int[] index)
index
- The index to be verified.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |