You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah, I know it's not very stable. There is no LU factorization here yet, but the Schur form can be used for now (although it is more costly; the determinant will be unstable for large matrices anyway)
742c60f introduced the two functions. det can be optimized, but as remarked it only makes sense for small matrices anyway, so it not much of an issue for now
I'm too new to nim and this to make a PR, but I cobbled together a cholesky decomp. I'm not sure if I used the T right since I think that has to be float64 with the dpotrf call..
anyway here it is:
proccholesky*[T](a: Matrix[T]): Matrix[T] =var
h = a.clone()
n = a.ld.cint
info: cint
ulo: cstring
ulo ="L"dpotrf(ulo, addr n, h.fp, addr n, addr info)
if info >0:
raisenewException(LinearAlgebraError, "ERROR finding the LU decomp")
for i in0..< n:
for j in i +1..< n:
h[i, j] =0.0return h
The computation of eigenvalues can be used for the determinant, or perhaps there is a more specific LAPACK function