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(self)

Verify that Operator.adjoint works appropriately.

derivative(self)

Verify that Operator.derivative works appropriately.

linear(self)

Verify that the operator is actually linear.

log(self, message)

Print message if self.verbose == True.

norm(self)

Estimate the operator norm of the operator.

run_tests(self)

Run all tests on this operator.

self_adjoint(self)

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

__init__(self, 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.