Routines which calculate the inverse of a matrix. The inverse is very often the worst way to do a calculation. Nevertheless it is often convenient. The present implementation uses LU decomposition implemented by LAPACK. The determinate can be calculated "for free" as it is the product of the diagonal terms after decomposition. If the input matrix is singular, a matrix with no rows or columns is returned. in must be a square matrix.
This function will only work for complex types if Complex and DComplex map onto their FORTRAN counterparts.
This function inverts a symmetric positive definite matrix. It is written in C++, so it should work with any data type for which operators +, -, *, /, =, and sqrt are defined. The function uses the Cholesky decomposition method to invert the matrix. Cholesky decomposition is about a factor of 2 better than LU decomposition where symmetry is ignored.