LU Decomposition-powered Functions

This module contains algebraic functions powered by the LU matrix decomposition (as provided by the <Eigen/LU> include), most notably matrix inverse and determinant.

ceygen.lu.inv(x[, out=None])

Return matrix inverse computed using LU decomposition with partial pivoting. It is your responsibility to ensure that x is invertible, otherwise you get undefined result without any warning.

Parameters:
  • x (nonint_dtype[:, :]) – matrix to invert
  • out (nonint_dtype[:, :]) – memory view to write the result to. Specifying this optional argument means that Ceygen doesn’t have to allocate memory for the result (allocating memory involves acquiring the GIL and calling many expensive Python functions). Once specified, it must must have correct dimensions to store the result of this operation (otherwise you get ValueError); the same out instance will be also returned. Warning: don’t repeat x (or y) here, it would give incorrect result without any error. Perhaps there’s an in-place variant instead?
Raises :

ValueError if argument dimensions aren’t appropriate for this operation or if arguments are otherwise invalid.

Raises :

TypeError if you pass an argument that doesn’t support buffer interface (e.g. a plain list). Use preferrably a Cython memoryview and resort to Python array, Cython array or a NumPy array.

Return type:

nonint_dtype[:, :]

ceygen.lu.iinv(x[, out=None])

Compte matrix inverse using LU decomposition with partial pivoting in-place. Equivalent to x = inv(x), but without overhead. It is your responsibility to ensure that x is invertible, otherwise you get undefined result without any warning.

Parameters:x (nonint_dtype[:, :]) – matrix to invert in-place
Raises :ValueError if argument dimensions aren’t appropriate for this operation or if arguments are otherwise invalid.
Raises :TypeError if you pass an argument that doesn’t support buffer interface (e.g. a plain list). Use preferrably a Cython memoryview and resort to Python array, Cython array or a NumPy array.
Returns:Always True to allow fast exception propagation.
ceygen.lu.det(x)

Compute determinant of a square matrix x using LU decomposition.

Parameters:x (dtype[:, :]) – matrix whose determimant to compute
Raises :ValueError if argument dimensions aren’t appropriate for this operation or if arguments are otherwise invalid.
Raises :TypeError if you pass an argument that doesn’t support buffer interface (e.g. a plain list). Use preferrably a Cython memoryview and resort to Python array, Cython array or a NumPy array.
Return type:dtype

Previous topic

Element-wise Operations

Next topic

Cholesky Decomposition-powered Functions

This Page