Tensor.__eq__

Tensor.__eq__(self, other)

Return self == other.

Two elements are equal if their distance is zero.

Parameters
otherLinearSpaceElement

Element of this space.

Returns
equalsbool

True if the elements are equal False otherwise.

See also

LinearSpace.dist

Notes

Equality is very sensitive to numerical errors, thus any arithmetic operations should be expected to break equality.

Examples

>>> rn = odl.rn(1, norm=np.linalg.norm)
>>> x = rn.element([0.1])
>>> x == x
True
>>> y = rn.element([0.1])
>>> x == y
True
>>> z = rn.element([0.3])
>>> x + x + x == z
False