Tests

These are tests to assist with creating LinearOperator.

adjointTest(O, significant=7)[source]

Test for verifying forward and adjoint functions in LinearOperator.

adjointTest verifies correctness for the forward and adjoint functions for an operator via asserting \(<A^H y, x> = <y, A x>\)

Parameters:

O : LinearOperator

The LinearOperator to test.

significant : int, optional

Perform the test with a numerical accuracy of “significant” digits.

Examples

>>> from pyop import LinearOperator
>>> A = LinearOperator((4,4), lambda _, x: x, lambda _, x: x)
>>> adjointTest(A)
>>> B = LinearOperator((4,4), lambda _, x: x, lambda _, x: 2*x)
>>> adjointTest(B)
... 
Traceback (most recent call last):
    ...
AssertionError:

Matrix Free Linear Operators

Navigation