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

_lincomb(self)

Verify linear combination.

contains(self)

Verify LinearSpace.__contains__.

dist(self)

Verify LinearSpace.dist.

element(self)

Verify LinearSpaceElement.

element_assign(self)

Verify LinearSpaceElement.assign.

element_copy(self)

Verify LinearSpaceElement.copy.

element_equals(self)

Verify LinearSpaceElement.__eq__.

element_method(self)

Verify LinearSpace.element.

element_set_zero(self)

Verify LinearSpaceElement.set_zero.

element_space(self)

Verify LinearSpaceElement.space.

equals(self)

Verify LinearSpace.__eq__.

field(self)

Verify LinearSpace.field.

inner(self)

Verify LinearSpace.inner.

linearity(self)

Verify the linear space properties by examples.

log(self, message)

Print message if self.verbose == True.

multiply(self)

Verify LinearSpace.multiply.

norm(self)

Verify LinearSpace.norm.

run_tests(self)

Run all tests on this space.

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