Dip  0.92.4
Classes | Macros | Functions | Variables
UtilMacros.h File Reference
#include "DecompConfig.h"
#include "DecompPortable.h"
#include "CoinHelperFunctions.hpp"

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)
 
CoinPackedVector * UtilPackedVectorFromDense (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

◆ UTIL_DELPTR

#define UTIL_DELPTR (   x)    if(x) {delete x; x = 0;}

Definition at line 28 of file UtilMacros.h.

◆ UTIL_DELARR

#define UTIL_DELARR (   x)    if(x) {delete [] x; x = 0;}

Definition at line 29 of file UtilMacros.h.

◆ UTIL_DEBUG

#define UTIL_DEBUG (   param,
  level,
 
)    if(param > level) {x fflush(stdout);}

Definition at line 34 of file UtilMacros.h.

◆ UTIL_DEBUG0

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

Definition at line 35 of file UtilMacros.h.

Function Documentation

◆ UtilPrintVector()

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

Definition at line 39 of file UtilMacros.h.

◆ UtilPrintList()

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

Definition at line 52 of file UtilMacros.h.

◆ UtilPackedVectorFromDense() [1/2]

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

◆ UtilPackedVectorFromDense() [2/2]

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

◆ UtilPrintPackedVector()

void UtilPrintPackedVector ( const CoinPackedVector &  v,
ostream *  os = &cout,
DecompApp app = 0 
)

◆ UtilNumEdgesU()

int UtilNumEdgesU ( const int  n)
inline

Definition at line 128 of file UtilMacros.h.

◆ UtilIndexU()

int UtilIndexU ( const int  i,
const int  j 
)
inline

Definition at line 134 of file UtilMacros.h.

◆ UtilBothEndsU()

pair<int, int> UtilBothEndsU ( const int  index)

◆ UtilPrintEdge()

void UtilPrintEdge ( const int  index,
ostream *  os = &cout 
)
inline

Definition at line 143 of file UtilMacros.h.

◆ UtilFillN() [1/2]

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

Definition at line 158 of file UtilMacros.h.

◆ UtilFillN() [2/2]

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

Definition at line 165 of file UtilMacros.h.

◆ UtilIotaN() [1/2]

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

Definition at line 171 of file UtilMacros.h.

◆ UtilIotaN() [2/2]

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

Definition at line 185 of file UtilMacros.h.

◆ UtilURand() [1/2]

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

Definition at line 202 of file UtilMacros.h.

◆ UtilURand() [2/2]

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

Definition at line 209 of file UtilMacros.h.

◆ UtilAve() [1/3]

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

Definition at line 220 of file UtilMacros.h.

◆ UtilAve() [2/3]

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

Definition at line 226 of file UtilMacros.h.

◆ UtilAve() [3/3]

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

Definition at line 232 of file UtilMacros.h.

◆ UtilFracPart()

double UtilFracPart ( const double  x)
inline

Definition at line 243 of file UtilMacros.h.

◆ UtilScaleDblToIntArr() [1/2]

int UtilScaleDblToIntArr ( const int  arrLen,
const double *  arrDbl,
int *  arrInt,
const double  oneDbl,
int *  oneInt,
const double  epstol = UtilEpsilon 
)

◆ UtilScaleDblToIntArr() [2/2]

int UtilScaleDblToIntArr ( const int  arrLen,
const double *  arrDbl,
int *  arrInt,
const double  epstol = UtilEpsilon 
)

◆ UtilIsZero()

bool UtilIsZero ( const double  x,
const double  etol = 1.0e-8 
)
inline

Definition at line 272 of file UtilMacros.h.

◆ UtilIntToStr()

string UtilIntToStr ( const int  i)
inline

Definition at line 279 of file UtilMacros.h.

◆ UtilDeleteVectorPtr() [1/2]

template<class T >
void UtilDeleteVectorPtr ( vector< T *> &  vectorPtr,
typename vector< T *>::iterator  first,
typename vector< T *>::iterator  last 
)

Definition at line 288 of file UtilMacros.h.

◆ UtilDeleteVectorPtr() [2/2]

template<class T >
void UtilDeleteVectorPtr ( vector< T *> &  vectorPtr)

Definition at line 302 of file UtilMacros.h.

◆ UtilDeleteListPtr() [1/2]

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.

◆ UtilDeleteListPtr() [2/2]

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

Definition at line 322 of file UtilMacros.h.

◆ UtilIsIntegral()

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

Definition at line 328 of file UtilMacros.h.

◆ UtilNegateArr()

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

Definition at line 335 of file UtilMacros.h.

◆ UtilAddOffsetArr()

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

Definition at line 352 of file UtilMacros.h.

◆ UtilPerturbCost()

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.

◆ UtilFlipRowLtoG()

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

Definition at line 382 of file UtilMacros.h.

◆ UtilBoundToSense()

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.

◆ UtilSenseToBound()

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.

◆ UtilDirSlash()

string UtilDirSlash ( )
inline

Definition at line 514 of file UtilMacros.h.

◆ UtilOpenFile()

void UtilOpenFile ( ifstream &  fs,
const char *  fileName 
)
throw (CoinError
)
inline

Definition at line 526 of file UtilMacros.h.

◆ UtilStrTrim()

string& UtilStrTrim ( string &  s,
const string &  t = UtilSpaces 
)
inline

Definition at line 545 of file UtilMacros.h.

◆ UtilStrToLower()

string& UtilStrToLower ( string &  s)
inline

Definition at line 570 of file UtilMacros.h.

◆ UtilStrToUpper()

string& UtilStrToUpper ( string &  s)
inline

Definition at line 590 of file UtilMacros.h.

Variable Documentation

◆ UtilSpaces

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

Definition at line 21 of file UtilMacros.h.

◆ UtilEpsilon

const double UtilEpsilon = 1.0e-6

Definition at line 22 of file UtilMacros.h.