The MCFClass Project
OPTUtils.h File Reference

Small classes are provided for: More...

#include <limits>
#include <stdlib.h>
#include <time.h>
#include <iostream>

Classes

class  OPTtimers
 Provides a common interface to the different timing routines that are available in different platforms. More...
 
class  OPTrand
 Provide a common interface to the different random generators that are available in different platforms. More...
 

Namespaces

namespace  OPTtypes_di_unipi_it
 The namespace OPTtypes_di_unipi_it is defined to hold all the data types, constants, classes and functions defined here.
 

Macros

#define OPT_TIMERS   5
 The class OPTtimers is defined below to give an abstract interface to the different timing routines that are used in different platforms.
 
#define OPT_RANDOM   1
 The class OPTrand is defined below to give an abstract interface to the different random generators that are used in different platforms.
 

Functions

template<class T >
void DfltdSfInpt (istream *iStrm, T &Param, const T Dflt, const char cmntc='#')
 Template function for reading parameters from a istream.
 

Detailed Description

Small classes are provided for:

  • timing of a code;
  • generating random numbers;
  • extracting "infinity" and "machine epsilon" of numeric types.

The classes can be adapted to different environments (if needed) by setting a compile-time switch in this file.

Additionally, a function is provided for safely reading numbers out of a istream.

Author
Antonio Frangioni
Dipartimento di Informatica
Universita' di Pisa
Copyright(C) 1994 - 2020 by Antonio Frangioni