NLA-lib Explorer

NLAlib.Ops.stmtCost_scalarPower

Library · theorem

The scalar syntax performs one literal call and exactly n multiplication calls.

NLAlib.Ops.stmtCost_scalarPower {Op Tst : Type} [Ops.Has Ops.ScalarOp Op] (n x z : ℕ) :
  Ops.stmtCost Ops.scalarPower [n, x, z] =
    Ops.Count.one (Ops.Has.inj (Ops.ScalarOp.lit 1)) [] +
      n • Ops.Count.one (Ops.Has.inj Ops.ScalarOp.mul) []

Full source on GitHub

Import NLAlib.Ops.Blas.Power.