Package linear_operators :: Module operators :: Class DiagonalOperator
[hide private]
[frames] | no frames]

Class DiagonalOperator

source code

              object --+        
                       |        
interface.LinearOperator --+    
                           |    
           SymmetricOperator --+
                               |
                              DiagonalOperator
Known Subclasses:


An operator which mimics a diagonal matrix.

Attributes
----------
diag: ndarray of 1 dim
   The diagonal of the matrix.

Instance Methods [hide private]
 
__init__(self, diag, **kwargs)
Parameters ---------- diag : ndarray with ndim == 1.
source code
 
__repr__(self)
repr(x)
source code

Inherited from interface.LinearOperator: __add__, __iadd__, __imul__, __isub__, __mul__, __neg__, __pow__, __radd__, __rmul__, __rsub__, __sub__, matmat, matvec, todense

Inherited from interface.LinearOperator (private): _matmat

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from interface.LinearOperator: T

Inherited from object: __class__

Method Details [hide private]

__init__(self, diag, **kwargs)
(Constructor)

source code 

Parameters
----------
diag : ndarray with ndim == 1.
    The diagonal of the operator.

Returns
-------
A DiagonalOperator instance.

Exemple
-------
>>> import numpy as np
>>> import linear_operators as lo
>>> D = lo.DiagonalOperator(np.arange(3))
>>> D.todense()
array([[ 0.,  0.,  0.],
       [ 0.,  1.,  0.],
       [ 0.,  0.,  2.]])

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)