numpy.dual
index
/astro-wise/AWEHOME/x86_64/AWBASE/common/lib/python2.5/site-packages/numpy/dual.py

# This module should be used for functions both in numpy and scipy if
#  you want to use the numpy version if available but the scipy version
#  otherwise.
#  Usage  --- from numpy.dual import fft, inv

 
Modules
       
numpy.fft
numpy.linalg
sys

 
Functions
       
cholesky(a)
det(a)
The determinant of the 2-d array a
eig(a)
Eigenvalues and right eigenvectors of a general matrix.
 
A simple interface to the LAPACK routines dgeev and zgeev that compute the
eigenvalues and eigenvectors of general real and complex arrays
respectively.
 
:Parameters:
 
    a : 2-d array
        A complex or real 2-d array whose eigenvalues and eigenvectors
        will be computed.
 
:Returns:
 
    w : 1-d double or complex array
        The eigenvalues. The eigenvalues are not necessarily ordered, nor
        are they necessarily real for real matrices.
 
    v : 2-d double or complex double array.
        The normalized eigenvector corresponding to the eigenvalue w[i] is
        the column v[:,i].
 
:SeeAlso:
 
    - eigvalsh : eigenvalues of symmetric or Hemitiean arrays.
    - eig : eigenvalues and right eigenvectors for non-symmetric arrays
    - eigvals : eigenvalues of non-symmetric array.
 
:Notes:
-------
 
    The number w is an eigenvalue of a if there exists a vector v
    satisfying the equation dot(a,v) = w*v. Alternately, if w is a root of
    the characteristic equation det(a - w[i]*I) = 0, where det is the
    determinant and I is the identity matrix. The arrays a, w, and v
    satisfy the equation dot(a,v[i]) = w[i]*v[:,i].
 
    The array v of eigenvectors may not be of maximum rank, that is, some
    of the columns may be dependent, although roundoff error may obscure
    that fact. If the eigenvalues are all different, then theoretically the
    eigenvectors are independent. Likewise, the matrix of eigenvectors is
    unitary if the matrix a is normal, i.e., if dot(a, a.H) = dot(a.H, a).
 
    The left and right eigenvectors are not necessarily the (Hemitian)
    transposes of each other.
eigh(a, UPLO='L')
Compute eigenvalues for a Hermitian-symmetric matrix.
 
A simple interface to the LAPACK routines dsyevd and zheevd that compute
the eigenvalues and eigenvectors of real symmetric and complex Hermitian
arrays respectively.
 
:Parameters:
 
    a : 2-d array
        A complex Hermitian or symmetric real 2-d array whose eigenvalues
        and eigenvectors will be computed.
 
    UPLO : string
        Specifies whether the pertinent array date is taken from the upper
        or lower triangular part of a. Possible values are 'L', and 'U'.
        Default is 'L'.
 
:Returns:
 
    w : 1-d double array
        The eigenvalues. The eigenvalues are not necessarily ordered.
 
    v : 2-d double or complex double array, depending on input array type
        The normalized eigenvector corresponding to the eigenvalue w[i] is
        the column v[:,i].
 
:SeeAlso:
 
    - eigvalsh : eigenvalues of symmetric or Hemitiean arrays.
    - eig : eigenvalues and right eigenvectors for non-symmetric arrays
    - eigvals : eigenvalues of non-symmetric array.
 
:Notes:
-------
 
    The number w is an eigenvalue of a if there exists a vector v
    satisfying the equation dot(a,v) = w*v. Alternately, if w is a root of
    the characteristic equation det(a - w[i]*I) = 0, where det is the
    determinant and I is the identity matrix. The eigenvalues of real
    symmetric or complex Hermitean matrices are always real. The array v
    of eigenvectors is unitary and a, w, and v satisfy the equation
    dot(a,v[i]) = w[i]*v[:,i].
eigvals(a)
Compute the eigenvalues of the general 2-d array a.
 
A simple interface to the LAPACK routines dgeev and zgeev that sets the
flags to return only the eigenvalues of general real and complex arrays
respectively.
 
:Parameters:
 
    a : 2-d array
        A complex or real 2-d array whose eigenvalues and eigenvectors
        will be computed.
 
:Returns:
 
    w : 1-d double or complex array
        The eigenvalues. The eigenvalues are not necessarily ordered, nor
        are they necessarily real for real matrices.
 
:SeeAlso:
 
    - eig : eigenvalues and right eigenvectors of general arrays
    - eigvalsh : eigenvalues of symmetric or Hemitiean arrays.
    - eigh : eigenvalues and eigenvectors of symmetric/Hermitean arrays.
 
:Notes:
-------
 
    The number w is an eigenvalue of a if there exists a vector v
    satisfying the equation dot(a,v) = w*v. Alternately, if w is a root of
    the characteristic equation det(a - w[i]*I) = 0, where det is the
    determinant and I is the identity matrix.
eigvalsh(a, UPLO='L')
Compute the eigenvalues of the symmetric or Hermitean 2-d array a.
 
A simple interface to the LAPACK routines dsyevd and zheevd that sets the
flags to return only the eigenvalues of real symmetric and complex
Hermetian arrays respectively.
 
:Parameters:
 
    a : 2-d array
        A complex or real 2-d array whose eigenvalues and eigenvectors
        will be computed.
 
    UPLO : string
        Specifies whether the pertinent array date is taken from the upper
        or lower triangular part of a. Possible values are 'L', and 'U' for
        upper and lower respectively. Default is 'L'.
 
:Returns:
 
    w : 1-d double array
        The eigenvalues. The eigenvalues are not necessarily ordered.
 
:SeeAlso:
 
    - eigh : eigenvalues and eigenvectors of symmetric/Hermitean arrays.
    - eigvals : eigenvalues of general real or complex arrays.
    - eig : eigenvalues and eigenvectors of general real or complex arrays.
 
:Notes:
-------
 
    The number w is an eigenvalue of a if there exists a vector v
    satisfying the equation dot(a,v) = w*v. Alternately, if w is a root of
    the characteristic equation det(a - w[i]*I) = 0, where det is the
    determinant and I is the identity matrix. The eigenvalues of real
    symmetric or complex Hermitean matrices are always real.
fft(a, n=None, axis=-1)
fft(a, n=None, axis=-1)
 
Return the n point discrete Fourier transform of a. n defaults to
the length of a. If n is larger than the length of a, then a will
be zero-padded to make up the difference.  If n is smaller than
the length of a, only the first n items in a will be used.
 
The packing of the result is "standard": If A = fft(a, n), then A[0]
contains the zero-frequency term, A[1:n/2+1] contains the
positive-frequency terms, and A[n/2+1:] contains the negative-frequency
terms, in order of decreasingly negative frequency. So for an 8-point
transform, the frequencies of the result are [ 0, 1, 2, 3, 4, -3, -2, -1].
 
This is most efficient for n a power of two. This also stores a cache of
working memory for different sizes of fft's, so you could theoretically
run into memory problems if you call this too many times with too many
different n's.
fft2(a, s=None, axes=(-2, -1))
fft2(a, s=None, axes=(-2,-1))
 
The 2d fft of a. This is really just fftn with different default
behavior.
fftn(a, s=None, axes=None)
fftn(a, s=None, axes=None)
 
The n-dimensional fft of a. s is a sequence giving the shape of the input
an result along the transformed axes, as n for fft. Results are packed
analogously to fft: the term for zero frequency in all axes is in the
low-order corner, while the term for the Nyquist frequency in all axes is
in the middle.
 
If neither s nor axes is specified, the transform is taken along all
axes. If s is specified and axes is not, the last len(s) axes are used.
If axes are specified and s is not, the input shape along the specified
axes is used. If s and axes are both specified and are not the same
length, an exception is raised.
i0(x)
ifft(a, n=None, axis=-1)
ifft(a, n=None, axis=-1)
 
Return the n point inverse discrete Fourier transform of a.  n
defaults to the length of a. If n is larger than the length of a,
then a will be zero-padded to make up the difference. If n is
smaller than the length of a, then a will be truncated to reduce
its size.
 
The input array is expected to be packed the same way as the output of
fft, as discussed in it's documentation.
 
This is the inverse of fft: ifft(fft(a)) == a within numerical
accuracy.
 
This is most efficient for n a power of two. This also stores a cache of
working memory for different sizes of fft's, so you could theoretically
run into memory problems if you call this too many times with too many
different n's.
ifft2(a, s=None, axes=(-2, -1))
ifft2(a, s=None, axes=(-2, -1))
 
The inverse of fft2d. This is really just ifftn with different
default behavior.
ifftn(a, s=None, axes=None)
ifftn(a, s=None, axes=None)
 
The inverse of fftn.
inv(a)
lstsq(a, b, rcond=-1)
returns x,resids,rank,s
where x minimizes 2-norm(|b - Ax|)
resids is the sum square residuals
rank is the rank of A
s is the rank of the singular values of A in descending order
 
If b is a matrix then x is also a matrix with corresponding columns.
If the rank of A is less than the number of columns of A or greater than
the number of rows, then residuals will be returned as an empty array
otherwise resids = sum((b-dot(A,x)**2).
Singular values less than s[0]*rcond are treated as zero.
norm(x, ord=None)
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,axis=0)**(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),axis=0))
 
   For values ord < 0, the result is, strictly speaking, not a
   mathematical 'norm', but it may still be useful for numerical purposes.
pinv(a, rcond=1.0000000000000001e-15)
Return the (Moore-Penrose) pseudo-inverse of a 2-d array
 
This method computes the generalized inverse using the
singular-value decomposition and all singular values larger than
rcond of the largest.
solve(a, b)
Return the solution of a*x = b
svd(a, full_matrices=1, compute_uv=1)
Singular Value Decomposition.
 
u,s,vh = svd(a)
 
If a is an M x N array, then the svd produces a factoring of the array
into two unitary (orthogonal) 2-d arrays u (MxM) and vh (NxN) and a
min(M,N)-length array of singular values such that
 
                 a == dot(u,dot(S,vh))
 
where S is an MxN array of zeros whose main diagonal is s.
 
if compute_uv == 0, then return only the singular values
if full_matrices == 0, then only part of either u or vh is
                       returned so that it is MxN

 
Data
        __all__ = ['fft', 'ifft', 'fftn', 'ifftn', 'fft2', 'ifft2', 'norm', 'inv', 'svd', 'solve', 'det', 'eig', 'eigvals', 'eigh', 'eigvalsh', 'lstsq', 'pinv', 'cholesky', 'i0']