def Vec.axpy
import bend-blas-lapack@0.0.0.1/mat.bend as Matimport Base
import bend-blas-lapack@0.0.0.1/blas.bend as B
226# y = alpha x + y
227def Vec.axpy(+n: Nat, alpha: F32, x: Vec<n>, y: Vec<n>) -> IO(Result<&1, &1, U32 & String, Vec<n>>):
228 VecA{xs} = x
229 VecA{ys} = y
230 IO.bind(Result<&1, &1, U32 & String, Array<F32>>, Result<&1, &1, U32 & String, Vec<n>>, B.Blas.saxpy(U32.from_nat(n), alpha, xs, ys), r => Vec.wrap(n, r))