fips.linalg.DiagonalOperator#
- class fips.linalg.DiagonalOperator(values)[source]#
Bases:
LinearOperatorA square matrix that is zero off its main diagonal, held as the diagonal.
- Parameters:
values (
ArrayLike) – The diagonal, 1D. It is copied, and the copy is read-only.- Raises:
ValueError – If values is not 1D.
Examples
>>> from fips.linalg import DiagonalOperator >>> D = DiagonalOperator([2.0, 4.0]) >>> D.solve([1.0, 1.0]) array([0.5 , 0.25]) >>> D.trace() 6.0
Attributes
The diagonal, a read-only array. |
Methods
|
Return the form as a dense NumPy array. |
|
Return a copy of the diagonal. |
|
Return the sum of the logarithms of the diagonal. |
|
Solve |
|
Return the diagonal of square roots. |
Inherited
From LinearOperator: dot, trace