This module contains useful algorithms such as matrix decompositions, computing matrix norms and solutions to linear equations.
This function returns the Frobenius norm of the input A, which is defined as sqrt(sum A_ij^2).
Parameters: |
|
---|---|
Returns: | The Frobenius norm of A. |
Compute the randomised SVD using the algorithm on page 9 of Halko et al., Finding Structure with randomness: stochastic algorithms for constructing approximate matrix decompositions, 2009.
Finds the partial SVD of a sparse or dense matrix A, resolving the largest k singular vectors/values, using exponent q and k+p projections. Returns the left and right singular vectors, and the singular values. The resulting matrix can be approximated using A ~ U s V.T. To improve the approximation quality for a fixed k, increase p or q.
Parameters: |
|
---|---|
Return U: | The left singular vectors |
Return s: | The singular values |
Return V: | The right singular vectors |
Solve the linear system of equations given by A x = b where A is a csarray and b is a numpy array of the same dtype. Uses the Iterative stabilized bi-conjugate gradient method.
Parameters: |
|
---|---|
Return x: | A numpy array corresponding to the solution vector. |
Return i: | The output code: 0 = success, 1 = numerical Issue, 2 = no convergence, 3 = invalid input |