OperatorTest

class odl.diagnostics.operator.OperatorTest(operator, operator_norm=None, verbose=True, tol=1e-05)[source]

Bases: object

Automated tests for Operator implementations.

This class allows users to automatically test various features of an Operator such as linearity, the adjoint definition and definition of the derivative.

Methods

adjoint()

Verify that Operator.adjoint works appropriately.

derivative()

Verify that Operator.derivative works appropriately.

linear()

Verify that the operator is actually linear.

log(message)

Print message if self.verbose == True.

norm()

Estimate the operator norm of the operator.

run_tests()

Run all tests on this operator.

self_adjoint()

Verify <Ax, y> == <x, Ay>.

__init__(operator, operator_norm=None, verbose=True, tol=1e-05)[source]

Initialize a new instance.

Parameters:
operatorOperator

The operator to run tests on

operator_normfloat, optional

The norm of the operator, used for error estimates. If None is given, the norm is estimated during initialization.

verbosebool, optional

If True, print additional info text.

tolfloat, optional

Tolerance parameter used as a base for the actual tolerance in the tests. Depending on the expected accuracy, the actual tolerance used in a test can be a factor times this number.