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

Class SymmetricTridiagonal

source code

              object --+        
                       |        
interface.LinearOperator --+    
                           |    
           SymmetricOperator --+
                               |
              object --+       |
                       |       |
interface.LinearOperator --+   |
                           |   |
         TridiagonalOperator --+
                               |
                              SymmetricTridiagonal

Instance Methods [hide private]
 
__init__(self, shape, diag, subdiag, **kwargs)
Parameters ---------- shape : length 2 tuple.
source code
 
toband(self)
Convert into a SymmetricBandOperator.
source code

Inherited from TridiagonalOperator: __getitem__, __repr__, todense

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

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 TridiagonalOperator: T

Inherited from object: __class__

Method Details [hide private]

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

source code 

Parameters
----------
shape : length 2 tuple.
    The shape of the operator.

diag : ndarray of size shape[0]
    The diagonal of the matrix.

subdiag : ndarray of size shape[0] - 1
    The subdiagonal and superdiagonal of the matrix.

Returns
-------
A Tridiagonal matrix operator instance.

Exemple
-------
>>> import numpy as np
>>> import linear_operators as lo
>>> T = lo.TridiagonalOperator((3, 3), [1, 2, 3], [4, 5])
>>> T.todense()
array([[1, 4, 0],
       [4, 2, 5],
       [0, 5, 3]])

Overrides: object.__init__

toband(self)

source code 

Convert into a SymmetricBandOperator.

Overrides: TridiagonalOperator.toband