|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.rubecula.util.Item
com.rubecula.jquantity.Compound
com.rubecula.jquantity.TwoMatrix
Class to represent a fixed size two-dimensional matrix.
Field Summary | |
private BaseNumber[][] |
_Elements
|
Fields inherited from class com.rubecula.jquantity.Compound |
|
Fields inherited from class com.rubecula.util.Item |
JQUANTITY_TEST |
Constructor Summary | |
TwoMatrix(BaseNumber[][] elements,
int rows,
int columns)
|
|
TwoMatrix(int rows,
int columns)
|
Method Summary | |
Divisible |
factored(double factor)
Method to yield the quotient of this divided by factor, and return it as the result. |
int[] |
getDimensions()
Method to get the maximumum indices for each dimension. |
BaseNumber |
getElement(int[] indices)
Method to get the value of the element specified by the indices given. |
BaseNumber |
getElement(int row,
int column)
|
Divisible |
inverse()
Method to yield the reciprocal of this and return it as the result. |
boolean |
isNormal()
Method to determine if this instance is already normalized. |
static void |
main(java.lang.String[] args)
|
void |
normalize()
MUTATING instance method to normalize this object. |
Divisible |
quotient(BaseNumber divisor)
Method to divide this by divisor and return the quotient as the result. |
void |
setElement(int[] indices,
BaseNumber element)
Method to set the value of the element specified by the indices given. |
void |
setElement(int row,
int column,
BaseNumber element)
|
Methods inherited from class com.rubecula.jquantity.Compound |
audit, getIdentifier, isMutable, makePresentableInstance, present, setConstant, setIdentifier |
Methods inherited from class com.rubecula.util.Item |
audit, audit, compareTo, Debug, getClassNameShort, getType, IsDebug, present, SetDebug, test, test, toString, Wrap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.rubecula.util.Auditable |
audit, audit |
Field Detail |
private final BaseNumber[][] _Elements
Constructor Detail |
public TwoMatrix(BaseNumber[][] elements, int rows, int columns)
elements
- public TwoMatrix(int rows, int columns)
rows
- columns
- Method Detail |
public Divisible inverse()
Divisible
public Divisible quotient(BaseNumber divisor) throws InvalidOperandException
Divisible
divisor
- the number to multiply by this.
InvalidOperandException
- operands are not compatible for the quotient
operation.
// TODO Fix it so that this method is safe (see above).public Divisible factored(double factor)
Divisible
factor
- the scale factor.
public void normalize()
Normalizable
public boolean isNormal()
Normalizable
public BaseNumber getElement(int[] indices)
CompoundModel
indices
- an array of integers giving the indices in the
0th, 1st, ... (n-1)th dimensions of the Compound, respectively.
public void setElement(int[] indices, BaseNumber element)
CompoundModel
indices
- an array of integers giving the indices in the
0th, 1st, ... (n-1)th dimensions of the Compound, respectively.public int[] getDimensions()
CompoundModel
public BaseNumber getElement(int row, int column)
public void setElement(int row, int column, BaseNumber element)
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |