public class FloatCarryCRTStepStrategy extends FloatCRTMath implements CarryCRTStepStrategy<float[]>
float
type.All access to this class must be externally synchronized.
Constructor and Description |
---|
FloatCarryCRTStepStrategy(int radix)
Creates a carry-CRT steps object using the specified radix.
|
Modifier and Type | Method and Description |
---|---|
float[] |
carry(DataStorage dataStorage,
long size,
long resultSize,
long offset,
long length,
float[] results,
float[] previousResults)
Propagate carries from the previous block computed with the CRT
method.
|
float[] |
crt(DataStorage resultMod0,
DataStorage resultMod1,
DataStorage resultMod2,
DataStorage dataStorage,
long size,
long resultSize,
long offset,
long length)
Perform the Chinese Remainder Theorem (CRT) on each element
of the three result data sets to get the result of each element
modulo the product of the three moduli.
|
add, compare, divide, multiply, subtract
baseAdd, baseDivide, baseMultiplyAdd, baseSubtract
public FloatCarryCRTStepStrategy(int radix)
radix
- The radix that will be used.public float[] crt(DataStorage resultMod0, DataStorage resultMod1, DataStorage resultMod2, DataStorage dataStorage, long size, long resultSize, long offset, long length) throws ApfloatRuntimeException
CarryCRTStepStrategy
Note that the return value's initial word may be zero or non-zero, depending on how large the result is.
Assumes that MODULUS[0] > MODULUS[1] > MODULUS[2]
.
crt
in interface CarryCRTStepStrategy<float[]>
resultMod0
- The result modulo MODULUS[0]
.resultMod1
- The result modulo MODULUS[1]
.resultMod2
- The result modulo MODULUS[2]
.dataStorage
- The destination data storage of the computation.size
- The number of elements in the whole data set.resultSize
- The number of elements needed in the final result.offset
- The offset within the data for the block to be computed.length
- Length of the block to be computed.ApfloatRuntimeException
public float[] carry(DataStorage dataStorage, long size, long resultSize, long offset, long length, float[] results, float[] previousResults) throws ApfloatRuntimeException
CarryCRTStepStrategy
carry
in interface CarryCRTStepStrategy<float[]>
dataStorage
- The destination data storage of the computation.size
- The number of elements in the whole data set.resultSize
- The number of elements needed in the final result.offset
- The offset within the data for the block to be computed.length
- Length of the block to be computed.results
- The carry overflow from this block (two elements).previousResults
- The carry overflow from the previous block (two elements).ApfloatRuntimeException
Copyright © 2019. All rights reserved.