tools.h File Reference

#include <sys/resource.h>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <list>
#include <set>
Include dependency graph for tools.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Pointer< Type >
 A Smartpointer with reference counter. More...
class  Timer
 Initialize the random-number-generator, using srand(time(NULL)). More...

Defines

#define rtol   1e-10
#define MIN(a, b)   ((a) <= (b) ? (a) : (b))
#define MAX(a, b)   ((a) >= (b) ? (a) : (b))
#define INFINITY   1e99
#define INF   65535
#define out_out   if (out_out_p) (*out_out_p)
#define out_log   if (out_log_p) (*out_log_p)
#define out_err   if (out_err_p) (*out_err_p)

Functions

void print_all_Pointer (ostream &out)
 Prints all registered pointers and the number of Pointers to each of them.
int random (int lb, int ub)
 Gives a random integer.
double random (double lb, double ub)
 Gives a random double.
unsigned int get_mem ()
int start_process (const char *name, char *const *const args, int timelimit=0, const char *envvarname=NULL, const char *envvarvalue=NULL)

Variables

map< const void *, int > refcount
 The (global) counters for the objects, we point to and want to delete.
Pointer< ostream > out_out_p
Pointer< ostream > out_log_p
Pointer< ostream > out_err_p

Define Documentation

#define rtol   1e-10

Definition at line 29 of file tools.h.

#define MIN ( a,
 )     ((a) <= (b) ? (a) : (b))

Definition at line 32 of file tools.h.

#define MAX ( a,
 )     ((a) >= (b) ? (a) : (b))

Definition at line 35 of file tools.h.

#define INFINITY   1e99

Definition at line 42 of file tools.h.

#define INF   65535

Definition at line 45 of file tools.h.

#define out_out   if (out_out_p) (*out_out_p)

Definition at line 220 of file tools.h.

#define out_log   if (out_log_p) (*out_log_p)

Definition at line 223 of file tools.h.

#define out_err   if (out_err_p) (*out_err_p)

Definition at line 226 of file tools.h.


Function Documentation

void print_all_Pointer ( ostream &  out  ) 

Prints all registered pointers and the number of Pointers to each of them.

Parameters:
out The ostream to print to.
int random ( int  lb,
int  ub 
)

Gives a random integer.

Parameters:
lb The lower bound.
ub The upper bound.
Returns:
A random integer x {lb, ..., ub}.
double random ( double  lb,
double  ub 
)

Gives a random double.

Parameters:
lb The lower bound.
ub The upper bound.
Returns:
A uniformly distributed random number from (lb, ub).
unsigned int get_mem (  ) 
int start_process ( const char *  name,
char *const *const   args,
int  timelimit = 0,
const char *  envvarname = NULL,
const char *  envvarvalue = NULL 
)

Variable Documentation

map<const void*, int> refcount

The (global) counters for the objects, we point to and want to delete.

Pointer<ostream> out_out_p
Pointer<ostream> out_log_p
Pointer<ostream> out_err_p

Generated on 10 Mar 2013 for LaGO by  doxygen 1.6.1