# Class Factor3NTTStrategy

java.lang.Object
org.apfloat.internal.Factor3NTTStrategy

All Implemented Interfaces:
  `Parallelizable, NTTStrategy`

Direct Known Subclasses:
  `DecorableFactor3NTTStrategy`

public class Factor3NTTStrategy extends Object implements NTTStrategy, Parallelizable
A transform that implements a 3-point transform on top of another Number Theoretic Transform that does transforms of length 2n.

Since:
  1.7.0
Version:
  1.15.0
Author:
  Mikko Tommila
See Also:
  - `Factor3NTTStepStrategy`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Factor3NTTStepStrategy`
  `stepStrategy`
  The factor-3 NTT steps.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Factor3NTTStrategy(NTTStrategy factor2Strategy)`
  Creates a new factor-3 transform strategy on top of an existing transform.
  `Factor3NTTStrategy(NTTStrategy factor2Strategy, Factor3NTTStepStrategy stepStrategy)`
  Creates a new factor-3 transform strategy on top of an existing factor-2 transform and a factor-3 step strategy.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `getTransformLength(long size)`
  Return the supported transform length for the specified data size.
  `void`
  `inverseTransform(DataStorage dataStorage, int modulus, long totalTransformLength)`
  Perform an inverse transform on the data.
  `void`
  `transform(DataStorage dataStorage, int modulus)`
  Perform a forward transform on the data.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### stepStrategy

    protected Factor3NTTStepStrategy stepStrategy
    The factor-3 NTT steps.

- ## Constructor Details

  - ### Factor3NTTStrategy

    public Factor3NTTStrategy(NTTStrategy factor2Strategy)
    Creates a new factor-3 transform strategy on top of an existing transform. The underlying transform needs to be capable of only doing transforms of length 2n.
    Parameters:
      `factor2Strategy` - The underlying transformation strategy, that can be capable of only doing radix-2 transforms.

  - ### Factor3NTTStrategy

    public Factor3NTTStrategy(NTTStrategy factor2Strategy, Factor3NTTStepStrategy stepStrategy)
    Creates a new factor-3 transform strategy on top of an existing factor-2 transform and a factor-3 step strategy.
    Parameters:
      `factor2Strategy` - The underlying transformation strategy, that can be capable of only doing radix-2 transforms.
      `stepStrategy` - The factor-3 step strategy.

- ## Method Details

  - ### 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.