/Users/brown170/Projects/Current/coral_msu_repo/trunk/src/coralutils/utils.h File Reference
#include <string>
Go to the source code of this file.
|
Defines |
| #define | IS_ODD(n) ((n) & 1) |
| #define | IS_EVEN(n) (!(IS_ODD(n))) |
| #define | NEGONE_TO_THE(n) (IS_ODD(n) ? -1 : 1) |
| #define | SIGN(x) ((x) >= 0.0 ? 1 : -1) |
| #define | MAXF(x, y) maxof<double>(x,y) |
| #define | MINF(x, y) minof<double>(x,y) |
| #define | MAXI(x, y) maxof<int>(x,y) |
| #define | MINI(x, y) minof<int>(x,y) |
Functions |
| template<class T > |
| int | iround (T x) |
| template<class T > |
| T | sign (T x) |
| template<class T > |
| T | minof (T x1, T x2) |
| template<class T > |
| T | maxof (T x1, T x2) |
| bool | file_exists (const char *file_name) |
| bool | file_exists (const std::string &file_name) |
| double | mod (double x, double y) |
Define Documentation
| #define IS_EVEN |
( |
n |
|
) |
(!(IS_ODD(n))) |
| #define IS_ODD |
( |
n |
|
) |
((n) & 1) |
| #define MAXF |
( |
x, |
|
|
y |
|
) |
maxof<double>(x,y) |
| #define MAXI |
( |
x, |
|
|
y |
|
) |
maxof<int>(x,y) |
| #define MINF |
( |
x, |
|
|
y |
|
) |
minof<double>(x,y) |
| #define MINI |
( |
x, |
|
|
y |
|
) |
minof<int>(x,y) |
| #define NEGONE_TO_THE |
( |
n |
|
) |
(IS_ODD(n) ? -1 : 1) |
| #define SIGN |
( |
x |
|
) |
((x) >= 0.0 ? 1 : -1) |
Function Documentation
| bool file_exists |
( |
const std::string & |
file_name |
) |
|
| bool file_exists |
( |
const char * |
file_name |
) |
|
template<class T >
| int iround |
( |
T |
x |
) |
[inline] |
template<class T >
| T maxof |
( |
T |
x1, |
|
|
T |
x2 | |
|
) |
| | [inline] |
template<class T >
| T minof |
( |
T |
x1, |
|
|
T |
x2 | |
|
) |
| | [inline] |
| double mod |
( |
double |
x, |
|
|
double |
y | |
|
) |
| | |