Dip  0.92.4
Classes | Macros | Functions | Variables
UtilMacros.h File Reference
#include "DecompConfig.h"
#include "DecompPortable.h"
#include "CoinHelperFunctions.hpp"
Include dependency graph for UtilMacros.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  AddOffset< T >
 
struct  Perturb
 
class  UtilIsGreaterThan< S, T >
 
class  UtilIsLessThan< S, T >
 

Macros

#define UTIL_DELPTR(x)   if(x) {delete x; x = 0;}
 
#define UTIL_DELARR(x)   if(x) {delete [] x; x = 0;}
 
#define UTIL_DEBUG(param, level, x)   if(param > level) {x fflush(stdout);}
 
#define UTIL_DEBUG0(x)   {x fflush(stdout);}
 

Functions

template<class T >
void UtilPrintVector (const vector< T > &v, ostream *os=&cout)
 
template<class T >
void UtilPrintList (const list< T > &v, ostream *os=&cout)
 
CoinPackedVectorUtilPackedVectorFromDense (const int len, const double *dense, const double etol)
 
void UtilPackedVectorFromDense (const int len, const double *dense, const double etol, CoinPackedVector &v)
 
void UtilPrintPackedVector (const CoinPackedVector &v, ostream *os=&cout, DecompApp *app=0)
 
int UtilNumEdgesU (const int n)
 
int UtilIndexU (const int i, const int j)
 
pair< int, int > UtilBothEndsU (const int index)
 
void UtilPrintEdge (const int index, ostream *os=&cout)
 
template<class T >
void UtilFillN (T *to, const int size, const T value)
 
template<class T >
void UtilFillN (vector< T > &v, const int size, const T value)
 
void UtilIotaN (int *first, const int size, const int init)
 
void UtilIotaN (vector< int > &first, const int size, const int init)
 
double UtilURand (const double a, const double b)
 
int UtilURand (const int a, const int b)
 
double UtilAve (const vector< double > &x)
 
double UtilAve (const vector< int > &x)
 
double UtilAve (const double *x, const int len)
 
double UtilFracPart (const double x)
 
int UtilScaleDblToIntArr (const int arrLen, const double *arrDbl, int *arrInt, const double oneDbl, int *oneInt, const double epstol=UtilEpsilon)
 
int UtilScaleDblToIntArr (const int arrLen, const double *arrDbl, int *arrInt, const double epstol=UtilEpsilon)
 
bool UtilIsZero (const double x, const double etol=1.0e-8)
 
string UtilIntToStr (const int i)
 
template<class T >
void UtilDeleteVectorPtr (vector< T * > &vectorPtr, typename vector< T * >::iterator first, typename vector< T * >::iterator last)
 
template<class T >
void UtilDeleteVectorPtr (vector< T * > &vectorPtr)
 
template<class T >
void UtilDeleteListPtr (list< T * > &listPtr, typename list< T * >::iterator first, typename list< T * >::iterator last)
 
template<class T >
void UtilDeleteListPtr (list< T * > &listPtr)
 
bool UtilIsIntegral (const double x, const double etol=1.0e-10)
 
template<class T >
void UtilNegateArr (const int arrLen, T *arr)
 
template<class T >
void UtilAddOffsetArr (const int arrLen, T offset, T *arr)
 
void UtilPerturbCost (const int seed, const int arrLen, const double randLB, const double randUB, double *arr)
 
void UtilFlipRowLtoG (const int len, double *els, char &sense, double &rhs)
 
void UtilBoundToSense (const double lb, const double ub, const double inf, char &sense, double &rhs, double &range)
 
void UtilSenseToBound (const char sense, const double rhs, const double range, const double inf, double &lb, double &ub)
 
string UtilDirSlash ()
 
void UtilOpenFile (ifstream &fs, const char *fileName) throw (CoinError)
 
string & UtilStrTrim (string &s, const string &t=UtilSpaces)
 
string & UtilStrToLower (string &s)
 
string & UtilStrToUpper (string &s)
 

Variables

const string UtilSpaces = " \t\r\n"
 
const double UtilEpsilon = 1.0e-6
 

Macro Definition Documentation

#define UTIL_DELPTR (   x)    if(x) {delete x; x = 0;}
#define UTIL_DELARR (   x)    if(x) {delete [] x; x = 0;}
#define UTIL_DEBUG (   param,
  level,
 
)    if(param > level) {x fflush(stdout);}

Definition at line 34 of file UtilMacros.h.

Referenced by VRP_CVRPsep::buildLpSol().

#define UTIL_DEBUG0 (   x)    {x fflush(stdout);}

Definition at line 35 of file UtilMacros.h.

Function Documentation

template<class T >
void UtilPrintVector ( const vector< T > &  v,
ostream *  os = &cout 
)
inline

Definition at line 39 of file UtilMacros.h.

template<class T >
void UtilPrintList ( const list< T > &  v,
ostream *  os = &cout 
)
inline

Definition at line 52 of file UtilMacros.h.

CoinPackedVector* UtilPackedVectorFromDense ( const int  len,
const double *  dense,
const double  etol 
)

Referenced by DecompVar::DecompVar().

void UtilPackedVectorFromDense ( const int  len,
const double *  dense,
const double  etol,
CoinPackedVector v 
)
void UtilPrintPackedVector ( const CoinPackedVector v,
ostream *  os = &cout,
DecompApp app = 0 
)
int UtilNumEdgesU ( const int  n)
inline

Definition at line 128 of file UtilMacros.h.

Referenced by VRP_Concorde::buildExpandedCompleteGraph().

int UtilIndexU ( const int  i,
const int  j 
)
inline
pair<int, int> UtilBothEndsU ( const int  index)
void UtilPrintEdge ( const int  index,
ostream *  os = &cout 
)
inline

Definition at line 143 of file UtilMacros.h.

References UtilBothEndsU().

template<class T >
void UtilFillN ( T *  to,
const int  size,
const T  value 
)
inline
template<class T >
void UtilFillN ( vector< T > &  v,
const int  size,
const T  value 
)
inline

Definition at line 165 of file UtilMacros.h.

void UtilIotaN ( int *  first,
const int  size,
const int  init 
)
inline

Definition at line 171 of file UtilMacros.h.

Referenced by DecompSubModel::setOsi().

void UtilIotaN ( vector< int > &  first,
const int  size,
const int  init 
)
inline

Definition at line 185 of file UtilMacros.h.

double UtilURand ( const double  a,
const double  b 
)
inline

Definition at line 202 of file UtilMacros.h.

Referenced by Perturb::operator()().

int UtilURand ( const int  a,
const int  b 
)
inline

Definition at line 209 of file UtilMacros.h.

double UtilAve ( const vector< double > &  x)
inline

Definition at line 220 of file UtilMacros.h.

double UtilAve ( const vector< int > &  x)
inline

Definition at line 226 of file UtilMacros.h.

double UtilAve ( const double *  x,
const int  len 
)
inline

Definition at line 232 of file UtilMacros.h.

double UtilFracPart ( const double  x)
inline

Definition at line 243 of file UtilMacros.h.

References UtilEpsilon.

Referenced by GAP_KnapPisinger::calcScaleFactor().

int UtilScaleDblToIntArr ( const int  arrLen,
const double *  arrDbl,
int *  arrInt,
const double  oneDbl,
int *  oneInt,
const double  epstol = UtilEpsilon 
)
int UtilScaleDblToIntArr ( const int  arrLen,
const double *  arrDbl,
int *  arrInt,
const double  epstol = UtilEpsilon 
)
bool UtilIsZero ( const double  x,
const double  etol = 1.0e-8 
)
inline
string UtilIntToStr ( const int  i)
inline
template<class T >
void UtilDeleteVectorPtr ( vector< T * > &  vectorPtr,
typename vector< T * >::iterator  first,
typename vector< T * >::iterator  last 
)
template<class T >
void UtilDeleteVectorPtr ( vector< T * > &  vectorPtr)

Definition at line 302 of file UtilMacros.h.

References UtilDeleteVectorPtr().

template<class T >
void UtilDeleteListPtr ( list< T * > &  listPtr,
typename list< T * >::iterator  first,
typename list< T * >::iterator  last 
)

Definition at line 308 of file UtilMacros.h.

Referenced by UtilDeleteListPtr(), and DecompAlgo::~DecompAlgo().

template<class T >
void UtilDeleteListPtr ( list< T * > &  listPtr)

Definition at line 322 of file UtilMacros.h.

References UtilDeleteListPtr().

bool UtilIsIntegral ( const double  x,
const double  etol = 1.0e-10 
)
inline

Definition at line 328 of file UtilMacros.h.

References UtilIsZero().

Referenced by MAD_DecompSolution::print(), and UtilIsIntegral().

template<class T >
void UtilNegateArr ( const int  arrLen,
T *  arr 
)
inline

Definition at line 335 of file UtilMacros.h.

template<class T >
void UtilAddOffsetArr ( const int  arrLen,
offset,
T *  arr 
)
inline

Definition at line 352 of file UtilMacros.h.

Referenced by VRP_Concorde::setExpandedCost().

void UtilPerturbCost ( const int  seed,
const int  arrLen,
const double  randLB,
const double  randUB,
double *  arr 
)
inline

Definition at line 371 of file UtilMacros.h.

References srand.

void UtilFlipRowLtoG ( const int  len,
double *  els,
char &  sense,
double &  rhs 
)
inline

Definition at line 382 of file UtilMacros.h.

void UtilBoundToSense ( const double  lb,
const double  ub,
const double  inf,
char &  sense,
double &  rhs,
double &  range 
)
inline

Definition at line 405 of file UtilMacros.h.

References UtilIsZero().

Referenced by DecompCut::setStringHash().

void UtilSenseToBound ( const char  sense,
const double  rhs,
const double  range,
const double  inf,
double &  lb,
double &  ub 
)
inline

Definition at line 440 of file UtilMacros.h.

string UtilDirSlash ( )
inline

Definition at line 514 of file UtilMacros.h.

void UtilOpenFile ( ifstream &  fs,
const char *  fileName 
)
throw (CoinError
)
inline
string& UtilStrTrim ( string &  s,
const string &  t = UtilSpaces 
)
inline

Definition at line 545 of file UtilMacros.h.

string& UtilStrToLower ( string &  s)
inline

Definition at line 570 of file UtilMacros.h.

string& UtilStrToUpper ( string &  s)
inline

Definition at line 590 of file UtilMacros.h.

Variable Documentation

const string UtilSpaces = " \t\r\n"

Definition at line 21 of file UtilMacros.h.

const double UtilEpsilon = 1.0e-6

Definition at line 22 of file UtilMacros.h.

Referenced by UtilFracPart().