Documentation

ScalarArray.Float32.Array

Arrays of Float32: array operations #

Removing elements, search, building arrays, iteration, equality, hashing and printing.

Removing elements #

Whether a has no elements.

Instances For
    @[implemented_by _private.ScalarArray.Float32.Array.0.ScalarArray.Float32Array.popImpl]

    Removes the last element of a, if any, in place when a is not shared.

    Instances For
      @[inline]

      The last element of a, or none if a is empty.

      Instances For
        @[inline]

        The last element of a. Panics if a is empty, and then returns default.

        Instances For
          @[inline]

          The last element of a, which is not empty.

          Instances For
            @[implemented_by _private.ScalarArray.Float32.Array.0.ScalarArray.Float32Array.popWhileImpl]

            Removes the longest run of elements at the end of a that satisfy p, in place when a is not shared.

            Instances For
              @[implemented_by _private.ScalarArray.Float32.Array.0.ScalarArray.Float32Array.extractImpl]

              The elements of a from index start up to, but not including, min stop a.size, copied into a new array.

              Instances For

                Linearity #

                @[never_extract, extern lean_sarray_mark_linear]

                Marks a as linear, a debugging aid: if a marked array is ever copied because it is shared when it needs to be exclusive, as before an in-place write, the runtime panics. The mark goes on an exclusive array, so if a is shared it is copied first and the copy is marked. Logically this is the identity.

                Instances For
                  @[never_extract, extern lean_sarray_propagate_mark]

                  Returns b, marked as linear if a is marked. Like markLinear, marking copies b first if it is shared. Logically this is b.

                  Instances For
                    @[inline]

                    The index of the first element at or after start that satisfies p, with a proof that it is in bounds.

                    Instances For
                      @[inline]

                      The index of the first element at or after start that satisfies p.

                      Instances For

                        Building arrays #

                        @[implemented_by _private.ScalarArray.Float32.Array.0.ScalarArray.Float32Array.replicateImpl]

                        An array of n copies of v.

                        Instances For
                          @[implemented_by _private.ScalarArray.Float32.Array.0.ScalarArray.Float32Array.ofFnImpl]

                          The array #[f 0, …, f (n - 1)].

                          Instances For

                            The array with the elements of l.

                            Instances For

                              For internal use only.

                              Instances For

                                Iteration #

                                def ScalarArray.Float32Array.foldlM {β : Type v} {m : Type v → Type w} [Monad m] (f : β → Float32 → m β) (init : β) (a : Float32Array) (start : Nat := 0) (stop : Nat := a.size) :
                                m β

                                Folds a monadic function over the elements of a from index start up to, but not including, stop, from first to last.

                                Instances For
                                  @[inline]
                                  def ScalarArray.Float32Array.foldlMImpl {β : Type v} {m : Type v → Type w} [Monad m] (f : β → Float32 → m β) (init : β) (a : Float32Array) (start : Nat := 0) (stop : Nat := a.size) :
                                  m β

                                  For internal use only.

                                  Instances For
                                    def ScalarArray.Float32Array.foldrM {β : Type v} {m : Type v → Type w} [Monad m] (f : Float32 → β → m β) (init : β) (a : Float32Array) :
                                    m β

                                    Folds a monadic function over the elements of a, from last to first.

                                    Instances For
                                      @[inline]
                                      def ScalarArray.Float32Array.foldrMImpl {β : Type v} {m : Type v → Type w} [Monad m] (f : Float32 → β → m β) (init : β) (a : Float32Array) :
                                      m β

                                      For internal use only.

                                      Instances For
                                        @[inline]
                                        def ScalarArray.Float32Array.foldl {β : Type v} (f : β → Float32 → β) (init : β) (a : Float32Array) (start : Nat := 0) (stop : Nat := a.size) :
                                        β

                                        Folds a function over the elements of a from index start up to, but not including, stop, from first to last.

                                        Instances For
                                          @[inline]
                                          def ScalarArray.Float32Array.foldr {β : Type v} (f : Float32 → β → β) (init : β) (a : Float32Array) :
                                          β

                                          Folds a function over the elements of a, from last to first.

                                          Instances For
                                            @[inline]
                                            def ScalarArray.Float32Array.forM {m : Type v → Type w} [Monad m] (f : Float32 → m PUnit) (a : Float32Array) :

                                            Runs a monadic action on each element of a, from first to last.

                                            Instances For
                                              def ScalarArray.Float32Array.forIn {β : Type v} {m : Type v → Type w} [Monad m] (a : Float32Array) (init : β) (f : Float32 → β → m (ForInStep β)) :
                                              m β

                                              The loop behind for x in a. Logically it is the loop over a.toArray.

                                              Instances For
                                                @[inline]
                                                def ScalarArray.Float32Array.forInImpl {β : Type v} {m : Type v → Type w} [Monad m] (a : Float32Array) (init : β) (f : Float32 → β → m (ForInStep β)) :
                                                m β

                                                For internal use only.

                                                Instances For
                                                  @[instance_reducible]
                                                  @[instance_reducible]

                                                  Whether some element of a satisfies p.

                                                  Instances For
                                                    @[inline]

                                                    For internal use only.

                                                    Instances For

                                                      Whether every element of a satisfies p.

                                                      Instances For
                                                        @[inline]

                                                        For internal use only.

                                                        Instances For

                                                          Whether some element of a is == to v.

                                                          Instances For

                                                            For internal use only.

                                                            Instances For
                                                              @[instance_reducible]

                                                              x ∈ a when x is an element of a.

                                                              Equality #

                                                              Compares the elements with ==, like Array. Floating-point equality is not decidable equality: NaN is not equal to itself and 0.0 == -0.0.

                                                              Instances For

                                                                For internal use only.

                                                                Instances For

                                                                  Conversion and printing #

                                                                  The elements of a as a list.

                                                                  Instances For
                                                                    @[instance_reducible]

                                                                    Prints ScalarArray.Float32Array.mk #[...], which evaluates to an equal array.

                                                                    @[inline]

                                                                    The array with the elements of l.

                                                                    Instances For