MCPcopy Create free account
hub / github.com/bgrimstad/splinter / assertNear

Function assertNear

include/utilities.h:22–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20// Compare two numbers
21template<typename T>
22bool assertNear(T x, T y, double tolAbs = 1e-8, double tolRel = 1e-8)
23{
24 double dx = std::abs(x - y);
25 double xAbs = 0.5*(std::abs(x) + std::abs(y));
26 double err = std::max(tolAbs, tolRel*xAbs);
27 return dx < err;
28}
29
30std::vector<double> denseVectorToVector(const DenseVector &denseVec);
31

Callers 2

testKnotInsertionFunction · 0.85
refineKnotsLocallyMethod · 0.85

Calls

no outgoing calls

Tested by 1

testKnotInsertionFunction · 0.68