Module purecma :: Class DecomposingPositiveMatrix
[hide private]
[frames] | no frames]

Class DecomposingPositiveMatrix

source code

object --+        
         |        
      list --+    
             |    
  SquareMatrix --+
                 |
                DecomposingPositiveMatrix

Symmetric matrix maintaining its own eigendecomposition.

If isinstance(C, DecomposingPositiveMatrix), the eigendecomposion (the return value of eig) is stored in the attributes eigenbasis and eigenvalues such that the i-th eigenvector is:

[row[i] for row in C.eigenbasis]  # or equivalently
[C.eigenbasis[j][i] for j in range(len(C.eigenbasis))]

with eigenvalue C.eigenvalues[i] and hence:

C = C.eigenbasis x diag(C.eigenvalues) x C.eigenbasis^T
Instance Methods [hide private]
new empty list
__init__(self, dimension)
initialize with identity matrix
source code
 
update_eigensystem(self, current_eval, lazy_gap_evals)
Execute eigendecomposition of self if current_eval > lazy_gap_evals + last_updated_eval.
source code
 
mahalanobis_norm(self, dx)
return (dx^T * C^-1 * dx)**0.5
source code
 
_enforce_symmetry(self) source code

Inherited from SquareMatrix: addouter, multiply_with

Inherited from list: __add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setitem__, __setslice__, __sizeof__, append, count, extend, index, insert, pop, remove, reverse, sort

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from list: __hash__

Properties [hide private]

Inherited from SquareMatrix: diag

Inherited from object: __class__

Method Details [hide private]

__init__(self, dimension)
(Constructor)

source code 
initialize with identity matrix
Returns: new empty list
Overrides: object.__init__
(inherited documentation)

update_eigensystem(self, current_eval, lazy_gap_evals)

source code 

Execute eigendecomposition of self if current_eval > lazy_gap_evals + last_updated_eval.

Assumes (for sake of simplicity) that self is positive definite and hence raises a RuntimeError otherwise.