__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__
|