DiagMC
Diagrammatic Monte Carlo simulation of a 2-level spin system in a magnetic field
Loading...
Searching...
No Matches
Classes | Macros | Functions
diagram.h File Reference

Header file for Diagram and Diagram_core classes. More...

#include <list>
#include <random>
#include <chrono>
Include dependency graph for diagram.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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...
 

Macros

#define EPSILON   1e-10
 

Functions

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...
 

Detailed Description

Header file for Diagram and Diagram_core classes.

Author
Enrico Pedretti
Date
2023-08-31

Definition in file diagram.h.

Macro Definition Documentation

◆ EPSILON

#define EPSILON   1e-10

Definition at line 14 of file diagram.h.

Function Documentation

◆ 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
list1First list
list2Second list
epsilonabsolute value of the difference below which two elements are considered equal
Returns
true if lists are equal,
false otherwise