9#include <gmock/gmock.h>
10#include <gtest/gtest.h>
27 return lhs.getR() == rhs.getR() && lhs.getV() == rhs.getV() && lhs.getF() == rhs.getF() && lhs.getID() == rhs.getID();
40MATCHER(ParticleEq,
"Comparing if two particles are strictly equal to each other") {
41 const auto &lhs = std::get<0>(arg);
42 const auto &rhs = std::get<1>(arg);
44 return lhs.getR() == rhs.getR() && lhs.getV() == rhs.getV() && lhs.getF() == rhs.getF() && lhs.getID() == rhs.getID();
62 double epsilon = autopas::utils::Math::EPSILON_RELATIVE_EQUALITY) {
80MATCHER_P(ParticleAlmostEq, epsilon,
81 "Comparing if two particles are almost equal to each other given a relative epsilon") {
82 const auto &lhs = std::get<0>(arg);
83 const auto &rhs = std::get<1>(arg);
101 unsigned int ulpDistance = autopas::utils::Math::MAX_ULP_DISTANCE) {
119MATCHER_P(ParticleUlpsEq, ulpDistance,
120 "Comparing if two particles are almost equal to each other given an ULP distance") {
121 const auto &lhs = std::get<0>(arg);
122 const auto &rhs = std::get<1>(arg);
bool almostEqualParticles(const auto &lhs, const auto &rhs, double epsilon=autopas::utils::Math::EPSILON_RELATIVE_EQUALITY)
Check if two particle-like objects are almost equal using relative comparisons.
Definition: ParticleMatcher.h:61
bool equalParticles(const auto &lhs, const auto &rhs)
Check if two particle-like objects are strictly equal.
Definition: ParticleMatcher.h:26
bool almostEqualParticlesUlps(const auto &lhs, const auto &rhs, unsigned int ulpDistance=autopas::utils::Math::MAX_ULP_DISTANCE)
Check if two particle-like objects are almost equal using an ULP distance.
Definition: ParticleMatcher.h:100
bool isInUlp(Container lhs, Container rhs, unsigned int ulpDistance=Math::MAX_ULP_DISTANCE)
Function for comparing closeness of two floating point numbers using ULP (Units in the Last Place) me...
Definition: ArrayMath.h:372
bool isNearRel(Container lhs, Container rhs, double maxRelativeDifference=Math::EPSILON_RELATIVE_EQUALITY)
Returns true if arrays are elementwise relatively near each other.
Definition: ArrayMath.h:387