-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matrix-Free Linear Operator #7
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
MatrixFreeLinearOperator
class 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
dot
method.Notes:
dot
method may or may not take an 'out' argumenttranspose_dot
method may also be provided (mandatory to instantiate the transpose() linear operator)Additional change:
tol
argument in calls to scipy's minres. This forces us to use scipy >= 1.14 and hence python >= 3.9