MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / almost_equal

Function almost_equal

Tests/Particles/NeighborParticles/MDParticleContainer.cpp:98–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96 };
97
98 bool almost_equal (ParticleReal lhs, ParticleReal rhs)
99 {
100 auto const scale = std::max({ParticleReal(1.0), std::abs(lhs), std::abs(rhs)});
101 auto const tol = std::max(ParticleReal(1.0e-12),
102 ParticleReal(64.0) * std::numeric_limits<ParticleReal>::epsilon());
103 return std::abs(lhs - rhs) <= tol * scale;
104 }
105
106 void get_position_unit_cell(Real* r, const IntVect& nppc, int i_part)
107 {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected