Documentation

Init.Data.FloatArray.Basic

structure FloatArray :
Instances For
    @[instance_reducible]
    theorem FloatArray.ext {x y : FloatArray} (data : x.data = y.data) :
    x = y
    @[extern lean_mk_empty_float_array]
    Instances For
      @[instance_reducible]
      @[extern lean_float_array_push]
      Instances For
        @[extern lean_float_array_size]
        Instances For
          @[extern lean_sarray_size]
          Instances For
            @[extern lean_float_array_uget]
            def FloatArray.uget (a : FloatArray) (i : USize) :
            i.toNat < a.size → Float
            Instances For
              @[extern lean_float_array_fget]
              def FloatArray.get (ds : FloatArray) (i : Nat) (h : i < ds.size := by get_elem_tactic) :
              Instances For
                @[extern lean_float_array_get]
                Instances For
                  Instances For
                    @[instance_reducible]
                    @[extern lean_float_array_uset]
                    Instances For
                      @[extern lean_float_array_fset]
                      def FloatArray.set (ds : FloatArray) (i : Nat) :
                      Instances For
                        @[extern lean_float_array_set]
                        Instances For
                          @[never_extract, extern lean_sarray_mark_linear]

                          Marks a float array as linear, which is a no-op logically.

                          At runtime the array is first made unique, copying it if the reference is not already unique, and then marked. If the environment variable LEAN_ABORT_ON_NONLINEAR is set, every non-linear use from that point on causes a panic instead of a silent copy.

                          To debug where the non-linearity is coming from you can set a breakpoint on lean_internal_panic.

                          Instances For
                            @[never_extract, extern lean_sarray_propagate_mark]

                            Returns es, propagating the linearity marker of ds onto it. This is a no-op logically.

                            See also FloatArray.markLinear.

                            Instances For
                              @[simp]
                              Instances For
                                Instances For
                                  @[inline]
                                  unsafe def FloatArray.forInUnsafe {β : Type v} {m : Type v → Type w} [Monad m] (as : FloatArray) (b : β) (f : Float → β → m (ForInStep β)) :
                                  m β

                                  We claim this unsafe implementation is correct because an array cannot have more than usizeSz elements in our runtime. This is similar to the Array version.

                                  Instances For
                                    @[implemented_by FloatArray.forInUnsafe]
                                    def FloatArray.forIn {β : Type v} {m : Type v → Type w} [Monad m] (as : FloatArray) (b : β) (f : Float → β → m (ForInStep β)) :
                                    m β

                                    Reference implementation for forIn

                                    Instances For
                                      @[instance_reducible]
                                      @[inline]
                                      unsafe def FloatArray.foldlMUnsafe {β : Type v} {m : Type v → Type w} [Monad m] (f : β → Float → m β) (init : β) (as : FloatArray) (start : Nat := 0) (stop : Nat := as.size) :
                                      m β

                                      See comment at forInUnsafe

                                      Instances For
                                        @[implemented_by FloatArray.foldlMUnsafe]
                                        def FloatArray.foldlM {β : Type v} {m : Type v → Type w} [Monad m] (f : β → Float → m β) (init : β) (as : FloatArray) (start : Nat := 0) (stop : Nat := as.size) :
                                        m β

                                        Reference implementation for foldlM

                                        Instances For
                                          @[inline]
                                          def FloatArray.foldl {β : Type v} (f : β → Float → β) (init : β) (as : FloatArray) (start : Nat := 0) (stop : Nat := as.size) :
                                          β
                                          Instances For

                                            Converts a list of floats into a FloatArray.

                                            Instances For
                                              @[instance_reducible]