Logo Search packages:      
Sourcecode: blender version File versions  Download package

template<typename Derived>
template<typename Derived>
bool MatrixBase< Derived >::isMuchSmallerThan ( const typename NumTraits< Scalar >::Real &  other,
typename NumTraits< Scalar >::Real  prec 
) const [inline]

Returns:
true if the norm of *this is much smaller than other, within the precision determined by prec.
Note:
The fuzzy compares are done multiplicatively. A vector $ v $ is considered to be much smaller than $ x $ within precision $ p $ if

\[ \Vert v \Vert \leqslant p\,\vert x\vert. \]

For matrices, the comparison is done using the Hilbert-Schmidt norm. For this reason, the value of the reference scalar other should come from the Hilbert-Schmidt norm of a reference matrix of same dimensions.

See also:
isApprox(), isMuchSmallerThan(const MatrixBase<OtherDerived>&, RealScalar) const

Definition at line 74 of file Fuzzy.h.

References MatrixBase< Derived >::cwise().

{
  return cwise().abs2().sum() <= prec * prec * other * other;
}


Generated by  Doxygen 1.6.0   Back to index