cdsMatrix
index
cdsMatrix.py

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) - initializer optional.
 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.
 
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
               u     - left matrix
               vT    - right matrix
            Note that the singular value representation of mat is
                    u * sigma * vT
 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
 

 
Classes
       
__builtin__.object
CDSList_DComplex
CDSList_DComplexPtr
CDSList_EigenPair_DComplex
CDSList_EigenPair_DComplexPtr
CDSList_EigenPair_double
CDSList_EigenPair_doublePtr
CDSMatrix_complex
CDSMatrix_complexPtr
CDSMatrix_double
CDSMatrix_doublePtr
CDSMatrix_double
CDSMatrix_doublePtr
CDSMatrix_int
CDSMatrix_intPtr
EigenPair_DComplex
EigenPair_DComplexPtr
EigenPair_double
EigenPair_doublePtr
SVDResults_double
SVDResults_doublePtr
SymMatrix_double
SymMatrix_doublePtr

 
class CDSList_DComplex(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_CDSList_DComplex>)
__delitem__(*args)
__getattr__ lambda self, name
__getitem__(*args)
__getslice__(*args)
__init__(self, *args)
__len__(*args)
__repr__(self)
__setattr__ lambda self, name, value
__setitem__(*args)
help(*args)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee99f0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSList_DComplex' objects>
list of weak references to the object (if defined)

 
class CDSList_DComplexPtr(CDSList_DComplex)
    
Method resolution order:
CDSList_DComplexPtr
CDSList_DComplex
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from CDSList_DComplex:
__del__(self, destroy=<built-in function delete_CDSList_DComplex>)
__delitem__(*args)
__getattr__ lambda self, name
__getitem__(*args)
__getslice__(*args)
__len__(*args)
__repr__(self)
__setattr__ lambda self, name, value
__setitem__(*args)
help(*args)

Data and other attributes inherited from CDSList_DComplex:
__dict__ = <dictproxy object at 0xee96e0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSList_DComplex' objects>
list of weak references to the object (if defined)

 
class CDSList_EigenPair_DComplex(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_CDSList_EigenPair_DComplex>)
__delitem__(*args)
__getattr__ lambda self, name
__getitem__(*args)
__getslice__(*args)
__init__(self, *args)
__len__(*args)
__repr__(self)
__setattr__ lambda self, name, value
__setitem__(*args)
help(*args)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee9980>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSList_EigenPair_DComplex' objects>
list of weak references to the object (if defined)

 
class CDSList_EigenPair_DComplexPtr(CDSList_EigenPair_DComplex)
    
Method resolution order:
CDSList_EigenPair_DComplexPtr
CDSList_EigenPair_DComplex
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from CDSList_EigenPair_DComplex:
__del__(self, destroy=<built-in function delete_CDSList_EigenPair_DComplex>)
__delitem__(*args)
__getattr__ lambda self, name
__getitem__(*args)
__getslice__(*args)
__len__(*args)
__repr__(self)
__setattr__ lambda self, name, value
__setitem__(*args)
help(*args)

Data and other attributes inherited from CDSList_EigenPair_DComplex:
__dict__ = <dictproxy object at 0xee9718>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSList_EigenPair_DComplex' objects>
list of weak references to the object (if defined)

 
class CDSList_EigenPair_double(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_CDSList_EigenPair_double>)
__delitem__(*args)
__getattr__ lambda self, name
__getitem__(*args)
__getslice__(*args)
__init__(self, *args)
__len__(*args)
__repr__(self)
__setattr__ lambda self, name, value
__setitem__(*args)
help(*args)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee99f0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSList_EigenPair_double' objects>
list of weak references to the object (if defined)

 
class CDSList_EigenPair_doublePtr(CDSList_EigenPair_double)
    
Method resolution order:
CDSList_EigenPair_doublePtr
CDSList_EigenPair_double
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from CDSList_EigenPair_double:
__del__(self, destroy=<built-in function delete_CDSList_EigenPair_double>)
__delitem__(*args)
__getattr__ lambda self, name
__getitem__(*args)
__getslice__(*args)
__len__(*args)
__repr__(self)
__setattr__ lambda self, name, value
__setitem__(*args)
help(*args)

Data and other attributes inherited from CDSList_EigenPair_double:
__dict__ = <dictproxy object at 0xee96e0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSList_EigenPair_double' objects>
list of weak references to the object (if defined)

 
class CDSMatrix_complex(__builtin__.object)
     Methods defined here:
__add__(*args)
__del__(self, destroy=<built-in function delete_CDSMatrix_complex>)
__getattr__ lambda self, name
__getitem__(*args)
__init__(self, *args)
__mul__(*args)
__neg__(*args)
__repr__(*args)
__rmul__(*args)
__setattr__ lambda self, name, value
__setitem__(*args)
__str__(*args)
__sub__(*args)
cols(*args)
fromList(s, l)
get(*args)
resize(*args)
rows(*args)
scale(*args)
set(*args)
setDiag(*args)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee9980>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSMatrix_complex' objects>
list of weak references to the object (if defined)

 
class CDSMatrix_complexPtr(CDSMatrix_complex)
    
Method resolution order:
CDSMatrix_complexPtr
CDSMatrix_complex
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from CDSMatrix_complex:
__add__(*args)
__del__(self, destroy=<built-in function delete_CDSMatrix_complex>)
__getattr__ lambda self, name
__getitem__(*args)
__mul__(*args)
__neg__(*args)
__repr__(*args)
__rmul__(*args)
__setattr__ lambda self, name, value
__setitem__(*args)
__str__(*args)
__sub__(*args)
cols(*args)
fromList(s, l)
get(*args)
resize(*args)
rows(*args)
scale(*args)
set(*args)
setDiag(*args)

Data and other attributes inherited from CDSMatrix_complex:
__dict__ = <dictproxy object at 0xee9718>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSMatrix_complex' objects>
list of weak references to the object (if defined)

 
class CDSMatrix_double(__builtin__.object)
     Methods defined here:
__add__(*args)
__del__(self, destroy=<built-in function delete_CDSMatrix_double>)
__getattr__ lambda self, name
__getitem__(*args)
__init__(self, *args)
__mul__(*args)
__neg__(*args)
__repr__(*args)
__rmul__(*args)
__setattr__ lambda self, name, value
__setitem__(*args)
__str__(*args)
__sub__(*args)
cols(*args)
fromList(s, l)
get(*args)
resize(*args)
rows(*args)
scale(*args)
set(*args)
setDiag(*args)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee99f0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSMatrix_double' objects>
list of weak references to the object (if defined)

 
class CDSMatrix_doublePtr(CDSMatrix_double)
    
Method resolution order:
CDSMatrix_doublePtr
CDSMatrix_double
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from CDSMatrix_double:
__add__(*args)
__del__(self, destroy=<built-in function delete_CDSMatrix_double>)
__getattr__ lambda self, name
__getitem__(*args)
__mul__(*args)
__neg__(*args)
__repr__(*args)
__rmul__(*args)
__setattr__ lambda self, name, value
__setitem__(*args)
__str__(*args)
__sub__(*args)
cols(*args)
fromList(s, l)
get(*args)
resize(*args)
rows(*args)
scale(*args)
set(*args)
setDiag(*args)

Data and other attributes inherited from CDSMatrix_double:
__dict__ = <dictproxy object at 0xee96e0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSMatrix_double' objects>
list of weak references to the object (if defined)

 
class CDSMatrix_int(__builtin__.object)
     Methods defined here:
__add__(*args)
__del__(self, destroy=<built-in function delete_CDSMatrix_int>)
__getattr__ lambda self, name
__getitem__(*args)
__init__(self, *args)
__mul__(*args)
__neg__(*args)
__repr__(*args)
__rmul__(*args)
__setattr__ lambda self, name, value
__setitem__(*args)
__str__(*args)
__sub__(*args)
cols(*args)
fromList(s, l)
get(*args)
resize(*args)
rows(*args)
scale(*args)
set(*args)
setDiag(*args)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee9980>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSMatrix_int' objects>
list of weak references to the object (if defined)

 
class CDSMatrix_intPtr(CDSMatrix_int)
    
Method resolution order:
CDSMatrix_intPtr
CDSMatrix_int
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from CDSMatrix_int:
__add__(*args)
__del__(self, destroy=<built-in function delete_CDSMatrix_int>)
__getattr__ lambda self, name
__getitem__(*args)
__mul__(*args)
__neg__(*args)
__repr__(*args)
__rmul__(*args)
__setattr__ lambda self, name, value
__setitem__(*args)
__str__(*args)
__sub__(*args)
cols(*args)
fromList(s, l)
get(*args)
resize(*args)
rows(*args)
scale(*args)
set(*args)
setDiag(*args)

Data and other attributes inherited from CDSMatrix_int:
__dict__ = <dictproxy object at 0xee9718>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSMatrix_int' objects>
list of weak references to the object (if defined)

 
class EigenPair_DComplex(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_EigenPair_DComplex>)
__getattr__ lambda self, name
__init__(self, *args)
__repr__(self)
__setattr__ lambda self, name, value
value(*args)
vector(*args)

Properties defined here:
value_
get = EigenPair_DComplex_value__get(...)
set = EigenPair_DComplex_value__set(...)
vector_
get = EigenPair_DComplex_vector__get(...)
set = EigenPair_DComplex_vector__set(...)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee99f0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'value_': <built-in function EigenPair_DComplex_value__get>, 'vector_': <built-in function EigenPair_DComplex_vector__get>}
__swig_setmethods__ = {'value_': <built-in function EigenPair_DComplex_value__set>, 'vector_': <built-in function EigenPair_DComplex_vector__set>}
__weakref__ = <attribute '__weakref__' of 'EigenPair_DComplex' objects>
list of weak references to the object (if defined)

 
class EigenPair_DComplexPtr(EigenPair_DComplex)
    
Method resolution order:
EigenPair_DComplexPtr
EigenPair_DComplex
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from EigenPair_DComplex:
__del__(self, destroy=<built-in function delete_EigenPair_DComplex>)
__getattr__ lambda self, name
__repr__(self)
__setattr__ lambda self, name, value
value(*args)
vector(*args)

Properties inherited from EigenPair_DComplex:
value_
get = EigenPair_DComplex_value__get(...)
set = EigenPair_DComplex_value__set(...)
vector_
get = EigenPair_DComplex_vector__get(...)
set = EigenPair_DComplex_vector__set(...)

Data and other attributes inherited from EigenPair_DComplex:
__dict__ = <dictproxy object at 0xee96e0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'value_': <built-in function EigenPair_DComplex_value__get>, 'vector_': <built-in function EigenPair_DComplex_vector__get>}
__swig_setmethods__ = {'value_': <built-in function EigenPair_DComplex_value__set>, 'vector_': <built-in function EigenPair_DComplex_vector__set>}
__weakref__ = <attribute '__weakref__' of 'EigenPair_DComplex' objects>
list of weak references to the object (if defined)

 
class EigenPair_double(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_EigenPair_double>)
__getattr__ lambda self, name
__init__(self, *args)
__repr__(self)
__setattr__ lambda self, name, value
value(*args)
vector(*args)

Properties defined here:
value_
get = EigenPair_double_value__get(...)
set = EigenPair_double_value__set(...)
vector_
get = EigenPair_double_vector__get(...)
set = EigenPair_double_vector__set(...)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee9980>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'value_': <built-in function EigenPair_double_value__get>, 'vector_': <built-in function EigenPair_double_vector__get>}
__swig_setmethods__ = {'value_': <built-in function EigenPair_double_value__set>, 'vector_': <built-in function EigenPair_double_vector__set>}
__weakref__ = <attribute '__weakref__' of 'EigenPair_double' objects>
list of weak references to the object (if defined)

 
class EigenPair_doublePtr(EigenPair_double)
    
Method resolution order:
EigenPair_doublePtr
EigenPair_double
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from EigenPair_double:
__del__(self, destroy=<built-in function delete_EigenPair_double>)
__getattr__ lambda self, name
__repr__(self)
__setattr__ lambda self, name, value
value(*args)
vector(*args)

Properties inherited from EigenPair_double:
value_
get = EigenPair_double_value__get(...)
set = EigenPair_double_value__set(...)
vector_
get = EigenPair_double_vector__get(...)
set = EigenPair_double_vector__set(...)

Data and other attributes inherited from EigenPair_double:
__dict__ = <dictproxy object at 0xee9718>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'value_': <built-in function EigenPair_double_value__get>, 'vector_': <built-in function EigenPair_double_vector__get>}
__swig_setmethods__ = {'value_': <built-in function EigenPair_double_value__set>, 'vector_': <built-in function EigenPair_double_vector__set>}
__weakref__ = <attribute '__weakref__' of 'EigenPair_double' objects>
list of weak references to the object (if defined)

 
RMat = class CDSMatrix_double(__builtin__.object)
     Methods defined here:
__add__(*args)
__del__(self, destroy=<built-in function delete_CDSMatrix_double>)
__getattr__ lambda self, name
__getitem__(*args)
__init__(self, *args)
__mul__(*args)
__neg__(*args)
__repr__(*args)
__rmul__(*args)
__setattr__ lambda self, name, value
__setitem__(*args)
__str__(*args)
__sub__(*args)
cols(*args)
fromList(s, l)
get(*args)
resize(*args)
rows(*args)
scale(*args)
set(*args)
setDiag(*args)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xefb3d0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'CDSMatrix_double' objects>
list of weak references to the object (if defined)

 
class SVDResults_double(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_SVDResults_double>)
__getattr__ lambda self, name
__init__(self, *args)
__repr__(self)
__setattr__ lambda self, name, value

Properties defined here:
sigma
get = SVDResults_double_sigma_get(...)
set = SVDResults_double_sigma_set(...)
u
get = SVDResults_double_u_get(...)
set = SVDResults_double_u_set(...)
vT
get = SVDResults_double_vT_get(...)
set = SVDResults_double_vT_set(...)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee9b40>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'sigma': <built-in function SVDResults_double_sigma_get>, 'u': <built-in function SVDResults_double_u_get>, 'vT': <built-in function SVDResults_double_vT_get>}
__swig_setmethods__ = {'sigma': <built-in function SVDResults_double_sigma_set>, 'u': <built-in function SVDResults_double_u_set>, 'vT': <built-in function SVDResults_double_vT_set>}
__weakref__ = <attribute '__weakref__' of 'SVDResults_double' objects>
list of weak references to the object (if defined)

 
class SVDResults_doublePtr(SVDResults_double)
    
Method resolution order:
SVDResults_doublePtr
SVDResults_double
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from SVDResults_double:
__del__(self, destroy=<built-in function delete_SVDResults_double>)
__getattr__ lambda self, name
__repr__(self)
__setattr__ lambda self, name, value

Properties inherited from SVDResults_double:
sigma
get = SVDResults_double_sigma_get(...)
set = SVDResults_double_sigma_set(...)
u
get = SVDResults_double_u_get(...)
set = SVDResults_double_u_set(...)
vT
get = SVDResults_double_vT_get(...)
set = SVDResults_double_vT_set(...)

Data and other attributes inherited from SVDResults_double:
__dict__ = <dictproxy object at 0xee96e0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {'sigma': <built-in function SVDResults_double_sigma_get>, 'u': <built-in function SVDResults_double_u_get>, 'vT': <built-in function SVDResults_double_vT_get>}
__swig_setmethods__ = {'sigma': <built-in function SVDResults_double_sigma_set>, 'u': <built-in function SVDResults_double_u_set>, 'vT': <built-in function SVDResults_double_vT_set>}
__weakref__ = <attribute '__weakref__' of 'SVDResults_double' objects>
list of weak references to the object (if defined)

 
class SymMatrix_double(__builtin__.object)
     Methods defined here:
__del__(self, destroy=<built-in function delete_SymMatrix_double>)
__getattr__ lambda self, name
__getitem__(*args)
__init__(self, *args)
__mul__(*args)
__repr__(*args)
__setattr__ lambda self, name, value
__setitem__(*args)
__str__(*args)
cols(*args)
rows(*args)
set(*args)
setDiag(*args)

Data and other attributes defined here:
__dict__ = <dictproxy object at 0xee99f0>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'SymMatrix_double' objects>
list of weak references to the object (if defined)

 
class SymMatrix_doublePtr(SymMatrix_double)
    
Method resolution order:
SymMatrix_doublePtr
SymMatrix_double
__builtin__.object

Methods defined here:
__init__(self, this)

Methods inherited from SymMatrix_double:
__del__(self, destroy=<built-in function delete_SymMatrix_double>)
__getattr__ lambda self, name
__getitem__(*args)
__mul__(*args)
__repr__(*args)
__setattr__ lambda self, name, value
__setitem__(*args)
__str__(*args)
cols(*args)
rows(*args)
set(*args)
setDiag(*args)

Data and other attributes inherited from SymMatrix_double:
__dict__ = <dictproxy object at 0xee9da8>
dictionary for instance variables (if defined)
__swig_getmethods__ = {}
__swig_setmethods__ = {}
__weakref__ = <attribute '__weakref__' of 'SymMatrix_double' objects>
list of weak references to the object (if defined)

 
Functions
       
det(m)
 return the determinate of matrix m
    
eigen(...)
help(...)
inverse(...)
svd(...)
trace(m)
transpose(...)

 
Data
        FALSE = 0
PI = 3.1415926535897931
TRUE = 1
__sthead_hh__ = 1