fips.linalg.dottest#
- fips.linalg.dottest(op, rtol=1e-12, seed=0)[source]#
Check that
op.rmatvecis the adjoint ofop.matvec.For random
xandy,<op x, y>must equal<x, op^T y>to within rtol of|op x| |y| + |x| |op^T y|, the size of the terms the two inner products are summed from.- Parameters:
op (
LinearOperator) – The operator to test: any SciPy linear operator, a fips form among them.rtol (
float) – Relative tolerance.
- Returns:
True if the two inner products agree.
- Return type:
Examples
>>> import numpy as np >>> from fips.linalg import DenseOperator, dottest >>> dottest(DenseOperator(np.arange(6.0).reshape(2, 3))) True