Documentation

CompPoly.Univariate.NTTFast.Plan

Planned NTTFast multiplication #

This file adds a reusable NTTFast plan that caches domain-derived data for repeated NTT-based multiplication.

structure CompPoly.CPolynomial.NTTFast.Plan (R : Type u_2) [Field R] :
Type u_2

Cached domain data for repeated NTTFast multiplications.

Instances For

    Precompute the twiddle powers used by one radix-2 stage.

    Instances For

      Precompute the per-stage twiddle table for a domain.

      Instances For

        Build a reusable plan from an NTT domain.

        Instances For
          @[irreducible]
          def CompPoly.CPolynomial.NTTFast.Plan.butterflyDITInner {R : Type u_1} [Field R] (twiddles : Array R) (limit j i0 i1 : ) (acc : Array R) :

          Inner DIT butterfly loop for one block.

          Instances For
            @[irreducible]
            def CompPoly.CPolynomial.NTTFast.Plan.butterflyDITBlocks {R : Type u_1} [Field R] (twiddles : Array R) (blockSize half blocks block : ) (acc : Array R) :

            Outer DIT butterfly loop over blocks.

            Instances For
              def CompPoly.CPolynomial.NTTFast.Plan.butterflyStageWithTwiddles {R : Type u_1} [Field R] (D : NTT.Domain R) (stage : ) (twiddles a : Array R) :

              One butterfly stage using precomputed twiddle powers for that stage.

              Instances For

                Run all radix-2 stages using a precomputed per-stage twiddle table.

                Instances For
                  @[irreducible]
                  def CompPoly.CPolynomial.NTTFast.Plan.butterflyDITRadix4Inner {R : Type u_1} [Field R] (twiddlesLow twiddlesHigh : Array R) (limit j i0 i1 i2 i3 : ) (acc : Array R) :

                  Inner fused DIT loop for two adjacent radix-2 stages.

                  Instances For
                    @[irreducible]
                    def CompPoly.CPolynomial.NTTFast.Plan.butterflyDITRadix4Blocks {R : Type u_1} [Field R] (twiddlesLow twiddlesHigh : Array R) (blockSize quarter blocks block : ) (acc : Array R) :

                    Outer fused DIT loop over radix-4 blocks.

                    Instances For
                      def CompPoly.CPolynomial.NTTFast.Plan.butterflyRadix4StageWithTwiddles {R : Type u_1} [Field R] (D : NTT.Domain R) (lowStage : ) (twiddlesLow twiddlesHigh a : Array R) :

                      Run two adjacent DIT radix-2 stages as one radix-4 pass.

                      Instances For

                        Run DIT stages using fused radix-4 passes where possible.

                        Instances For
                          @[irreducible]
                          def CompPoly.CPolynomial.NTTFast.Plan.butterflyDIFInner {R : Type u_1} [Field R] (twiddles : Array R) (limit j i0 i1 : ) (acc : Array R) :

                          Inner DIF butterfly loop for one block.

                          Instances For
                            @[irreducible]
                            def CompPoly.CPolynomial.NTTFast.Plan.butterflyDIFBlocks {R : Type u_1} [Field R] (twiddles : Array R) (blockSize half blocks block : ) (acc : Array R) :

                            Outer DIF butterfly loop over blocks.

                            Instances For

                              One decimation-in-frequency butterfly stage using precomputed twiddle powers.

                              This accepts natural-order data and, when run from large stages down to small stages, produces bit-reversed evaluation order.

                              Instances For

                                Run decimation-in-frequency stages, producing bit-reversed evaluation order.

                                Instances For
                                  @[irreducible]
                                  def CompPoly.CPolynomial.NTTFast.Plan.butterflyDIFPairInner {R : Type u_1} [Field R] (twiddles : Array R) (limit j i0 i1 : ) (accA accB : Array R) :

                                  Inner paired DIF butterfly loop for one block.

                                  Instances For
                                    @[irreducible]
                                    def CompPoly.CPolynomial.NTTFast.Plan.butterflyDIFPairBlocks {R : Type u_1} [Field R] (twiddles : Array R) (blockSize half blocks block : ) (accA accB : Array R) :

                                    Outer paired DIF butterfly loop over blocks.

                                    Instances For

                                      One paired DIF butterfly stage using precomputed twiddle powers.

                                      Instances For
                                        @[irreducible]
                                        def CompPoly.CPolynomial.NTTFast.Plan.butterflyDIFRadix4Inner {R : Type u_1} [Field R] (twiddlesHigh twiddlesLow : Array R) (limit j i0 i1 i2 i3 : ) (acc : Array R) :

                                        Inner fused DIF loop for two adjacent radix-2 stages.

                                        Instances For
                                          @[irreducible]
                                          def CompPoly.CPolynomial.NTTFast.Plan.butterflyDIFRadix4Blocks {R : Type u_1} [Field R] (twiddlesHigh twiddlesLow : Array R) (blockSize quarter blocks block : ) (acc : Array R) :

                                          Outer fused DIF loop over radix-4 blocks.

                                          Instances For
                                            def CompPoly.CPolynomial.NTTFast.Plan.butterflyRadix4StageDIFWithTwiddles {R : Type u_1} [Field R] (D : NTT.Domain R) (lowStage : ) (twiddlesHigh twiddlesLow a : Array R) :

                                            Run two adjacent DIF radix-2 stages as one radix-4 pass.

                                            Instances For

                                              Run DIF stages using fused radix-4 passes where possible.

                                              Instances For
                                                @[irreducible]
                                                def CompPoly.CPolynomial.NTTFast.Plan.butterflyDIFRadix4PairInner {R : Type u_1} [Field R] (twiddlesHigh twiddlesLow : Array R) (limit j i0 i1 i2 i3 : ) (accA accB : Array R) :

                                                Inner paired fused DIF loop for two adjacent radix-2 stages.

                                                Instances For
                                                  @[irreducible]
                                                  def CompPoly.CPolynomial.NTTFast.Plan.butterflyDIFRadix4PairBlocks {R : Type u_1} [Field R] (twiddlesHigh twiddlesLow : Array R) (blockSize quarter blocks block : ) (accA accB : Array R) :

                                                  Outer paired fused DIF loop over radix-4 blocks.

                                                  Instances For
                                                    def CompPoly.CPolynomial.NTTFast.Plan.butterflyRadix4StageDIFPairWithTwiddles {R : Type u_1} [Field R] (D : NTT.Domain R) (lowStage : ) (twiddlesHigh twiddlesLow a b : Array R) :

                                                    Run two adjacent paired DIF radix-2 stages as one radix-4 pass.

                                                    Instances For

                                                      Run paired DIF stages using fused radix-4 passes where possible.

                                                      Instances For
                                                        @[inline]

                                                        Forward transform through a reusable plan.

                                                        Instances For
                                                          @[inline]

                                                          Forward-transform two multiplication inputs through the same stage loops.

                                                          Instances For
                                                            @[inline]

                                                            Apply the cached inverse-domain normalization factor.

                                                            Instances For
                                                              @[inline]

                                                              Inverse transform through a reusable plan.

                                                              Instances For
                                                                @[inline]
                                                                def CompPoly.CPolynomial.NTTFast.Plan.Raw.fastMulImpl {R : Type u_1} [Field R] [BEq R] (P : Plan R) (p q : Raw R) :
                                                                Raw R

                                                                Raw planned pipeline for NTT-based multiplication.

                                                                Instances For
                                                                  @[inline]

                                                                  Planned pipeline for NTT-based multiplication as a canonical polynomial.

                                                                  Instances For