Open Beliavsky opened 3 years ago
Sounds like something that could be done via LAPACK's ?potrf
functionality. Not sure if we really want to implement such functionality ourselves and try to compete with optimized implementations like MKL.
Actually, matrix determinant is something we likely have to implement ourselves on top of the factorizations from LAPACK (product of the factors in the diagonal). See e.g. the code used in numpy: https://github.com/numpy/numpy/blob/fb215c76967739268de71aa4bda55dd1b062bc2e/numpy/linalg/umath_linalg.c.src#L1036
Unfortunately, convenience linear algebra wrappers are kind of a daunting area for many reasons:
It would be convenient for stdlib to have a function for computing the determinant of a square matrix. The cases of symmetric positive definite (SPD) (use Cholesky decomposition) and a general matrix should be handled separately. Here is code for the SPD case. I have not included the choldc code from Numerical Recipes, but there are public domain routines for it.