#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "autopas/utils/ArrayMath.h"
#include "autopas/utils/Math.h"
Go to the source code of this file.
- Author
- J. Schuhmacher
- Date
- 11.02.26
◆ almostEqualParticles()
Check if two particle-like objects are almost equal using relative comparisons.
Position, velocity, and force are compared using autopas::utils::almostEqualRelative(...) with a configurable relative tolerance. Additionally, getTypeId() must match exactly.
- Template Parameters
-
| L | Particle-like type of the left-hand side. |
| R | Particle-like type of the right-hand side. |
- Parameters
-
| lhs | Left-hand side particle. |
| rhs | Right-hand side particle. |
| epsilon | Relative tolerance used for the floating-point comparisons. |
- Returns
- True if
getR(), getV(), and getF() are almost equal (relative) and getTypeId() matches.
◆ almostEqualParticlesUlps()
Check if two particle-like objects are almost equal using an ULP distance.
Position, velocity, and force are compared using autopas::utils::almostEqualUlps(...) with a configurable maximum ULP distance. Additionally, getTypeId() must match exactly.
- Template Parameters
-
| L | Particle-like type of the left-hand side. |
| R | Particle-like type of the right-hand side. |
- Parameters
-
| lhs | Left-hand side particle. |
| rhs | Right-hand side particle. |
| ulpDistance | Maximum allowed distance in ULPs. |
- Returns
- True if
getR(), getV(), and getF() are almost equal (ULPs) and getTypeId() matches.
◆ equalParticles()
| bool equalParticles |
( |
const auto & |
lhs, |
|
|
const auto & |
rhs |
|
) |
| |
Check if two particle-like objects are strictly equal.
Strict equality means that position, velocity, force, and ID are compared using operator== on the respective return types.
- Template Parameters
-
| L | Particle-like type of the left-hand side. |
| R | Particle-like type of the right-hand side. |
- Parameters
-
| lhs | Left-hand side particle. |
| rhs | Right-hand side particle. |
- Returns
- True if
getR(), getV(), getF(), and getID() are all strictly equal; false otherwise.