All examples in this section assume that you performed a
from numarray import *
import numarray.linear_algebra as la
cholesky_decomposition(
a)
This function returns a lower triangular matrix L which, when multiplied by
its transpose yields the original matrix a; a must be
square, Hermitian, and positive definite. L is often referred to as the
Cholesky lower-triangular square-root of a.
determinant(
a)
This function returns the determinant of the square matrix a.
This function returns the generalized inverse (also known as pseudo-inverse
or Moore-Penrose-inverse) of the matrix a. It has numerous
applications related to linear equations and least-squares problems.
returns the (real positive) eigenvalues of the square, Hermitian positive
definite matrix a.
Heigenvectors(
a)
returns both the (real positive) eigenvalues and the eigenvectors of a
square, Hermitian positive definite matrix a. The eigenvectors are returned
in an (orthornormal) two-dimensional matrix.
inverse(
a)
This function returns the inverse of the specified matrix a which must be
square and non-singular. To within floating point precision, it should
always be true that matrixmultiply(a, inverse(a)) ==
identity(len(a)). To test this claim, one can do e.g.:
This function returns the least-squares solution of an overdetermined system
of linear equations. An optional third argument indicates the cutoff for the
range of singular values (defaults to ). There are four return
values: the least-squares solution itself, the sum of the squared residuals
(i.e. the quantity minimized by the solution), the rank of the matrix a,
and the singular values of a in descending order.
solve_linear_equations(
a, b)
This function solves a system of linear equations with a square non-singular
matrix a and a right-hand-side vector b. Several right-hand-side vectors can
be treated simultaneously by making b a two-dimensional array (i.e. a
sequence of vectors). The function inverse(a) calculates the inverse of the
square non-singular matrix a by calling solve_linear_equations(a, b) with a
suitable b.
singular_value_decomposition(
a, full_matrices=0)
This function returns three arrays V, S, and WT whose matrix product is the
original matrix a. V and WT are unitary matrices (rank-2 arrays), whereas S
is the vector (rank-1 array) of diagonal elements of the singular-value
matrix. This function is mainly used to check whether (and in what way) a
matrix is ill-conditioned.