Class ComplexDenseTranspose
java.lang.Object
org.flag4j.operations.dense.complex.ComplexDenseTranspose
This class contains several algorithms for computing the transpose of a complex dense tensor.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CNumber[]
blockedMatrix
(CNumber[] src, int numRows, int numCols) Transposes a matrix using a blocked algorithm.static CNumber[]
blockedMatrixConcurrent
(CNumber[] src, int numRows, int numCols) Computes the transpose of a matrix using a blocked concurrent algorithm.static CNumber[]
blockedMatrixConcurrentHerm
(CNumber[] src, int numRows, int numCols) Computes the complex conjugate transpose of a matrix using a blocked concurrent algorithm.static CNumber[]
blockedMatrixHerm
(CNumber[] src, int numRows, int numCols) Computes complex conjugate transpose of a matrix using a blocked algorithm.static CNumber[]
Computes the transpose of a tensor.static CNumber[]
Transposes tensor along specified axes using a standard transpose algorithm.static CNumber[]
standardConcurrent
(CNumber[] src, Shape shape, int[] axes) Computes the transpose of a tensor using a concurrent implementation.static CNumber[]
standardConcurrent
(CNumber[] src, Shape shape, int axis1, int axis2) Transposes tensor along specified axes using a standard concurrent transpose algorithm.static CNumber[]
standardConcurrentHerm
(CNumber[] src, Shape shape, int[] axes) Computes the conjugate transpose of a tensor using a concurrent implementation.static CNumber[]
standardConcurrentHerm
(CNumber[] src, Shape shape, int axis1, int axis2) Computes complex conjugate transpose of a tensor along specified axes using a standard concurrent transpose algorithm.static CNumber[]
standardHerm
(CNumber[] src, Shape shape, int axis1, int axis2) Computes complex conjugate transpose of a tensor along specified axes using a standard transpose algorithm.static CNumber[]
standardMatrix
(CNumber[] src, int numRows, int numCols) Transposes a matrix using the standard algorithm.static CNumber[]
standardMatrixConcurrent
(CNumber[] src, int numRows, int numCols) Computes the transpose of a matrix using a standard concurrent algorithm.static CNumber[]
standardMatrixConcurrentHerm
(CNumber[] src, int numRows, int numCols) Computes the complex conjugate transpose of a matrix using a standard concurrent algorithm.static CNumber[]
standardMatrixHerm
(CNumber[] src, int numRows, int numCols) Computes complex conjugate transpose of a matrix using the standard algorithm.
-
Constructor Details
-
ComplexDenseTranspose
private ComplexDenseTranspose()
-
-
Method Details
-
standard
Transposes tensor along specified axes using a standard transpose algorithm. In this context, transposing a tensor is equivalent to swapping a pair of axes.- Parameters:
src
- Entries of the tensor.shape
- Shape of the tensor to transpose.axis1
- First axis to swap in transpose.axis2
- Second axis to swap in transpose.- Returns:
- The transpose of the tensor along the specified axes.
-
standardConcurrent
Transposes tensor along specified axes using a standard concurrent transpose algorithm. In this context, transposing a tensor is equivalent to swapping a pair of axes.- Parameters:
src
- Entries of the tensor.shape
- Shape of the tensor to transpose.axis1
- First axis to swap in transpose.axis2
- Second axis to swap in transpose.- Returns:
- The transpose of the tensor along the specified axes.
-
standard
Computes the transpose of a tensor. That is, interchanges the axes of the tensor so that it matches the specified axes permutation.- Parameters:
src
- Entries of the tensor.shape
- Shape of the tensor to transpose.axes
- Permutation of tensor axis. If the tensor has rankN
, then this must be an array of lengthN
which is a permutation of{0, 1, 2, ..., N-1}
.- Returns:
- The transpose of the tensor along the specified axes.
- Throws:
IllegalArgumentException
- If theaxes
array is not a permutation of{0, 1, 2, ..., N-1}
.IllegalArgumentException
- If theshape
rank is less than 2.
-
standardConcurrent
Computes the transpose of a tensor using a concurrent implementation. That is, interchanges the axes of the tensor so that it matches the specified axes permutation.- Parameters:
src
- Entries of the tensor.shape
- Shape of the tensor to transpose.axes
- Permutation of tensor axis. If the tensor has rankN
, then this must be an array of lengthN
which is a permutation of{0, 1, 2, ..., N-1}
.- Returns:
- The transpose of the tensor along the specified axes.
- Throws:
IllegalArgumentException
- If theaxes
array is not a permutation of{0, 1, 2, ..., N-1}
.IllegalArgumentException
- If theshape
rank is less than 2.
-
standardMatrix
Transposes a matrix using the standard algorithm.- Parameters:
src
- Entries of the matrix to transpose.numRows
- Number of rows in the matrix.numCols
- Number of columns in the matrix.- Returns:
- The transpose of the matrix.
-
blockedMatrix
Transposes a matrix using a blocked algorithm. To get or set the block size seeConfigurations.getBlockSize()
orConfigurations.setBlockSize(int)
.- Parameters:
src
- Source matrix in the transpose.numRows
- Number of rows in the matrix.numCols
- Number of columns in the matrix.- Returns:
- The transpose of this tensor along specified axes
-
standardMatrixConcurrent
Computes the transpose of a matrix using a standard concurrent algorithm.- Parameters:
src
- Entries of the matrix to transpose.numRows
- Number of rows in source matrix.numCols
- Number of columns in source matrix.- Returns:
- The transpose of the source matrix.
-
blockedMatrixConcurrent
Computes the transpose of a matrix using a blocked concurrent algorithm.- Parameters:
src
- Entries of the matrix to transpose.numRows
- Number of rows in source matrix.numCols
- Number of columns in source matrix.- Returns:
- The transpose of the source matrix.
-
standardHerm
Computes complex conjugate transpose of a tensor along specified axes using a standard transpose algorithm. In this context, transposing a tensor is equivalent to swapping a pair of axes.- Parameters:
src
- Entries of the tensor.shape
- Shape of the tensor to transpose.axis1
- First axis to swap in transpose.axis2
- Second axis to swap in transpose.- Returns:
- The transpose of the tensor along the specified axes.
-
standardConcurrentHerm
Computes complex conjugate transpose of a tensor along specified axes using a standard concurrent transpose algorithm. In this context, transposing a tensor is equivalent to swapping a pair of axes.- Parameters:
src
- Entries of the tensor.shape
- Shape of the tensor to transpose.axis1
- First axis to swap in transpose.axis2
- Second axis to swap in transpose.- Returns:
- The complex conjugate transpose of the tensor along the specified axes.
-
standardConcurrentHerm
Computes the conjugate transpose of a tensor using a concurrent implementation. That is, interchanges the axes of the tensor so that it matches the specified axes permutation and so that the axis which are swapped and complex conjugated.- Parameters:
src
- Entries of the tensor.shape
- Shape of the tensor to transpose.axes
- Permutation of tensor axis. If the tensor has rankN
, then this must be an array of lengthN
which is a permutation of{0, 1, 2, ..., N-1}
.- Returns:
- The transpose of the tensor along the specified axes.
- Throws:
IllegalArgumentException
- If theaxes
array is not a permutation of{0, 1, 2, ..., N-1}
.IllegalArgumentException
- If theshape
rank is less than 2.
-
standardMatrixHerm
Computes complex conjugate transpose of a matrix using the standard algorithm.- Parameters:
src
- Entries of the matrix to transpose.numRows
- Number of rows in the matrix.numCols
- Number of columns in the matrix.- Returns:
- The transpose of the matrix.
-
blockedMatrixHerm
Computes complex conjugate transpose of a matrix using a blocked algorithm. To get or set the block size seeConfigurations.getBlockSize()
orConfigurations.setBlockSize(int)
.- Parameters:
src
- Source matrix in the transpose.numRows
- Number of rows in the matrix.numCols
- Number of columns in the matrix.- Returns:
- The complex conjugate transpose of this matrix.
-
standardMatrixConcurrentHerm
Computes the complex conjugate transpose of a matrix using a standard concurrent algorithm.- Parameters:
src
- Entries of the matrix to transpose.numRows
- Number of rows in source matrix.numCols
- Number of columns in source matrix.- Returns:
- The complex conjugate transpose of the source matrix.
-
blockedMatrixConcurrentHerm
Computes the complex conjugate transpose of a matrix using a blocked concurrent algorithm.- Parameters:
src
- Entries of the matrix to transpose.numRows
- Number of rows in source matrix.numCols
- Number of columns in source matrix.- Returns:
- The complex conjugate transpose of the source matrix.
-