Header file for Diagram and Diagram_core classes.
More...
#include <list>
#include <random>
#include <chrono>
Go to the source code of this file.
|
class | Diagram_core |
| This class is the base class of Diagram, and should not be used directly, aside from testing functionalities. It contains the variables defining the diagram and the DETERMINISTIC part of the routines to perform updates, excluding the random number extraction, which is instead handled by the Diagram class. More...
|
|
class | Diagram |
| This is the main Diagram class, containing the variables defining the diagram - inherited from Diagram_core - and the functions to attempt the updates. More...
|
|
|
bool | lists_are_float_equal (const std::list< double > &list1, const std::list< double > &list2, double epsilon) |
| Small helper function that checks if two lists of floating points numbers are equal, performing element-by-element comparison. If list1[i] and list2[i] are within epsilon for every i, the two lists are considered equal. More...
|
|
Header file for Diagram and Diagram_core classes.
- Author
- Enrico Pedretti
- Date
- 2023-08-31
Definition in file diagram.h.
◆ EPSILON
◆ lists_are_float_equal()
bool lists_are_float_equal |
( |
const std::list< double > & |
list1, |
|
|
const std::list< double > & |
list2, |
|
|
double |
epsilon |
|
) |
| |
Small helper function that checks if two lists of floating points numbers are equal, performing element-by-element comparison. If list1[i] and list2[i] are within epsilon for every i, the two lists are considered equal.
- Parameters
-
list1 | First list |
list2 | Second list |
epsilon | absolute value of the difference below which two elements are considered equal |
- Returns
- true if lists are equal,
-
false otherwise