|
|||||||||||
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.OneMatrix
Class
to model a fixed-size one-dimensional matrix (normally called a Vector)
but given the name OneMatrix to avoid confusion with Vector
.
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 | |
OneMatrix(BaseNumber[] elements)
|
|
OneMatrix(int length)
|
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 i)
Method to get the ith element of this OneMatrix. |
BaseNumber |
getElement(int[] indices)
Method to get the value of the element specified by the indices given. |
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. |
int |
length()
|
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. |
Methods inherited from class com.rubecula.jquantity.Compound |
audit, getIdentifier, isMutable, main, 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 OneMatrix(BaseNumber[] elements)
elements
- the elements which will comprise this OneMatrix.public OneMatrix(int length)
length
- the number of elements to be contained in this OneMatrix.Method Detail |
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 int[] getDimensions()
CompoundModel
public int length()
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 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 i)
i
- the index of the desired element (0 <= i < length).
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |