LinearSystem¶
- class probnum.problems.LinearSystem(A, b, solution=None)¶
Bases:
object
Linear system of equations.
Compute \(x\) from \(Ax=b\). Solved by probabilistic linear solvers in
probnum.linalg
- Parameters
A (Union[np.ndarray, scipy.sparse.spmatrix, linops.LinearOperator, randvars.RandomVariable]) – System matrix or linear operator.
b (Union[np.ndarray, randvars.RandomVariable]) – Right-hand side vector or matrix.
solution (Optional[Union[np.ndarray, randvars.RandomVariable]]) – True solution to the problem. Used for testing and benchmarking.
- Return type
None
Examples
>>> import numpy as np >>> A = np.eye(3) >>> b = np.arange(3) >>> linsys = LinearSystem(A, b) >>> linsys LinearSystem(A=array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]), b=array([0, 1, 2]), solution=None)
Attributes Summary
Attributes Documentation
- solution: Optional[Union[np.ndarray, randvars.RandomVariable]] = None¶