Package org.jscience.mathematics.vector
Class ComplexMatrix
- All Implemented Interfaces:
javolution.lang.Immutable
,javolution.lang.Realtime
,javolution.lang.ValueType
,GroupAdditive<Matrix<Complex>>
,Ring<Matrix<Complex>>
,Structure<Matrix<Complex>>
,VectorSpace<Matrix<Complex>,
Complex>
This class represents an optimized matrix
implementation
for complex
numbers.
Instances of this class can be created from ComplexVector
,
either as rows or columns if the matrix is transposed. For example:[code]
ComplexVector
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionadjoint()
Returns the adjoint of this matrix.cofactor
(int i, int j) Returns the cofactor of an element in this matrix.copy()
Returns a copy of this matrixallocated
by the calling thread (possibly on the stack).Returns the determinant of this matrix.get
(int i, int j) Returns a single element from this matrix.getColumn
(int j) Returns the column identified by the specified index in this matrix.Returns the diagonal vector.int
Returns the number of columnsn
for this matrix.int
Returns the number of rowsm
for this matrix.getRow
(int i) Returns the row identified by the specified index in this matrix.inverse()
Returns the inverse of this matrix (must be square).Returns the difference between this matrix and the one specified.opposite()
Returns the negation of this matrix.Returns the sum of this matrix with the one specified.Returns the linear algebraic matrix tensor product of this matrix and another (Kronecker product).Returns the product of this matrix by the specified factor.Returns the product of this matrix with the one specified.Returns the product of this matrix by the specified vector.Returns the transpose of this matrix.static ComplexMatrix
valueOf
(List<ComplexVector> rows) Returns a complex matrix holding the row vectors from the specified collection (column vectors iftransposed
).static ComplexMatrix
Returns a complex matrix from the specified 2-dimensional array.static ComplexMatrix
valueOf
(ComplexVector... rows) Returns a complex matrix holding the specified row vectors (column vectors iftransposed
).static ComplexMatrix
Returns a complex matrix equivalent to the specified matrix.Returns the vectorization of this matrix.
-
Method Details
-
valueOf
Returns a complex matrix from the specified 2-dimensional array. The first dimension being the row and the second being the column.- Parameters:
elements
- this matrix elements.- Returns:
- the matrix having the specified elements.
- Throws:
DimensionException
- if rows have different length.- See Also:
-
valueOf
Returns a complex matrix holding the specified row vectors (column vectors iftransposed
).- Parameters:
rows
- the row vectors.- Returns:
- the matrix having the specified rows.
- Throws:
DimensionException
- if the rows do not have the same dimension.
-
valueOf
Returns a complex matrix holding the row vectors from the specified collection (column vectors iftransposed
).- Parameters:
rows
- the list of row vectors.- Returns:
- the matrix having the specified rows.
- Throws:
DimensionException
- if the rows do not have the same dimension.
-
valueOf
Returns a complex matrix equivalent to the specified matrix.- Parameters:
that
- the matrix to convert.- Returns:
that
or a complex matrix holding the same elements as the specified matrix.
-
getNumberOfRows
public int getNumberOfRows()Description copied from class:Matrix
Returns the number of rowsm
for this matrix.- Specified by:
getNumberOfRows
in classMatrix<Complex>
- Returns:
- m, the number of rows.
-
getNumberOfColumns
public int getNumberOfColumns()Description copied from class:Matrix
Returns the number of columnsn
for this matrix.- Specified by:
getNumberOfColumns
in classMatrix<Complex>
- Returns:
- n, the number of columns.
-
get
Description copied from class:Matrix
Returns a single element from this matrix. -
getRow
Description copied from class:Matrix
Returns the row identified by the specified index in this matrix. -
getColumn
Description copied from class:Matrix
Returns the column identified by the specified index in this matrix. -
getDiagonal
Description copied from class:Matrix
Returns the diagonal vector.- Specified by:
getDiagonal
in classMatrix<Complex>
- Returns:
- the vector holding the diagonal elements.
-
opposite
Description copied from class:Matrix
Returns the negation of this matrix. -
plus
Description copied from class:Matrix
Returns the sum of this matrix with the one specified. -
minus
Description copied from class:Matrix
Returns the difference between this matrix and the one specified. -
times
Description copied from class:Matrix
Returns the product of this matrix by the specified factor. -
times
Description copied from class:Matrix
Returns the product of this matrix by the specified vector. -
times
Description copied from class:Matrix
Returns the product of this matrix with the one specified. -
inverse
Description copied from class:Matrix
Returns the inverse of this matrix (must be square). -
determinant
Description copied from class:Matrix
Returns the determinant of this matrix.- Specified by:
determinant
in classMatrix<Complex>
- Returns:
- this matrix determinant.
-
transpose
Description copied from class:Matrix
Returns the transpose of this matrix. -
cofactor
Description copied from class:Matrix
Returns the cofactor of an element in this matrix. It is the value obtained by evaluating the determinant formed by the elements not in that particular row or column. -
adjoint
Description copied from class:Matrix
Returns the adjoint of this matrix. It is obtained by replacing each element in this matrix with its cofactor and applying a + or - sign according (-1)**(i+j), and then finding the transpose of the resulting matrix. -
tensor
Description copied from class:Matrix
Returns the linear algebraic matrix tensor product of this matrix and another (Kronecker product). The default implementation returns aDenseMatrix
. -
vectorization
Description copied from class:Matrix
Returns the vectorization of this matrix. The vectorization of a matrix is the column vector obtain by stacking the columns of the matrix on top of one another. The default implementation returns aDenseVector
.- Specified by:
vectorization
in classMatrix<Complex>
- Returns:
- the vectorization of this matrix.
- See Also:
-
copy
Description copied from class:Matrix
Returns a copy of this matrixallocated
by the calling thread (possibly on the stack).
-