19 template<typename Derived, typename OtherDerived, bool is_integer = NumTraits<typename Derived::Scalar>::IsInteger>
23 static bool run(
const Derived& x,
const OtherDerived& y,
const typename Derived::RealScalar& prec)
27 return (nested - otherNested).cwiseAbs2().sum() <= prec * prec * numext::mini(nested.cwiseAbs2().sum(), otherNested.cwiseAbs2().sum());
31 template<
typename Derived,
typename OtherDerived>
35 static bool run(
const Derived& x,
const OtherDerived& y,
const typename Derived::RealScalar&)
37 return x.matrix() == y.matrix();
41 template<typename Derived, typename OtherDerived, bool is_integer = NumTraits<typename Derived::Scalar>::IsInteger>
45 static bool run(
const Derived& x,
const OtherDerived& y,
const typename Derived::RealScalar& prec)
47 return x.cwiseAbs2().sum() <= numext::abs2(prec) * y.cwiseAbs2().sum();
51 template<
typename Derived,
typename OtherDerived>
55 static bool run(
const Derived& x,
const OtherDerived&,
const typename Derived::RealScalar&)
57 return x.matrix() == Derived::Zero(x.rows(), x.cols()).matrix();
61 template<typename Derived, bool is_integer = NumTraits<typename Derived::Scalar>::IsInteger>
65 static bool run(
const Derived& x,
const typename Derived::RealScalar& y,
const typename Derived::RealScalar& prec)
67 return x.cwiseAbs2().sum() <= numext::abs2(prec * y);
71 template<
typename Derived>
75 static bool run(
const Derived& x,
const typename Derived::RealScalar&,
const typename Derived::RealScalar&)
77 return x.matrix() == Derived::Zero(x.rows(), x.cols()).matrix();
101 template<
typename Derived>
102 template<
typename OtherDerived>
105 const RealScalar& prec
124 template<
typename Derived>
127 const RealScalar& prec
143 template<
typename Derived>
144 template<
typename OtherDerived>
147 const RealScalar& prec
155 #endif // EIGEN_FUZZY_H