| cdsMatrix |
index |
Numerical matrix classes
CDSMatrixes are container objects for numerical contents. Elements
can be assigned to and read from using [i,j] index notation.
They can be added, subtracted, and multiplied.
Classes:
CDSMatrix_double
CDSMatrix_DComplex
CDSMatrix_int
Constructor:
Here, replace ``type'' with the appropriate containee type (e.g., ``double'').
CDSMatrix_type(rows, cols[, initializer])
where the number of rows (rows), number of columns (cols), and an optional
initializer value are specified.
CDSMatrix_type(otherMatrix)
construct a new CDSMatrix, initializing elements from those of otherMatrix.
Also:
SymMatrix_double(size)
construct symmetric real matrix of specified size.
SymMatrix_double(lowerTri)
construct symmetric real matrix from a lower triangular matrix.
Example:
s = SymMatrix_double([1,2,3])
print s
[1, 2]
[2, 3]
Methods:
fromList(list) - set elements from a sequence of sequences.
rows() - number of rows
cols() - number of columns
set(val) - set all elements to val.
setDiag(val) - set all diagonal elements to val.
scale(val) - scale all elements by val.
add(val) - add val to all elements.
rawData() - return a cdsVector.CDSVector_double containing the
data in the matrix in column-major form.
One can multiply CDSMatrixes by CDSMatrixes and by cdsVector.CDSVectors.
In addition there are the functions:
transpose(mat) - return the matrix transpose
inverse(mat) - return the matrix inverse
svd(mat) - perform singular value decomposition on mat, and return the
results in a structure with members
sigma - singular values, apparently sorted from largest to
smallest.
u - left matrix
vT - right matrix
Note that the singular value representation of mat is
u * sigma * vT
Optional jobu and jobvt arguments may be specified:
jobu:
Specifies options for computing all or part of the
matrix u:
'A': all M columns of U are returned in array U:
'S': the first min(m,n) columns of U (the left
singular vectors) are returned in the array U
'N': no columns of U (no left singular vectors) are
computed.
jobvt:
Specifies options for computing all or part of the
matrix V^T:
'A': all N rows of V^T are returned in the array
VT
'S': the first min(m,n) rows of V^T (the right
singular vectors) are returned in the array VT
'N': no rows of V^T (no right singular vectors)
are computed.
By default, these two arguments both take 'A' values.
eigen(mat) - perform eigenvalue analysis on mat. This returns a list of
eigenPairs, each of which has accessors value and vector
which which return the expected information.
trace(mat) - return trace of mat
det(mat) - return determinate of mat
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
| Classes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Functions | ||
| ||
| Data | ||
| FALSE = 0 PI = 3.141592653589793 TRUE = 1 __sthead_hh__ = 1 | ||