public class ComplexMatrixToken extends MatrixToken
Complex
_nils, DO_COPY, DO_NOT_COPY
Constructor and Description |
---|
ComplexMatrixToken()
Construct an ComplexMatrixToken with a one by one matrix.
|
ComplexMatrixToken(Complex[][] value)
Construct a ComplexMatrixToken with the specified 2-D matrix.
|
ComplexMatrixToken(Complex[][] value,
int copy)
Construct a ComplexMatrixToken with the specified 2-D matrix.
|
ComplexMatrixToken(java.lang.String init)
Construct an ComplexMatrixToken from the specified string.
|
ComplexMatrixToken(Token[] tokens,
int rows,
int columns)
Construct an ComplexMatrixToken from the specified array of
tokens.
|
Modifier and Type | Method and Description |
---|---|
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 Complex[][] |
_getInternalComplexMatrix()
Return a reference to the internal 2-D matrix of complex
numbers that represents this Token.
|
protected MatrixToken |
_multiply(MatrixToken rightArgument)
Return a new token whose value is the value of the argument
Token multiplied to the value of this 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 token.
|
protected MatrixToken |
_subtract(MatrixToken rightArgument)
Return a new token whose value is the value of the argument
Token subtracted to 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 new 2-D Complex matrix.
|
static ComplexMatrixToken |
convert(Token token)
Convert the specified token into an instance of ComplexMatrixToken.
|
MatrixToken |
crop(int rowStart,
int colStart,
int rowSpan,
int colSpan)
Return a new matrix that is a sub-matrix of this matrix.
|
boolean |
equals(java.lang.Object object)
Return true if the argument is an instance of ComplexMatrixToken
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 ComplexToken.
|
Complex |
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.
|
MatrixToken |
join(MatrixToken[][] matrices)
Join a matrix of matrices into a single matrix by tiling.
|
Token |
one()
Return a new Token representing the left multiplicative
identity.
|
Token |
oneRight()
Return a new Token representing the right multiplicative
identity.
|
MatrixToken[][] |
split(int[] rows,
int[] columns)
Split this matrix into multiple matrices.
|
Token |
zero()
Return a new Token representing the additive identity.
|
_elementIsNil, _isCloseTo, _isEqualTo, _moduloElement, add, addReverse, arrayToMatrix, arrayToMatrix, arrayToMatrixReturnType, booleanMatrix, create, createSequence, createSequenceReturnType, createTokenSequence, determineSequenceLength, divide, divideReverse, doubleMatrix, fixMatrix, intMatrix, isCloseTo, isEqualTo, longMatrix, matrixToArray, matrixToArrayReturnType, modulo, moduloReverse, multiply, multiplyReverse, subtract, subtractReverse, toArray, toArrayColumnMajor, toArrayReturnType, toString
isCloseTo, isNil, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, pow, zeroReturnType
public ComplexMatrixToken()
public ComplexMatrixToken(Complex[][] value) throws IllegalActionException
value
- The 2-D Complex matrix.IllegalActionException
- If the specified matrix
is null.public ComplexMatrixToken(Complex[][] value, int copy) throws IllegalActionException
Since the DO_NOT_COPY option requires some care, this constructor is protected.
value
- The 2-D Complex matrix.copy
- If MatrixToken.DO_COPY
, the the
value matrix is copied, If MatrixToken.DO_NOT_COPY
, then the value matrix
is not copied.IllegalActionException
- If the specified matrix
is null.public ComplexMatrixToken(java.lang.String init) throws IllegalActionException
init
- A string expression of a 2-D complex matrix.IllegalActionException
- If the string does
not contain a parsable 2-D complex matrix.public ComplexMatrixToken(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.public Complex[][] complexMatrix()
complexMatrix
in class MatrixToken
public static ComplexMatrixToken convert(Token token) throws IllegalActionException
token
- The token to be converted to a ComplexMatrixToken.IllegalActionException
- If the conversion cannot
be carried out.public MatrixToken crop(int rowStart, int colStart, int rowSpan, int colSpan) throws IllegalActionException
crop
in class MatrixToken
rowStart
- The row to start on.colStart
- The column to start on.rowSpan
- The number of rows to copy.colSpan
- The number of columns to copy.IllegalActionException
- If the returned matrix is empty or if the specified
parameters result in out of bounds accesses.public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- An instance of Object.public int getColumnCount()
getColumnCount
in class MatrixToken
public Token getElementAsToken(int row, int column) throws java.lang.ArrayIndexOutOfBoundsException
getElementAsToken
in class MatrixToken
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 Complex 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 MatrixToken
public int getRowCount()
getRowCount
in class MatrixToken
public Type getType()
public int hashCode()
hashCode
in class java.lang.Object
public MatrixToken join(MatrixToken[][] matrices) throws IllegalActionException
join
in class MatrixToken
matrices
- A two-dimensional array of matrix tokens.IllegalActionException
- If the types of the matrices
in the input are not all the same, or if tiling fails due
to size incompatibilities, or if the input matrix has no
tokens.public MatrixToken[][] split(int[] rows, int[] columns)
split
in class MatrixToken
rows
- The number of rows per submatrix.columns
- The number of columns per submatrix.public Token one()
public Token oneRight()
oneRight
in class MatrixToken
public Token zero()
protected MatrixToken _add(MatrixToken rightArgument) throws IllegalActionException
_add
in class MatrixToken
rightArgument
- 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 MatrixToken
rightArgument
- 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 MatrixToken
rightArgument
- The token that divides this token.IllegalActionException
- If this operation is not
supported by the derived class.protected Complex[][] _getInternalComplexMatrix()
protected MatrixToken _multiply(MatrixToken rightArgument) throws IllegalActionException
_multiply
in class MatrixToken
rightArgument
- 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 MatrixToken
rightArgument
- 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 MatrixToken
rightArgument
- The token to subtract to 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 MatrixToken
rightArgument
- 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 MatrixToken
rightArgument
- The token to subtract from this token.IllegalActionException
- If this operation is not
supported by the derived class.