Package rocks.palaiologos.maja.matrix
Class ComplexMatrix
A class representing a two-dimensional matrix of double precision complex numbers.
-
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionComplexMatrix(int rows, int columns) ComplexMatrix(List<List<Complex>> data) ComplexMatrix(Complex[][] data) private -
Method Summary
Modifier and TypeMethodDescriptioncopy()Copy the matrix.dot(Matrix<Complex> another, BiFunction<Complex, Complex, Complex> scalar, BiFunction<Complex, Complex, Complex> vector) Compute the generalised dot product of the matrix with another matrix.static ComplexMatrixMap each cell of the matrix with a specified mapper.Map each cell of the matrix with a specified mapper, which takes the index of the cell as an additional argument.Reverse the matrix on the first axis.Reverse the matrix on the last axis.Transpose the matrix, i.e.Zip two matrices together to produce a new matrix, using a specified zipper function.
-
Constructor Details
-
ComplexMatrix
-
ComplexMatrix
public ComplexMatrix(int rows, int columns) -
ComplexMatrix
-
ComplexMatrix
-
-
Method Details
-
into
-
copy
Description copied from class:MatrixCopy the matrix. -
transpose
Description copied from class:MatrixTranspose the matrix, i.e. swap its axes. -
map
Description copied from class:MatrixMap each cell of the matrix with a specified mapper. -
zipWith
Description copied from class:MatrixZip two matrices together to produce a new matrix, using a specified zipper function. -
reverseFirst
Description copied from class:MatrixReverse the matrix on the first axis.- Overrides:
reverseFirstin classMatrix<Complex>- Returns:
-
reverseLast
Description copied from class:MatrixReverse the matrix on the last axis.- Overrides:
reverseLastin classMatrix<Complex>- Returns:
-
mapIdx
Description copied from class:MatrixMap each cell of the matrix with a specified mapper, which takes the index of the cell as an additional argument. -
dot
public ComplexMatrix dot(Matrix<Complex> another, BiFunction<Complex, Complex, Complex> scalar, BiFunction<Complex, Complex, Complex> vector) Description copied from class:MatrixCompute the generalised dot product of the matrix with another matrix. The generalised dot product is defined as follows:(A o B) = sum_{i,j} (A_{i,j} o B_{i,j})Where o is the *scalar* product and sum is the *vector* sum. For example, to multiply two matrices, one would use:
dot(A, B, (a, b) -> a * b, (a, b) -> a + b)
-