Package org.apfloat.aparapi
Class ColumnSixStepFNTStrategy
- java.lang.Object
-
- org.apfloat.internal.AbstractStepFNTStrategy
-
- org.apfloat.internal.SixStepFNTStrategy
-
- org.apfloat.aparapi.ColumnSixStepFNTStrategy
-
- All Implemented Interfaces:
Parallelizable
,NTTStrategy
- Direct Known Subclasses:
IntAparapiSixStepFNTStrategy
,LongAparapiSixStepFNTStrategy
public class ColumnSixStepFNTStrategy extends SixStepFNTStrategy
Six-step NTT implementation that processes the data in the columns of the matrix.This transform only works together with an
NTTStepStrategy
implementation that processes the data in columns instead of rows and aMatrixStrategy
implementation that can transpose the data.The data size should be sufficiently large to meet the parallelization needs of the GPU. The GPU global size i.e. the number of columns in the data matrix should be at least 1024.
- Since:
- 1.8.3
- Version:
- 1.8.3
-
-
Field Summary
-
Fields inherited from class org.apfloat.internal.SixStepFNTStrategy
matrixStrategy
-
Fields inherited from class org.apfloat.internal.AbstractStepFNTStrategy
stepStrategy
-
-
Constructor Summary
Constructors Constructor Description ColumnSixStepFNTStrategy(NTTStepStrategy stepStrategy, MatrixStrategy matrixStrategy)
Basic constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
multiplyElements(ArrayAccess arrayAccess, int rows, int columns, long length, long totalTransformLength, boolean isInverse, int modulus)
Multiply each matrix element by a power of the n:th root of unity.protected void
transposeInitial(ArrayAccess arrayAccess, int n1, int n2, boolean isInverse)
The initial transpose of the forward transform, or the final transpose of the inverse transform, to transpose the columns of the matrix to be rows.protected void
transposeMiddle(ArrayAccess arrayAccess, int n1, int n2, boolean isInverse)
The second transpose of either the forward or inverse transform.-
Methods inherited from class org.apfloat.internal.SixStepFNTStrategy
inverseTransform, postTransform, preTransform, transform, transformFirst, transformSecond, transposeFinal
-
Methods inherited from class org.apfloat.internal.AbstractStepFNTStrategy
getTransformLength, inverseTransform, transform
-
-
-
-
Constructor Detail
-
ColumnSixStepFNTStrategy
public ColumnSixStepFNTStrategy(NTTStepStrategy stepStrategy, MatrixStrategy matrixStrategy)
Basic constructor.- Parameters:
stepStrategy
- A step strategy that can process data in columns.matrixStrategy
- A matrix strategy that can process the data.
-
-
Method Detail
-
transposeInitial
protected void transposeInitial(ArrayAccess arrayAccess, int n1, int n2, boolean isInverse)
Description copied from class:SixStepFNTStrategy
The initial transpose of the forward transform, or the final transpose of the inverse transform, to transpose the columns of the matrix to be rows. This step is needed in the six-step algorithm but is omitted in the four-step algorithm.- Overrides:
transposeInitial
in classSixStepFNTStrategy
- Parameters:
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.isInverse
-true
if an inverse transform is performed,false
if a forward transform is performed.
-
transposeMiddle
protected void transposeMiddle(ArrayAccess arrayAccess, int n1, int n2, boolean isInverse)
Description copied from class:SixStepFNTStrategy
The second transpose of either the forward or inverse transform. Normally this step is always required as the four-step algorithm only transforms columns of the matrix and the six-step algorithm transforms only rows.- Overrides:
transposeMiddle
in classSixStepFNTStrategy
- Parameters:
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.isInverse
-true
if an inverse transform is performed,false
if a forward transform is performed.
-
multiplyElements
protected void multiplyElements(ArrayAccess arrayAccess, int rows, int columns, long length, long totalTransformLength, boolean isInverse, int modulus)
Description copied from class:SixStepFNTStrategy
Multiply each matrix element by a power of the n:th root of unity.- Overrides:
multiplyElements
in classSixStepFNTStrategy
- Parameters:
arrayAccess
- The memory array to multiply.rows
- The number of rows in thearrayAccess
to multiply.columns
- The number of columns in the matrix (= n2).length
- The length of data in the matrix being transformed.totalTransformLength
- The total transform length, for the scaling factor. Used only for the inverse case.isInverse
- If the multiplication is done for the inverse transform or not.modulus
- Index of the modulus.
-
-