|
My Project
|
Utility class for comparing double values representing epoch dates or elapsed time. More...
#include <ReservoirCoupling.hpp>
Static Public Member Functions | |
| static bool | compare_eq (double a, double b) |
| Determines if two double values are equal within a specified tolerance. | |
| static bool | compare_gt (double a, double b) |
| Determines if a is greater than b within the specified tolerance. | |
| static bool | compare_gt_or_eq (double a, double b) |
| Determines if a is greater than b within the specified tolerance. | |
| static bool | compare_lt_or_eq (double a, double b) |
| Determines if a is less than or equal to b within the specified tolerance. | |
Static Public Attributes | |
| static constexpr double | abstol = 1e-15 |
| Absolute tolerance used for comparisons. | |
| static constexpr double | reltol = 1e-15 |
| Relative tolerance used for comparisons. | |
Utility class for comparing double values representing epoch dates or elapsed time.
This class is used to compare double values that represent:
stepLength() function in Schedule.cpp in the opm-common module, which returns the step length in seconds. Determines if two double values are equal within a specified tolerance.
Two values a and b are considered equal if:
![\[ |a - b| \leq \text{tol} = \text{abstol} + \text{reltol} \times \max(|a|, |b|) \]](form_123.png)
For example, if abstol = reltol = 1e-15:

| a | First double value. |
| b | Second double value. |
Determines if a is greater than b within the specified tolerance.
| a | First double value. |
| b | Second double value. |
Determines if a is greater than b within the specified tolerance.
| a | First double value. |
| b | Second double value. |
Determines if a is less than or equal to b within the specified tolerance.
| a | First double value. |
| b | Second double value. |