Mat.Mat.solve: def of bend-blas-lapack@0.0.0.1 Import: import bend-blas-lapack@0.0.0.1/mat.bend as Mat Lines 245-249 of bend-blas-lapack@0.0.0.1/mat.bend: https://jend.leeeet.dev/read.txt?path=bend-blas-lapack@0.0.0.1/mat.bend&start_line=245&end_line=249 import Base import bend-blas-lapack@0.0.0.1/lapack.bend as L # X = A^-1 B; Fail with the zero pivot as the code when A is singular def Mat.solve(+n: Nat, +nrhs: Nat, a: Mat, b: Mat) -> IO(Result<&1, &1, U32 & String, Mat>): MatA{x} = a MatA{y} = b IO.bind(Result<&1, &1, U32 & String, Array>, Result<&1, &1, U32 & String, Mat>, L.Lapack.sgesv(U32.from_nat(n), U32.from_nat(nrhs), x, y), r => Mat.wrap(n, nrhs, r)) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=bend-blas-lapack@0.0.0.1/lapack.bend&name=Lapack.sgesv https://jend.leeeet.dev/definition.txt?path=bend-blas-lapack@0.0.0.1/mat.bend&name=Mat https://jend.leeeet.dev/definition.txt?path=bend-blas-lapack@0.0.0.1/mat.bend&name=Mat.wrap