Module scid.linalg

This module contains functions related to linear algebra.

For the time being these functions are just a user-friendly interface to the corresponding LAPACK functions. Hence, one can only use matrices and vectors where the elements are of FORTRAN-compatible types, namely:

float
double
Complex!float
Complex!double

Specifically, real- and creal-valued matrices/vectors cannot be used.

Note

Some of the functions in this module come in two forms with the same function signature, but where the name of one ends with an underscore. An example is

solve(a, b)
solve_(a, b)

The difference between these is that, for performance reasons, the underscore-suffixed functions use some or all of the input matrices/vectors as a workspace, and one can't expect them to contain the same values after the function returns. The functions without an underscore suffix simply copy the input data and calls the high-performance function using the copied data as input.

Functions

NameDescription
det(m)Calculate the determinant of a square matrix.
det_(m)Calculate the determinant of a square matrix.
eigenvalues(m)Calculate the eigenvalues of a general dense square matrix.
eigenvalues(m, buffer)Calculate the eigenvalues of a triangular matrix. Note that this is a trivial operation - the function just returns the diagonal entries of the matrix.
eigenvalues(m, buffer)Calculate the eigenvalues of a symmetric matrix.
eigenvalues_(m)Calculate the eigenvalues of a general dense square matrix.
eigenvalues_(m, buffer)Calculate the eigenvalues of a symmetric matrix.
invert(m)Calculate the inverse of a matrix.
solve(a, b, buffer)Solve one or more systems of n linear equations in n variables.
solve_(a, b)Solve one or more systems of n linear equations in n variables.

Classes

NameDescription
EigenvalueExceptionThis exception is thrown when the eigenvalue() function fails to compute all eigenvalues. The ones that have been computed are stored in the member variable eigenvalues.

Templates

NameDescription
EigenvalueType