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

Class TridiagonalOperator

source code

              object --+    
                       |    
interface.LinearOperator --+
                           |
                          TridiagonalOperator
Known Subclasses:


Store a tridiagonal operator in the form of 3 arrays

Attributes
-----------
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 of the matrix.

superdiag : ndarray of size shape[0] - 1
    The superdiagonal of the matrix.

Instance Methods [hide private]
 
__init__(self, shape, diag, subdiag, superdiag, **kwargs)
Parameters ---------- shape : length 2 tuple.
source code
 
__repr__(self)
repr(x)
source code
 
todense(self) source code
 
__getitem__(self, y) source code
 
toband(self)
Convert the TridiagonalOperator into a BandOperator
source code

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]
  T

Inherited from object: __class__

Method Details [hide private]

__init__(self, shape, diag, subdiag, superdiag, **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 of the matrix.

superdiag : ndarray of size shape[0] - 1
    The 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], [6, 7])
>>> T.todense()
array([[1, 6, 0],
       [4, 2, 7],
       [0, 5, 3]])

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

todense(self)

source code 
Overrides: interface.LinearOperator.todense

Property Details [hide private]

T

Get Method:
unreachable.T(self)