NDOSolver / FiOracle
Interfaces and Solvers for NonDifferentiable Optimization
Loading...
Searching...
No Matches
OPTUtils.h File Reference
#include <limits>
#include <stdlib.h>
#include <time.h>
#include <iostream>

Go to the source code of this file.

Classes

class  OPTtimers
 
class  OPTrand
 

Namespaces

namespace  OPTtypes_di_unipi_it
 

Macros

#define __OPTUtils   /* self-identification: #endif at the end of the file */
 
#define OPT_TIMERS   5
 
#define OPT_RANDOM   1
 

Functions

template<typename T >
static constexpr T Inf (void) noexcept
 Inf< T >() = infinity value for T.
 
template<typename T >
static constexpr T Eps (void) noexcept
 Eps< T >() = "machine epsilon" for T.
 
template<class T >
void DfltdSfInpt (istream *iStrm, T &Param, const T Dflt, const char cmntc='#')
 

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