@[extern lean_mk_empty_float_array]
Equations
- FloatArray.mkEmpty c = { data := #[] }
Equations
- FloatArray.instInhabitedFloatArray = { default := FloatArray.empty }
Equations
- FloatArray.instEmptyCollectionFloatArray = { emptyCollection := FloatArray.empty }
@[extern lean_float_array_push]
Equations
- FloatArray.push _fun_discr _fun_discr = match _fun_discr, _fun_discr with | { data := ds }, b => { data := Array.push ds b }
@[extern lean_float_array_size]
Equations
- FloatArray.size _fun_discr = match _fun_discr with | { data := ds } => Array.size ds
@[extern lean_float_array_uget]
Equations
- FloatArray.uget _fun_discr _fun_discr _fun_discr = match _fun_discr, _fun_discr, _fun_discr with | { data := ds }, i, h => Array.uget ds i h
@[extern lean_float_array_fget]
Equations
- FloatArray.get _fun_discr _fun_discr = match _fun_discr, _fun_discr with | { data := ds }, i => Array.get ds i
@[extern lean_float_array_get]
Equations
- FloatArray.get! _fun_discr _fun_discr = match _fun_discr, _fun_discr with | { data := ds }, i => Array.get! ds i
Equations
- FloatArray.get? ds i = if h : i < FloatArray.size ds then some (FloatArray.get ds { val := i, isLt := h }) else none
@[inline]
Equations
- FloatArray.getOp self idx = FloatArray.get! self idx
@[extern lean_float_array_uset]
def
FloatArray.uset
(a : FloatArray)
(i : USize)
:
(a : Float) → USize.toNat i < FloatArray.size a → FloatArray
Equations
- FloatArray.uset _fun_discr _fun_discr _fun_discr _fun_discr = match _fun_discr, _fun_discr, _fun_discr, _fun_discr with | { data := ds }, i, v, h => { data := Array.uset ds i v h }
@[extern lean_float_array_fset]
Equations
- FloatArray.set _fun_discr _fun_discr _fun_discr = match _fun_discr, _fun_discr, _fun_discr with | { data := ds }, i, d => { data := Array.set ds i d }
@[extern lean_float_array_set]
Equations
- FloatArray.set! _fun_discr _fun_discr _fun_discr = match _fun_discr, _fun_discr, _fun_discr with | { data := ds }, i, d => { data := Array.set! ds i d }
Equations
- FloatArray.isEmpty s = (FloatArray.size s == 0)
Equations
- FloatArray.toList ds = FloatArray.toList.loop ds 0 []
@[inline]
unsafe def
FloatArray.forInUnsafe
{β : Type v}
{m : Type v → Type w}
[inst : Monad m]
(as : FloatArray)
(b : β)
(f : Float → β → m (ForInStep β))
:
m β
Equations
- FloatArray.forInUnsafe as b f = let sz := USize.ofNat (FloatArray.size as); FloatArray.forInUnsafe.loop as f sz 0 b
@[specialize]
unsafe def
FloatArray.forInUnsafe.loop
{β : Type v}
{m : Type v → Type w}
[inst : Monad m]
(as : FloatArray)
(f : Float → β → m (ForInStep β))
(sz : USize)
(i : USize)
(b : β)
:
m β
Equations
- One or more equations did not get rendered due to their size.
@[implementedBy FloatArray.forInUnsafe]
def
FloatArray.forIn
{β : Type v}
{m : Type v → Type w}
[inst : Monad m]
(as : FloatArray)
(b : β)
(f : Float → β → m (ForInStep β))
:
m β
Equations
- FloatArray.forIn as b f = FloatArray.forIn.loop as f (FloatArray.size as) (_ : FloatArray.size as ≤ FloatArray.size as) b
def
FloatArray.forIn.loop
{β : Type v}
{m : Type v → Type w}
[inst : Monad m]
(as : FloatArray)
(f : Float → β → m (ForInStep β))
(i : Nat)
(h : i ≤ FloatArray.size as)
(b : β)
:
m β
Equations
- One or more equations did not get rendered due to their size.
- FloatArray.forIn.loop as f 0 x b = pure b
@[inline]
unsafe def
FloatArray.foldlMUnsafe
{β : Type v}
{m : Type v → Type w}
[inst : Monad m]
(f : β → Float → m β)
(init : β)
(as : FloatArray)
(start : optParam Nat 0)
(stop : optParam Nat (FloatArray.size as))
:
m β
Equations
- One or more equations did not get rendered due to their size.
@[specialize]
unsafe def
FloatArray.foldlMUnsafe.fold
{β : Type v}
{m : Type v → Type w}
[inst : Monad m]
(f : β → Float → m β)
(as : FloatArray)
(i : USize)
(stop : USize)
(b : β)
:
m β
Equations
- One or more equations did not get rendered due to their size.
@[implementedBy FloatArray.foldlMUnsafe]
def
FloatArray.foldlM
{β : Type v}
{m : Type v → Type w}
[inst : Monad m]
(f : β → Float → m β)
(init : β)
(as : FloatArray)
(start : optParam Nat 0)
(stop : optParam Nat (FloatArray.size as))
:
m β
Equations
- One or more equations did not get rendered due to their size.
def
FloatArray.foldlM.loop
{β : Type v}
{m : Type v → Type w}
[inst : Monad m]
(f : β → Float → m β)
(as : FloatArray)
(stop : Nat)
(h : stop ≤ FloatArray.size as)
(i : Nat)
(j : Nat)
(b : β)
:
m β
Equations
- One or more equations did not get rendered due to their size.
@[inline]
def
FloatArray.foldl
{β : Type v}
(f : β → Float → β)
(init : β)
(as : FloatArray)
(start : optParam Nat 0)
(stop : optParam Nat (FloatArray.size as))
:
β
Equations
- FloatArray.foldl f init as start stop = Id.run (FloatArray.foldlM f init as start stop)
Equations
Equations
- List.toFloatArray.loop [] _fun_discr = _fun_discr
- List.toFloatArray.loop (b :: ds) _fun_discr = List.toFloatArray.loop ds (FloatArray.push _fun_discr b)
Equations
- instToStringFloatArray = { toString := fun ds => List.toString (FloatArray.toList ds) }