MCPcopy Create free account
hub / github.com/PX4/eigen / isApprox

Method isApprox

Eigen/src/SparseCore/SparseFuzzy.h:17–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15template<typename Derived>
16template<typename OtherDerived>
17bool SparseMatrixBase<Derived>::isApprox(const SparseMatrixBase<OtherDerived>& other, const RealScalar &prec) const
18{
19 const typename internal::nested_eval<Derived,2,PlainObject>::type actualA(derived());
20 typename internal::conditional<bool(IsRowMajor)==bool(OtherDerived::IsRowMajor),
21 const typename internal::nested_eval<OtherDerived,2,PlainObject>::type,
22 const PlainObject>::type actualB(other.derived());
23
24 return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm());
25}
26
27} // end namespace Eigen
28

Callers

nothing calls this directly

Calls 2

miniFunction · 0.85
squaredNormMethod · 0.45

Tested by

no test coverage detected