MCPcopy Create free account
hub / github.com/TinyMPC/TinyMPC / isApprox

Method isApprox

include/Eigen/Eigen/src/SparseCore/SparseFuzzy.h:19–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

miniFunction · 0.85
squaredNormMethod · 0.45

Tested by

no test coverage detected