aslinop

probnum.linalg.linops.aslinop(A)[source]

Return A as a LinearOperator.

Parameters:A (array-like or LinearOperator or RandomVariable or object) – Argument to be represented as a linear operator. When A is an object it needs to have the attributes .shape and .matvec.

Notes

If A has no .dtype attribute, the data type is determined by calling LinearOperator.matvec() - set the .dtype attribute to prevent this call upon the linear operator creation.

See also

LinearOperator()
Class representing linear operators.

Examples

>>> from probnum.linalg.linops import aslinop
>>> M = np.array([[1,2,3],[4,5,6]], dtype=np.int32)
>>> aslinop(M)
<2x3 MatrixMult with dtype=int32>