|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object extended byptolemy.data.Token extended byptolemy.data.MatrixToken extended byptolemy.data.IntMatrixToken
A token that contains a 2-D int matrix.
| Field Summary |
| Fields inherited from class ptolemy.data.MatrixToken |
_nils, DO_COPY, DO_NOT_COPY |
| Fields inherited from class ptolemy.data.Token |
NIL |
| Constructor Summary | |
IntMatrixToken()
Construct an IntMatrixToken with a one by one matrix. |
|
IntMatrixToken(int[][] value)
Construct a IntMatrixToken with the specified 2-D matrix. |
|
IntMatrixToken(int[][] value,
int copy)
Construct a IntMatrixToken with the specified 2-D matrix. |
|
IntMatrixToken(int[] value,
int rows,
int columns)
Construct a IntMatrixToken with the specified 1-D matrix. |
|
IntMatrixToken(int[] value,
int rows,
int columns,
int copy)
Construct a IntMatrixToken with the specified 1-D matrix. |
|
IntMatrixToken(java.lang.String init)
Construct an IntMatrixToken from the specified string. |
|
IntMatrixToken(Token[] tokens,
int rows,
int columns)
Construct an IntMatrixToken from the specified array of tokens. |
|
| Method Summary | |
protected MatrixToken |
_add(MatrixToken rightArgument)
Return a new token whose value is the value of the argument Token added to the value of this Token. |
protected MatrixToken |
_addElement(Token rightArgument)
Return a new token whose value is the value of the argument Token added to the value of each element of this Token. |
protected MatrixToken |
_divideElement(Token rightArgument)
Return a new token whose elements are the result of dividing the elements of this token by the argument. |
protected int[] |
_getInternalIntArray()
Return a reference to the internal 2-D matrix of ints that represents this Token. |
protected MatrixToken |
_moduloElement(Token rightArgument)
Return a new token whose elements are the remainders of the elements of this token when divided by the argument. |
protected MatrixToken |
_multiply(MatrixToken rightArgument)
Return a new token whose value is the value of this token multiplied by the value of the argument token. |
protected MatrixToken |
_multiplyElement(Token rightArgument)
Return a new token whose value is the value of this token multiplied by the value of the argument scalar token. |
protected MatrixToken |
_subtract(MatrixToken rightArgument)
Return a new token whose value is the value of the argument token subtracted from the value of this token. |
protected MatrixToken |
_subtractElement(Token rightArgument)
Return a new token whose value is the value of the argument Token subtracted from the value of each element of this Token. |
protected MatrixToken |
_subtractElementReverse(Token rightArgument)
Return a new token whose value is the value of the argument Token subtracted from the value of each element of this Token. |
Complex[][] |
complexMatrix()
Return the content of this token as a 2-D Complex matrix. |
static Token |
convert(ScalarToken token,
int size)
Convert the specified scalar token into an instance of IntMatrixToken. |
static IntMatrixToken |
convert(Token token)
Convert the specified token into an instance of IntMatrixToken. |
double[][] |
doubleMatrix()
Return the content of this token as a 2-D double matrix. |
boolean |
equals(java.lang.Object object)
Return true if the argument is an instance of IntMatrixToken of the same dimensions and the corresponding elements of the matrices are equal. |
int |
getColumnCount()
Return the number of columns in the matrix. |
Token |
getElementAsToken(int row,
int column)
Return the element of the matrix at the specified row and column in a IntToken. |
int |
getElementAt(int row,
int column)
Return the element of the contained matrix at the specified row and column. |
Type |
getElementType()
Return the Type of the tokens contained in this matrix token. |
int |
getRowCount()
Return the number of rows in the matrix. |
Type |
getType()
Return the type of this token. |
int |
hashCode()
Return a hash code value for this token. |
int[][] |
intMatrix()
Return the content in the token as a 2-D int matrix. |
long[][] |
longMatrix()
Return the content of this token as a 2-D long matrix. |
Token |
one()
Return a new Token representing the left multiplicative identity. |
Token |
oneRight()
Return a new Token representing the right multiplicative identity. |
Token |
zero()
Return a new Token representing the additive identity. |
| Methods inherited from class ptolemy.data.MatrixToken |
_elementIsNil, _isCloseTo, _isEqualTo, add, addReverse, arrayToMatrix, arrayToMatrix, arrayToMatrixReturnType, create, createSequence, createSequenceReturnType, createTokenSequence, determineSequenceLength, divide, divideReverse, isCloseTo, isEqualTo, matrixToArray, matrixToArrayReturnType, modulo, moduloReverse, multiply, multiplyReverse, subtract, subtractReverse, toArray, toArrayReturnType, toString |
| Methods inherited from class ptolemy.data.Token |
isCloseTo, isNil, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, pow, zeroReturnType |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public IntMatrixToken()
public IntMatrixToken(int[] value, int rows, int columns) throws IllegalActionException
value - The 1-D matrix.rows - The number of rows.columns - The number of columns.
IllegalActionException - If the specified matrix
is null.public IntMatrixToken(int[] value, int rows, int columns, int copy) throws IllegalActionException
value - The 1-D matrix.rows - The number of rows.columns - The number of columns.copy - If this parameter is
MatrixToken.DO_COPY, then the value matrix
is copied. If this parameter is
MatrixToken.DO_NOT_COPY, then the value matrix
is NOT copied and should not be modified after construction of this
object.
IllegalActionException - If the specified matrix
is null.public IntMatrixToken(int[][] value) throws IllegalActionException
value - The 2-D matrix used to initialize this object.
IllegalActionException - If the specified matrix
is null.public IntMatrixToken(int[][] value, int copy) throws IllegalActionException
Since the DO_NOT_COPY option requires some care, this constructor should be protected, but is not.
value - The 2-D matrix used to initialize this object.copy - If this parameter is
MatrixToken.DO_COPY, then the value matrix
is copied. If this parameter is
MatrixToken.DO_NOT_COPY, then the value matrix
is NOT copied and should not be modified after construction of this
object.
IllegalActionException - If the specified matrix
is null.public IntMatrixToken(java.lang.String init) throws IllegalActionException
init - A string expression of a 2-D int matrix.
IllegalActionException - If the string does
not contain a parsable 2-D int matrix.public IntMatrixToken(Token[] tokens, int rows, int columns) throws IllegalActionException
tokens - The array of tokens, which must contains
rows * columns ScalarTokens.rows - The number of rows in the matrix to be created.columns - The number of columns in the matrix to be
created.
IllegalActionException - If the array of tokens is
null, or the length of the array is not correct, or if one of
the elements of the array is null, or if one of the elements
of the array cannot be losslessly converted to an integer.| Method Detail |
public Complex[][] complexMatrix()
complexMatrix in class MatrixTokenpublic static IntMatrixToken convert(Token token) throws IllegalActionException
token - The token to be converted to a IntMatrixToken.
IllegalActionException - If the conversion cannot
be carried out.public static Token convert(ScalarToken token, int size) throws IllegalActionException
token - The token to be converted to a IntMatrixToken.size - The number of rows and columns of the resulting matrix.
IllegalActionException - If the conversion cannot
be carried out.public double[][] doubleMatrix()
doubleMatrix in class MatrixTokenpublic boolean equals(java.lang.Object object)
object - An instance of Object.
public int getColumnCount()
getColumnCount in class MatrixTokenpublic Token getElementAsToken(int row, int column) throws java.lang.ArrayIndexOutOfBoundsException
getElementAsToken in class MatrixTokenrow - The row index of the desired element.column - The column index of the desired element.
java.lang.ArrayIndexOutOfBoundsException - If the specified
row or column number is outside the range of the matrix.public int getElementAt(int row, int column)
row - The row index of the desired element.column - The column index of the desired element.
java.lang.ArrayIndexOutOfBoundsException - If the specified
row or column number is outside the range of the matrix.public Type getElementType()
getElementType in class MatrixTokenpublic int getRowCount()
getRowCount in class MatrixTokenpublic Type getType()
public int hashCode()
public int[][] intMatrix()
intMatrix in class MatrixTokenpublic long[][] longMatrix()
longMatrix in class MatrixTokenpublic Token one()
public Token oneRight()
oneRight in class MatrixTokenpublic Token zero()
protected MatrixToken _add(MatrixToken rightArgument) throws IllegalActionException
_add in class MatrixTokenrightArgument - The token to add to this token.
IllegalActionException - If the units are not
compatible, or this operation is not supported by the derived
class.protected MatrixToken _addElement(Token rightArgument) throws IllegalActionException
_addElement in class MatrixTokenrightArgument - The token to add to this token.
IllegalActionException - If this operation is not
supported by the derived class.protected MatrixToken _divideElement(Token rightArgument) throws IllegalActionException
_divideElement in class MatrixTokenrightArgument - The token that divides this token.
IllegalActionException - If this operation is not
supported by the derived class.protected int[] _getInternalIntArray()
protected MatrixToken _moduloElement(Token rightArgument) throws IllegalActionException
_moduloElement in class MatrixTokenrightArgument - The token that performs modulo on this token.
IllegalActionException - If this operation is not
supported by the derived class.protected MatrixToken _multiply(MatrixToken rightArgument) throws IllegalActionException
_multiply in class MatrixTokenrightArgument - The token to multiply this token by.
IllegalActionException - If the units are not
compatible, or this operation is not supported by the derived
class.protected MatrixToken _multiplyElement(Token rightArgument) throws IllegalActionException
_multiplyElement in class MatrixTokenrightArgument - The token to multiply this token by.
IllegalActionException - If this method is not
supported by the derived class.protected MatrixToken _subtract(MatrixToken rightArgument) throws IllegalActionException
_subtract in class MatrixTokenrightArgument - The token to subtract from this token.
IllegalActionException - If the units are not
compatible, or this operation is not supported by the derived
class.protected MatrixToken _subtractElement(Token rightArgument) throws IllegalActionException
_subtractElement in class MatrixTokenrightArgument - The token to subtract from this token.
IllegalActionException - If this operation is not
supported by the derived class.protected MatrixToken _subtractElementReverse(Token rightArgument) throws IllegalActionException
_subtractElementReverse in class MatrixTokenrightArgument - The token to subtract from this token.
IllegalActionException - If this operation is not
supported by the derived class.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||