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
 A class to stop processor time. 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.

Referenced by SparseMatrix::AddElement(), SparseMatrix::AddToElement(), SparseVector< double >::operator=(), SparseVector< double >::operator==(), SparseVector< double >::operator>=(), SparseVector< double >::set(), SparseVector< double >::SetElement(), and SparseVector< double >::SparseVector().

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

Definition at line 32 of file tools.h.

Referenced by DenseVector< double >::resize().

#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.

Referenced by amplCon::eval(), amplObj::eval(), amplCon::grad(), and amplObj::grad().

#define out_err   if (out_err_p) (*out_err_p)

Definition at line 226 of file tools.h.

Referenced by ampl::ampl(), MinlpPenaltyFunc::get_curvature(), Monom::get_curvature(), DualFunc::get_curvature(), ParamTree::ParamTree(), MinlpPenaltyFunc::set_curvature(), Monom::set_curvature(), DualFunc::set_curvature(), and Func::valgrad().


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}.

Referenced by UserVector< double >::set_random().

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.

Referenced by Pointer< LevelCutHandler >::count(), Pointer< LevelCutHandler >::dec_count(), and Pointer< LevelCutHandler >::inc_count().

Pointer<ostream> out_out_p

Pointer<ostream> out_log_p

Pointer<ostream> out_err_p


Generated on Tue Oct 21 03:12:20 2008 for LaGO by  doxygen 1.4.7