dlinear  0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
dlinear::IterationStats Class Reference

Dataclass collecting statistics about some operation or process. More...

#include <Stats.h>

Inheritance diagram for dlinear::IterationStats:
dlinear::Stats

Public Member Functions

 IterationStats (bool enabled, std::string class_name, std::string name_time="Time spent in Operations", std::string iterations_name="Total # of Iterations")
 Construct an IterationStats object.
 
std::string ToSegmentString () const override
 Convert the current state of the object to a formatted string, only including the specific part the Stat object is concerned about.
 
std::string ToString () const override
 Convert the current state of the object to a formatted string.
 
void Increase ()
 Increase the iteration counter by one.
 
unsigned int iterations () const
 Get read-only access to the iterations of the stats.
 
- Public Member Functions inherited from dlinear::Stats
 Stats (bool enabled, std::string class_name, std::string name_time="Time spent in Operations")
 Construct a Stats object.
 
bool enabled () const
 Check whether the stats is enabled.
 
Timerm_timer ()
 Get read-write access to the timer of the stats.
 
const Timertimer () const
 Get read-only access to the timer of the stats.
 

Private Attributes

std::atomic< unsigned int > iterations_
 Atomic counter for the total number of iterations.
 
std::string iterations_name_
 Name to give to the iteration operation.
 

Additional Inherited Members

- Protected Attributes inherited from dlinear::Stats
bool enabled_
 Flag to enable/disable the collection of statistics.
 
std::string class_name_
 Name of the class running the operation the Stats object is collecting statistics for.
 
std::string operations_name_
 Name of the operation the Stats object is collecting statistics for.
 

Detailed Description

Dataclass collecting statistics about some operation or process.

Not only does it collect the cumulative time spent in a given operation, but also the total number of iterations.

Definition at line 71 of file Stats.h.

Constructor & Destructor Documentation

◆ IterationStats()

dlinear::IterationStats::IterationStats ( bool enabled,
std::string class_name,
std::string name_time = "Time spent in Operations",
std::string iterations_name = "Total # of Iterations" )
explicit

Construct an IterationStats object.

Parameters
enabledwhether the Stats object should be enabled or not. Its value is propagated to the timer_
class_namename of the class running the operation the Stats object is collecting statistics for
name_timename of the operation the Stats object is collecting statistics for
iterations_namename of the operation the Stats object is collecting statistics for

Definition at line 48 of file Stats.cpp.

Member Function Documentation

◆ Increase()

void dlinear::IterationStats::Increase ( )

Increase the iteration counter by one.

Note
The iteration counter is atomic.

Definition at line 39 of file Stats.cpp.

◆ iterations()

unsigned int dlinear::IterationStats::iterations ( ) const
inlinenodiscard

Get read-only access to the iterations of the stats.

Returns
iterations of the stats

Definition at line 103 of file Stats.h.

◆ ToSegmentString()

std::string dlinear::IterationStats::ToSegmentString ( ) const
nodiscardoverridevirtual

Convert the current state of the object to a formatted string, only including the specific part the Stat object is concerned about.

Returns
string representing a partial state of the Stats

Reimplemented from dlinear::Stats.

Definition at line 43 of file Stats.cpp.

◆ ToString()

std::string dlinear::IterationStats::ToString ( ) const
nodiscardoverridevirtual

Convert the current state of the object to a formatted string.

Returns
string representing the state of the Stats

Reimplemented from dlinear::Stats.

Definition at line 46 of file Stats.cpp.


The documentation for this class was generated from the following files: