fips.linalg.DenseOperator#
- class fips.linalg.DenseOperator(array)[source]#
Bases:
LinearOperatorA matrix held as a dense 2D NumPy array.
- Parameters:
array (
ArrayLike) – The matrix. It is copied, and the copy is read-only: changing array afterwards leaves the form as it was.- Raises:
ValueError – If array is not 2D.
Examples
>>> import numpy as np >>> from fips.linalg import DenseOperator >>> A = DenseOperator(np.array([[2.0, 1.0], [1.0, 2.0]])) >>> A @ np.array([1.0, 0.0]) array([2., 1.]) >>> A.solve(np.array([3.0, 3.0])) array([1., 1.])
Attributes
The matrix, a read-only array. |
Methods
|
Return the read-only array the form holds, not a copy. |
|
Solve |
|
Return the sum of the main diagonal. |
Inherited
From LinearOperator: diagonal, dot, logdet, sqrt