Documentation

HexMatrix.Packed

dotNat as recursive equations, the compiled implementation.

Equations
Instances For
    noncomputable def Hex.Matrix.Packed.dotNat :
    List Nat → List Nat → Nat

    The dot product of two natural-number lists, stopping at the shorter. List.rec is applied directly instead of recursive equations elaborated through List.brecOn, whose below tuple the kernel would build and project at every term; noncomputable only suppresses compilation, and dotNat_eq_impl gives the compiler the equation form.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[simp]
      theorem Hex.Matrix.Packed.dotNat_cons_nil (a : Nat) (as : List Nat) :
      dotNat (a :: as) [] = 0
      @[simp]
      theorem Hex.Matrix.Packed.dotNat_cons_cons (a b : Nat) (as bs : List Nat) :
      dotNat (a :: as) (b :: bs) = (a.mul b).add (dotNat as bs)

      A row packed into one number with W-bit slots: Σ aₖ · 2^(W·k).

      Equations
      Instances For

        Horner accumulation of k more slots from the front of a list, missing entries read as 0: after k steps from acc, the entries consumed sit in reverse order below acc.

        Equations
        Instances For

          A column of vt cut or zero-padded to r entries and packed in reverse order, in r steps.

          Equations
          Instances For

            Slot r − 1 of p: bits W·(r − 1), …, W·r − 1.

            Equations
            Instances For

              The dot product of a packed row and a reverse-packed column of r entries.

              Equations
              Instances For

                dotInt as recursive equations, the compiled implementation.

                Equations
                Instances For
                  noncomputable def Hex.Matrix.Packed.dotInt :
                  List Int → List Int → Int

                  The dot product of two integer lists, stopping at the shorter; List.rec applied directly, as dotNat.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    @[simp]
                    theorem Hex.Matrix.Packed.dotInt_cons_nil (a : Int) (as : List Int) :
                    dotInt (a :: as) [] = 0
                    @[simp]
                    theorem Hex.Matrix.Packed.dotInt_cons_cons (a b : Int) (as bs : List Int) :
                    dotInt (a :: as) (b :: bs) = (a.mul b).add (dotInt as bs)

                    Column j of a row list: the specification of columns, not on the kernel path.

                    Equations
                    Instances For

                      A row prepended entrywise to a list of columns: entry j of the row goes on top of column j; a short row contributes 0s, and entries past the last column are dropped.

                      Equations
                      Instances For

                        The m columns of a row list, built in one pass over the rows: n · m list steps, against the n · m indexed reads of O(index) each that column would cost.

                        Equations
                        Instances For

                          The nonnegative parts of a signed row.

                          Equations
                          Instances For

                            The nonpositive parts of a signed row, negated.

                            Equations
                            Instances For

                              Every entry has absolute value below k.

                              Equations
                              Instances For

                                Every entry of every row has absolute value below k.

                                Equations
                                Instances For

                                  A list cut or zero-padded to r entries and packed in order.

                                  Equations
                                  Instances For

                                    A signed row cut or zero-padded to r entries, packed as its two parts.

                                    Equations
                                    Instances For

                                      A signed column cut or zero-padded to r entries, reverse-packed as its two parts.

                                      Equations
                                      Instances For

                                        (t⁺ − t⁻) · (c⁺ − c⁻) from the packed parts: four packed dot products.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For