org.apfloat.spi.NTTStepStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apfloat Show documentation
Show all versions of apfloat Show documentation
High performance arbitrary precision arithmetic library
package org.apfloat.spi;
import org.apfloat.ApfloatContext;
import org.apfloat.ApfloatRuntimeException;
/**
* Steps for the six-step or two-pass NTT.
*
* @since 1.7.0
* @version 1.7.0
* @author Mikko Tommila
*/
public interface NTTStepStrategy
{
/**
* Multiply each matrix element (i, j)
by wi * j / totalTransformLength
.
* The matrix size is n1 x n2.
*
* @param arrayAccess The memory array to multiply.
* @param startRow Which row in the whole matrix the starting row in the arrayAccess
is.
* @param startColumn Which column in the whole matrix the starting column in the arrayAccess
is.
* @param rows The number of rows in the arrayAccess
to multiply.
* @param columns The number of columns in the matrix (= n2).
* @param length The length of data in the matrix being transformed.
* @param totalTransformLength The total transform length, for the scaling factor. Used only for the inverse case.
* @param isInverse If the multiplication is done for the inverse transform or not.
* @param modulus Index of the modulus.
*/
public void multiplyElements(ArrayAccess arrayAccess, int startRow, int startColumn, int rows, int columns, long length, long totalTransformLength, boolean isInverse, int modulus)
throws ApfloatRuntimeException;
/**
* Transform the rows of the data matrix.
* If only one processor is available, it runs all transforms in the current
* thread. If more than one processor are available, it dispatches the calculations
* to multiple threads to parallelize the calculation. The number of processors is
* determined using {@link ApfloatContext#getNumberOfProcessors()}.
*
* @param arrayAccess The memory array to split to rows and to transform.
* @param length Length of one transform (one row).
* @param count Number of rows.
* @param isInverse true
if an inverse transform is performed, false
if a forward transform is performed.
* @param permute If permutation should be done.
* @param modulus Index of the modulus.
*/
public void transformRows(ArrayAccess arrayAccess, int length, int count, boolean isInverse, boolean permute, int modulus)
throws ApfloatRuntimeException;
/**
* Get the maximum transform length.
*
* @return The maximum transform length.
*/
public long getMaxTransformLength();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy