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
.Verify
LinearSpaceElement.assign
.Verify
LinearSpaceElement.copy
.Verify
LinearSpaceElement.__eq__
.Verify
LinearSpace.element
.Verify
LinearSpaceElement.set_zero
.Verify
LinearSpaceElement.space
.equals
()Verify
LinearSpace.__eq__
.field
()Verify
LinearSpace.field
.inner
()Verify
LinearSpace.inner
.Verify the linear space properties by examples.
log
(message)Print message if
self.verbose == True
.multiply
()Verify
LinearSpace.multiply
.norm
()Verify
LinearSpace.norm
.Run all tests on this space.
- __init__(space, verbose=True, tol=1e-05)[source]¶
Initialize a new instance.
- Parameters:
- space
LinearSpace
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.
- space