SpaceTest

class odl.diagnostics.space.SpaceTest(space, verbose=True, tol=1e-05)[source]

Bases: object

Automated tests for LinearSpace instances.

This class allows users to automatically test various features of a LinearSpace such as linearity and vector space operations.

Methods

contains()

Verify LinearSpace.__contains__.

dist()

Verify LinearSpace.dist.

element()

Verify LinearSpaceElement.

element_assign()

Verify LinearSpaceElement.assign.

element_copy()

Verify LinearSpaceElement.copy.

element_equals()

Verify LinearSpaceElement.__eq__.

element_method()

Verify LinearSpace.element.

element_set_zero()

Verify LinearSpaceElement.set_zero.

element_space()

Verify LinearSpaceElement.space.

equals()

Verify LinearSpace.__eq__.

field()

Verify LinearSpace.field.

inner()

Verify LinearSpace.inner.

linearity()

Verify the linear space properties by examples.

log(message)

Print message if self.verbose == True.

multiply()

Verify LinearSpace.multiply.

norm()

Verify LinearSpace.norm.

run_tests()

Run all tests on this space.

__init__(space, verbose=True, tol=1e-05)[source]

Initialize a new instance.

Parameters:
spaceLinearSpace

Space that should be tested.

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.