public interface MatrixStrategy
Modifier and Type | Method and Description |
---|---|
void |
permuteToDoubleWidth(ArrayAccess arrayAccess,
int n1,
int n2)
Permute the rows of the n1 x n2 matrix so that it is shaped like a
n1/2 x 2*n2 matrix.
|
void |
permuteToHalfWidth(ArrayAccess arrayAccess,
int n1,
int n2)
Permute the rows of the n1 x n2 matrix so that it is shaped like a
2*n1 x n2/2 matrix.
|
void |
transpose(ArrayAccess arrayAccess,
int n1,
int n2)
Transpose a n1 x n2 matrix.
|
void |
transposeSquare(ArrayAccess arrayAccess,
int n1,
int n2)
Transpose a square n1 x n1 block of n1 x n2 matrix.
|
void transpose(ArrayAccess arrayAccess, int n1, int n2) throws ApfloatRuntimeException
Both n1 and n2 must be powers of two. Additionally, one of these must be true:
n1 = n2
n1 = 2*n2
n2 = 2*n1
arrayAccess
- Accessor to the matrix data. This data will be transposed.n1
- Number of rows in the matrix.n2
- Number of columns in the matrix.ApfloatRuntimeException
void transposeSquare(ArrayAccess arrayAccess, int n1, int n2) throws ApfloatRuntimeException
Both n1 and n2 must be powers of two, and n1 <= n2.
arrayAccess
- Accessor to the matrix data. This data will be transposed.n1
- Number of rows and columns in the block to be transposed.n2
- Number of columns in the matrix.ApfloatRuntimeException
void permuteToDoubleWidth(ArrayAccess arrayAccess, int n1, int n2) throws ApfloatRuntimeException
Both n1 and n2 must be powers of two, and n1 >= 2.
E.g. if the matrix layout is originally as follows:
0 | 1 | 2 | 3 |
4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 |
Then after this method it is as follows:
0 | 1 | 2 | 3 | 8 | 9 | 10 | 11 |
4 | 5 | 6 | 7 | 12 | 13 | 14 | 15 |
arrayAccess
- Accessor to the matrix data. This data will be permuted.n1
- Number of rows in the matrix.n2
- Number of columns in the matrix.ApfloatRuntimeException
void permuteToHalfWidth(ArrayAccess arrayAccess, int n1, int n2) throws ApfloatRuntimeException
Both n1 and n2 must be powers of two. E.g. if the matrix layout is originally as follows:
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Then after this method it is as follows:
0 | 1 | 2 | 3 |
8 | 9 | 10 | 11 |
4 | 5 | 6 | 7 |
12 | 13 | 14 | 15 |
arrayAccess
- Accessor to the matrix data. This data will be permuted.n1
- Number of rows in the matrix.n2
- Number of columns in the matrix.ApfloatRuntimeException
Copyright © 2018. All rights reserved.