API Documentation Generated by Endo, 2006-08-14
eps = numpy.finfo(float).eps.item()
feps = numpy.finfo(single).eps.item()
cho_solve((c, lower), b, overwrite_b=0) -> x
Solve a system of equations given a previously cholesky factored matrix
Inputs:
(c,lower) -- The factored matrix, a (the output of cho_factor) b -- a set of right-hand sides
Outputs:
x -- the solution to the system a*x = b
det(a, overwrite_a=0) -> d
Return determinant of a square matrix.
Construct a hankel matrix (i.e. matrix with constant anti-diagonals).
Description:
hankel(c,r) is a Hankel matrix whose first column is c and whose last row is r.
hankel(c) is a square Hankel matrix whose first column is C. Elements below the first anti-diagonal are zero.
See also: toeplitz
inv(a, overwrite_a=0) -> a_inv
Return inverse of square matrix a.
kronecker product of a and b Kronecker product of two matrices is block matrix [[ a[ 0 ,0]*b, a[ 0 ,1]*b, ... , a[ 0 ,n-1]*b ], [ ... ... ], [ a[m-1,0]*b, a[m-1,1]*b, ... , a[m-1,n-1]*b ]]
lstsq(a, b, cond=None, overwrite_a=0, overwrite_b=0) -> x,resids,rank,s
Return least-squares solution of a * x = b.
Inputs:
a -- An M x N matrix.
b -- An M x nrhs matrix or M vector.
cond -- Used to determine effective rank of a.
Outputs:
x -- The solution (N x nrhs matrix) to the minimization problem:
2-norm(| b - a * x |) -> min
resids -- The residual sum-of-squares for the solution matrix x
(only if M>N and rank==N).
rank -- The effective rank of a.
s -- Singular values of a in decreasing order. The condition number
of a is abs(s[0]/s[-1]).
lu_solve((lu, piv), b, trans=0, overwrite_b=0) -> x
Solve a system of equations given a previously factored matrix
Inputs:
(lu,piv) -- The factored matrix, a (the output of lu_factor)
b -- a set of right-hand sides
trans -- type of system to solve:
0 : a * x = b (no transpose)
1 : a^T * x = b (transpose)
2 a^H * x = b (conjugate transpose)
Outputs:
x -- the solution to the system
norm(x, ord=None) -> n
Matrix or vector norm.
Inputs:
x -- a rank-1 (vector) or rank-2 (matrix) array ord -- the order of the norm.
- Comments:
- For arrays of any rank, if ord is None:
- calculate the square norm (Euclidean norm for vectors, Frobenius norm for matrices)
- For vectors ord can be any real number including Inf or -Inf.
- ord = Inf, computes the maximum of the magnitudes ord = -Inf, computes minimum of the magnitudes ord is finite, computes sum(abs(x)**ord)**(1.0/ord)
- For matrices ord can only be one of the following values:
- ord = 2 computes the largest singular value ord = -2 computes the smallest singular value ord = 1 computes the largest column sum of absolute values ord = -1 computes the smallest column sum of absolute values ord = Inf computes the largest row sum of absolute values ord = -Inf computes the smallest row sum of absolute values ord = 'fro' computes the frobenius norm sqrt(sum(diag(X.H * X)))
For values ord < 0, the result is, strictly speaking, not a mathematical 'norm', but it may still be useful for numerical purposes.
pinv(a, cond=None) -> a_pinv
Compute generalized inverse of A using least-squares solver.
pinv2(a, cond=None) -> a_pinv
Compute the generalized inverse of A using svd.
solve(a, b, sym_pos=0, lower=0, overwrite_a=0, overwrite_b=0) -> x
Solve a linear system of equations a * x = b for x.
Inputs:
a -- An N x N matrix.
b -- An N x nrhs matrix or N vector.
sym_pos -- Assume a is symmetric and positive definite.
lower -- Assume a is lower triangular, otherwise upper one.
Only used if sym_pos is true.
overwrite_y - Discard data in y, where y is a or b.
Outputs:
x -- The solution to the system a * x = b
solve_banded((l,u), ab, b, overwrite_ab=0, overwrite_b=0) -> x Solve a linear system of equations a * x = b for x where a is a banded matrix stored in diagonal orded form * * a1u * a12 a23 ... a11 a22 a33 ... a21 a32 a43 ... . al1 .. * Inputs: (l,u) -- number of non-zero lower and upper diagonals, respectively. a -- An N x (l+u+1) matrix. b -- An N x nrhs matrix or N vector. overwrite_y - Discard data in y, where y is ab or b. Outputs: x -- The solution to the system a * x = b
Construct a toeplitz matrix (i.e. a matrix with constant diagonals).
Description:
toeplitz(c,r) is a non-symmetric Toeplitz matrix with c as its first column and r as its first row.
toeplitz(c) is a symmetric (Hermitian) Toeplitz matrix (r=c).
See also: hankel
returns a N-by-M matrix where all the diagonals starting from lower left corner up to the k-th are all ones.
returns the elements on and below the k-th diagonal of m. k=0 is the main diagonal, k > 0 is above and k < 0 is below the main diagonal.
returns the elements on and above the k-th diagonal of m. k=0 is the main diagonal, k > 0 is above and k < 0 is below the main diagonal.
| Local name | Refers to |
|---|---|
| add | numpy.add |
| arange | numpy.arange |
| asarray | numpy.asarray |
| asarray_chkfinite | numpy.asarray_chkfinite |
| calc_lwork | calc_lwork |
| concatenate | numpy.concatenate |
| conjugate | numpy.conjugate |
| decomp | scipy.linalg.decomp |
| dot | numpy.dot |
| get_flinalg_funcs | scipy.linalg.flinalg.get_flinalg_funcs |
| get_lapack_funcs | scipy.linalg.lapack.get_lapack_funcs |
| greater_equal | numpy.greater_equal |
| Matrix | numpy.matrix |
| mgrid | numpy.mgrid |
| newaxis | numpy.newaxis |
| numpy | numpy |
| ones | numpy.ones |
| outer | numpy.outer |
| ravel | numpy.ravel |
| real | numpy.real |
| reshape | numpy.reshape |
| r_ | numpy.r_ |
| single | numpy.single |
| sqrt | numpy.sqrt |
| subtract | numpy.subtract |
| sum | numpy.sum |
| take | numpy.take |
| transpose | numpy.transpose |
| zeros | numpy.zeros |