LinearSystem¶
-
class
probnum.problems.
LinearSystem
(A, b, solution=None)[source]¶ Bases:
object
Linear system of equations.
Compute \(x\) from \(Ax=b\). Solved by probabilistic linear solvers in
probnum.linalg
- Parameters
A (
Union
[ndarray
,spmatrix
,LinearOperator
,RandomVariable
]) – System matrix or linear operator.b (
Union
[ndarray
,RandomVariable
]) – Right-hand side vector or matrix.solution (
Union
[ndarray
,RandomVariable
,None
]) – True solution to the problem. Used for testing and benchmarking.
Examples
>>> 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.random_variables.RandomVariable]] = None¶