Package rocks.palaiologos.maja.matrix
Class ComplexMatrix
A class representing a two-dimensional matrix of double precision complex numbers.
- Author:
- Palaiologos
-
Constructor Summary
ConstructorsConstructorDescriptionComplexMatrix
(int rows, int columns) ComplexMatrix
(List<List<Complex>> data) ComplexMatrix
(Complex[][] data) -
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 ComplexMatrix
Map 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
-
-
Method Details
-
into
-
copy
Description copied from class:Matrix
Copy the matrix. -
transpose
Description copied from class:Matrix
Transpose the matrix, i.e. swap its axes. -
map
Description copied from class:Matrix
Map each cell of the matrix with a specified mapper. -
zipWith
Description copied from class:Matrix
Zip two matrices together to produce a new matrix, using a specified zipper function. -
reverseFirst
Description copied from class:Matrix
Reverse the matrix on the first axis.- Overrides:
reverseFirst
in classMatrix<Complex>
- Returns:
-
reverseLast
Description copied from class:Matrix
Reverse the matrix on the last axis.- Overrides:
reverseLast
in classMatrix<Complex>
- Returns:
-
mapIdx
Description copied from class:Matrix
Map 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:Matrix
Compute 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)
-