SIMLIB/C++  3.07
Public Member Functions | Protected Attributes | List of all members
simlib3::Stat Class Reference

class for statistical information gathering More...

#include <simlib.h>

Inheritance diagram for simlib3::Stat:
Inheritance graph
[legend]
Collaboration diagram for simlib3::Stat:
Collaboration graph
[legend]

Public Member Functions

 Stat ()
 
 Stat (const char *name)
 
 ~Stat ()
 
virtual void Clear ()
 initialize More...
 
void operator() (double x)
 record the value More...
 
virtual void Output () const override
 print statistics More...
 
unsigned long Number () const
 
double Min () const
 
double Max () const
 
double Sum () const
 
double SumSquare () const
 
double MeanValue () const
 
double StdDev () const
 
- Public Member Functions inherited from simlib3::SimObject
bool TestAndSetFlag (bool new_value, unsigned n)
 internal method for flag manipulation is used for algebraic loop checking in continuous blocks More...
 
 SimObject ()
 constructor More...
 
virtual ~SimObject ()
 virtual destructor More...
 
void * operator new (size_t size)
 allocate object, set _flags More...
 
void operator delete (void *ptr)
 deallocate object More...
 
void * operator new[] (size_t size)=delete
 
void operator delete[] (void *ptr)=delete
 
bool isAllocated () const
 
virtual std::string Name () const
 get object name More...
 
bool HasName () const
 
void SetName (const std::string &name)
 assign the name More...
 

Protected Attributes

double sx
 
double sx2
 
double min
 
double max
 
unsigned long n
 
- Protected Attributes inherited from simlib3::SimObject
unsigned _flags
 bool flags for internal use (TODO bitfield?) More...
 

Additional Inherited Members

- Public Types inherited from simlib3::SimObject
enum  _Flags { _CLEAR_ALL_FLAGS = 0, _ALLOCATED_FLAG = 1<<0, _EVAL_FLAG = 1<<1, _HAS_NAME_FLAG = 1<<2 }
 

Detailed Description

class for statistical information gathering

Definition at line 563 of file simlib.h.

Constructor & Destructor Documentation

◆ Stat() [1/2]

simlib3::Stat::Stat ( )

Definition at line 58 of file stat.cc.

References Dprintf.

◆ Stat() [2/2]

simlib3::Stat::Stat ( const char *  name)
explicit

Definition at line 49 of file stat.cc.

References Dprintf, and simlib3::SimObject::SetName().

◆ ~Stat()

simlib3::Stat::~Stat ( )

Definition at line 69 of file stat.cc.

References Dprintf, and simlib3::SimObject::Name().

Member Function Documentation

◆ Clear()

void simlib3::Stat::Clear ( )
virtual

initialize

Definition at line 77 of file stat.cc.

References max, min, n, sx, and sx2.

Referenced by simlib3::Queue::clear(), and simlib3::Histogram::Clear().

◆ Max()

double simlib3::Stat::Max ( ) const
inline

Definition at line 581 of file simlib.h.

References simlib3::max().

◆ MeanValue()

double simlib3::Stat::MeanValue ( ) const

Definition at line 88 of file stat.cc.

References n, simlib3::SIMLIB_error(), simlib3::StatNoRecError, and sx.

◆ Min()

double simlib3::Stat::Min ( ) const
inline

Definition at line 580 of file simlib.h.

References simlib3::min().

◆ Number()

unsigned long simlib3::Stat::Number ( ) const
inline

Definition at line 579 of file simlib.h.

◆ operator()()

void simlib3::Stat::operator() ( double  x)

record the value

Definition at line 34 of file stat.cc.

References max, min, n, sx, and sx2.

◆ Output()

void simlib3::Stat::Output ( ) const
overridevirtual

print statistics

Reimplemented from simlib3::SimObject.

Definition at line 166 of file output2.cc.

References simlib3::max(), simlib3::min(), simlib3::SimObject::Name(), and simlib3::Print().

◆ StdDev()

double simlib3::Stat::StdDev ( ) const

Definition at line 97 of file stat.cc.

References n, simlib3::SIMLIB_error(), simlib3::StatDispError, sx, and sx2.

◆ Sum()

double simlib3::Stat::Sum ( ) const
inline

Definition at line 582 of file simlib.h.

◆ SumSquare()

double simlib3::Stat::SumSquare ( ) const
inline

Definition at line 583 of file simlib.h.

Member Data Documentation

◆ max

double simlib3::Stat::max
protected

Definition at line 568 of file simlib.h.

Referenced by Clear(), and operator()().

◆ min

double simlib3::Stat::min
protected

Definition at line 567 of file simlib.h.

Referenced by Clear(), and operator()().

◆ n

unsigned long simlib3::Stat::n
protected

Definition at line 569 of file simlib.h.

Referenced by Clear(), MeanValue(), operator()(), and StdDev().

◆ sx

double simlib3::Stat::sx
protected

Definition at line 565 of file simlib.h.

Referenced by Clear(), MeanValue(), operator()(), and StdDev().

◆ sx2

double simlib3::Stat::sx2
protected

Definition at line 566 of file simlib.h.

Referenced by Clear(), operator()(), and StdDev().


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