Conversation
|
This is useful I think, thanks! As a test, you can check the behaviour of a "fake" matrix-free operator: an operator created with a dot product involving a Stencil Matrix should act exactly like the matrix itself. You can also check that an iterative solver (like cg) can run with an object of this new class. |
|
I see that some tests are failing because of |
|
The new version This also affects PR #6 . I will fix this in this PR. |
I am just adding a few unit tests |
|
I am also adding some features to handle the case where the given dot method has not optional 'out' argument, and the possibility (not mandatory) to pass a 'transpose_dot' method |
Calls to scipy `minres` now use `rtol` instead of `tol` to support version 1.14.0, but this causes previous versions of scipy to fail
calls to scipy's minres now only use rtol which prevents from using scipy < 1.14. In turns this prevent from using python3.8 which is close to being unsupported anyway, see https://devguide.python.org/versions/
This PR provides a
MatrixFreeLinearOperatorclass which is a subclass of the abstract classLinearOperator.The new class allows to create a general matrix-free linear operator. The constructor only requires the domain, codomain and a callable
dotmethod.Notes:
dotmethod may or may not take an 'out' argumenttranspose_dotmethod may also be provided (mandatory to instantiate the transpose() linear operator)Additional change:
tolargument in calls to scipy's minres. This forces us to use scipy >= 1.14 and hence python >= 3.9