ComplexMatrix

public class ComplexMatrix extends ComplexTensor

Represents complex matrix. ComplexMatrix class is a subclass of ComplexTensor class.

Parameters

data

must fit into the shape of this matrix.

Constructors

ComplexMatrix
Link copied to clipboard
ComplexMatrix ComplexMatrix(Integer rows2, Integer cols2, Function2<Integer, Integer, ComplexDouble> lambda)
It is possible to set a value using lambda function.
ComplexMatrix
Link copied to clipboard
ComplexMatrix ComplexMatrix(Integer rows, Integer cols, Array<ComplexDouble> data)
Creates a new matrix.

Types

Companion
Link copied to clipboard
public class Companion

Functions

addRow
Link copied to clipboard
final ComplexMatrix addRow(Integer srcRowIndex, Integer dstRowIndex, Number fraction)
Do a row addition transformation; add dstRow multiplied by fraction to srcRow.
adjoint
Link copied to clipboard
final ComplexMatrix adjoint()
Calculate adjoint matrix of this matrix.
columnWiseMean
Link copied to clipboard
final ComplexRowVector columnWiseMean()
Calculate the mean value of each column.
colVecNormSq
Link copied to clipboard
final ComplexRowVector colVecNormSq()
Calculate the squared norm of each column vector.
concat
Link copied to clipboard
final ComplexMatrix concat(ComplexMatrix other, Integer concatDim)
Concatenate to other matrix.
final ComplexTensor concat(ComplexTensor other, Integer concatDim)
Concatenate to other tensor.
conjTrans
Link copied to clipboard
ComplexMatrix conjTrans()
Calculate conjugate transpose of this matrix.
copy
Link copied to clipboard
ComplexMatrix copy()
Same as ComplexTensor.copy but returns ComplexMatrix.
div
Link copied to clipboard
ComplexMatrix div(ComplexDouble other)
ComplexTensor div(Number other)
eltwiseMul
Link copied to clipboard
final ComplexMatrix eltwiseMul(ComplexMatrix other)
Element-wise multiplication.
equals
Link copied to clipboard
Boolean equals(Object other)
flatten
Link copied to clipboard
final ComplexTensor flatten()
Reshape to a 1-dimensional tensor.
frobeniusNormSquared
Link copied to clipboard
final Double frobeniusNormSquared()
Calculate squared frobenius norm.
get
Link copied to clipboard
final ComplexDouble get(IntArray indices)
final ComplexTensor get(Long indexLong)
final ComplexDouble get(Integer rowIndex, Integer colIndex)
getCols
Link copied to clipboard
final Integer getCols()
number of columns.
getData
Link copied to clipboard
final Array<ComplexDoublegetData()
must fit into the shape of this tensor.
getDim
Link copied to clipboard
final Integer getDim()
tensor dimension.
getRows
Link copied to clipboard
final Integer getRows()
number of rows.
getShape
Link copied to clipboard
final IntArray getShape()
tensor shape.
getSize
Link copied to clipboard
final Integer getSize()
getSubmatrix
Link copied to clipboard
ComplexMatrix getSubmatrix(Integer rowIndexStart, Integer rowIndexEnd, Integer colIndexStart, Integer colIndexEnd)
Get a submatrix by slicing this matrix.
map
Link copied to clipboard
ComplexMatrix map(Function1<ComplexDouble, ComplexDouble> lambda)
Same as ComplexTensor.map but returns ComplexMatrix.
minorMatrix
Link copied to clipboard
final ComplexMatrix minorMatrix(Integer rowIndex, Integer colIndex)
Get a minor matrix.
minus
Link copied to clipboard
final ComplexMatrix minus(ComplexMatrix other)
final ComplexTensor minus(ComplexTensor other)
plus
Link copied to clipboard
final ComplexMatrix plus(ComplexMatrix other)
final ComplexTensor plus(ComplexTensor other)
pow
Link copied to clipboard
final ComplexMatrix pow(Integer n)
Calculate the nth power of this matrix.
pseudoEquals
Link copied to clipboard
final Boolean pseudoEquals(ComplexTensor other)
Determines if other is close enough to be said the same.
reshape
Link copied to clipboard
final ComplexTensor reshape(IntArray newShape)
Reshape this tensor.
final ComplexMatrix reshape(Integer newRows, Integer newCols)
Reshape this matrix.
rowVecNormSq
Link copied to clipboard
final ComplexColumnVector rowVecNormSq()
Calculate the squared norm of each row vector.
rowWiseMean
Link copied to clipboard
final ComplexColumnVector rowWiseMean()
Calculate the mean value of each row.
set
Link copied to clipboard
final Unit set(IntArray indices, ComplexDouble value)
final Unit set(Integer rowIndex, Integer colIndex, ComplexDouble value)
setSubmatrix
Link copied to clipboard
Unit setSubmatrix(Integer rowIndexStart, Integer rowIndexEnd, Integer colIndexStart, Integer colIndexEnd, ComplexMatrix other)
Set a submatrix by substituting other to desired position.
sum
Link copied to clipboard
final ComplexDouble sum()
Calculate the sum of all values in this matrix.
switchRow
Link copied to clipboard
final ComplexMatrix switchRow(Integer rowIndex1, Integer rowIndex2)
Do a row switching transformation.
times
Link copied to clipboard
final ComplexColumnVector times(ComplexColumnVector other)
ComplexMatrix times(ComplexDouble other)
ComplexMatrix times(ComplexMatrix other)
final ComplexTensor times(ComplexTensor other)
ComplexMatrix times(Number other)
final ComplexColumnVector times(ColumnVector other)
toComplexColVector
Link copied to clipboard
final ComplexColumnVector toComplexColVector()
Downcast to ComplexColumnVector class if possible; i.e.
toComplexMatrix
Link copied to clipboard
final ComplexMatrix toComplexMatrix()
Downcast to ComplexMatrix class, if possible: i.e.
toComplexRowVector
Link copied to clipboard
final ComplexRowVector toComplexRowVector()
Downcast to ComplexRowVector class if possible; i.e.
toString
Link copied to clipboard
String toString()
trace
Link copied to clipboard
final ComplexDouble trace()
Calculate the trace of this matrix.
transpose
Link copied to clipboard
ComplexMatrix transpose()
Transpose this Matrix.
unaryMinus
Link copied to clipboard
ComplexMatrix unaryMinus()
unaryPlus
Link copied to clipboard
ComplexMatrix unaryPlus()

Properties

cols
Link copied to clipboard
private final Integer cols
number of columns.
data
Link copied to clipboard
private final Array<ComplexDoubledata
must fit into the shape of this tensor.
dim
Link copied to clipboard
private final Integer dim
tensor dimension.
rows
Link copied to clipboard
private final Integer rows
number of rows.
shape
Link copied to clipboard
private final IntArray shape
tensor shape.
size
Link copied to clipboard
private final Integer size

Inheritors

ComplexColumnVector
Link copied to clipboard
ComplexRowVector
Link copied to clipboard

Extensions

determinant
Link copied to clipboard
final ComplexDouble determinant()
Calculates a determiant using LU decomposition through recursion, O(n^3).
inverse
Link copied to clipboard
final ComplexMatrix inverse()
Calculates an inverse matrix of a square matrix.
plu
Link copied to clipboard
final Array<ComplexMatrixplu()
PLU decomposition of a matrix.
rowEchelonForm
Link copied to clipboard
final ComplexMatrix rowEchelonForm()
Calculate reduced row echelon form using Gaussian elimination.