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[numpy.ndarray, scipy.sparse.base.spmatrix, probnum.linops.LinearOperator, probnum.randvars.RandomVariable]) – System matrix or linear operator.
b (Union[numpy.ndarray, probnum.randvars.RandomVariable]) – Right-hand side vector or matrix.
solution (Optional[Union[numpy.ndarray, probnum.randvars.RandomVariable]]) – True solution to the problem. Used for testing and benchmarking.
Examples
>>> import numpy as np >>> A = np.eye(3) >>> b = np.arange(3) >>> lin_sys = LinearSystem(A, b) >>> lin_sys 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[numpy.ndarray, probnum.randvars.RandomVariable]] = None¶