Class AbstractStepFNTStrategy

    • Constructor Detail

      • AbstractStepFNTStrategy

        protected AbstractStepFNTStrategy()
        Subclass constructor.
    • Method Detail

      • transform

        public void transform​(DataStorage dataStorage,
                              int modulus)
                       throws ApfloatRuntimeException
        Description copied from interface: NTTStrategy
        Perform a forward transform on the data.

        Multiple moduli can be used, if the convolution algorithm uses the Chinese Remainder Theorem to calculate the final result.

        Specified by:
        transform in interface NTTStrategy
        Parameters:
        dataStorage - The data to be transformed.
        modulus - Number of modulus to use (in case the transform supports multiple moduli).
        Throws:
        ApfloatRuntimeException
      • inverseTransform

        public void inverseTransform​(DataStorage dataStorage,
                                     int modulus,
                                     long totalTransformLength)
                              throws ApfloatRuntimeException
        Description copied from interface: NTTStrategy
        Perform an inverse transform on the data.

        Multiple moduli can be used, if the convolution algorithm uses the Chinese Remainder Theorem to calculate the final result.

        Specified by:
        inverseTransform in interface NTTStrategy
        Parameters:
        dataStorage - The data to be transformed.
        modulus - Number of modulus to use (in case the transform supports multiple moduli).
        totalTransformLength - Total transform length; the final result elements are divided by this value.
        Throws:
        ApfloatRuntimeException
      • getTransformLength

        public long getTransformLength​(long size)
        Description copied from interface: NTTStrategy
        Return the supported transform length for the specified data size.
        Specified by:
        getTransformLength in interface NTTStrategy
        Parameters:
        size - Length of the data to be transformed.
        Returns:
        Length of the transform needed by this transform.
      • transform

        protected abstract void transform​(DataStorage dataStorage,
                                          int n1,
                                          int n2,
                                          long length,
                                          int modulus)
                                   throws ApfloatRuntimeException
        Transform the data in steps.
        Parameters:
        dataStorage - The data.
        n1 - Height of the data matrix.
        n2 - Width of the data matrix.
        length - Length of the data.
        modulus - Which modulus to use.
        Throws:
        ApfloatRuntimeException
      • inverseTransform

        protected abstract void inverseTransform​(DataStorage dataStorage,
                                                 int n1,
                                                 int n2,
                                                 long length,
                                                 long totalTransformLength,
                                                 int modulus)
                                          throws ApfloatRuntimeException
        Inverse transform the data in steps.
        Parameters:
        dataStorage - The data.
        n1 - Height of the data matrix.
        n2 - Width of the data matrix.
        length - Length of the data.
        totalTransformLength - Total transform length.
        modulus - Which modulus to use.
        Throws:
        ApfloatRuntimeException