Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

SAMRAI::tbox::Utilities Struct Reference

#include <source/toolbox/base/Utilities.h>

List of all members.

Static Public Member Functions

static int imin (const int a, const int b)
static int imax (const int a, const int b)
static int iabs (const int a)
static float fmin (const float a, const float b)
static float fmax (const float a, const float b)
static float fabs (const float a)
static bool feq (const float a, const float b)
static double dmin (const double a, const double b)
static double dmax (const double a, const double b)
static double dabs (const double a)
static bool deq (const double a, const double b)
static bool ceq (const dcomplex a, const dcomplex b)
static void recursiveMkdir (const string &path, mode_t mode=(S_IRUSR|S_IWUSR|S_IXUSR), bool only_node_zero_creates=true)
static void renameFile (const char *old_filename, const char *new_filename)
static void abort (const string &message, const string &filename, const int line)
static void printWarning (const string &message, const string &filename, const int line)


Detailed Description

Class Utilities is a utility that defines simple utility functions such as min and max. This class provides a single location of definition for these functions instead of sprinkling them throughout the code.


Member Function Documentation

int SAMRAI::tbox::Utilities::imin const int  a,
const int  b
[inline, static]
 

Calculate the minimum of two integers.

int SAMRAI::tbox::Utilities::imax const int  a,
const int  b
[inline, static]
 

Calculate the maximum of two integers.

int SAMRAI::tbox::Utilities::iabs const int  a  )  [inline, static]
 

Calculate the absolute value of an integer.

float SAMRAI::tbox::Utilities::fmin const float  a,
const float  b
[inline, static]
 

Calculate the minimum of two floats.

float SAMRAI::tbox::Utilities::fmax const float  a,
const float  b
[inline, static]
 

Calculate the maximum of two floats.

float SAMRAI::tbox::Utilities::fabs const float  a  )  [inline, static]
 

Calculate the absolute value of a float.

bool SAMRAI::tbox::Utilities::feq const float  a,
const float  b
[static]
 

Returns true if a and b have a relative difference less than sqrt(mach_eps).

double SAMRAI::tbox::Utilities::dmin const double  a,
const double  b
[inline, static]
 

Calculate the minimum of two doubles.

double SAMRAI::tbox::Utilities::dmax const double  a,
const double  b
[inline, static]
 

Calculate the maximum of two doubles.

double SAMRAI::tbox::Utilities::dabs const double  a  )  [inline, static]
 

Calculate the absolute value of a double.

bool SAMRAI::tbox::Utilities::deq const double  a,
const double  b
[static]
 

Returns true if a and b have a relative difference less than sqrt(mach_eps).

bool SAMRAI::tbox::Utilities::ceq const dcomplex  a,
const dcomplex  b
[static]
 

Returns true if both the real and imaginary parts of a and b have a relative difference less than sqrt(mach_eps).

void SAMRAI::tbox::Utilities::recursiveMkdir const string &  path,
mode_t  mode = (S_IRUSR|S_IWUSR|S_IXUSR),
bool  only_node_zero_creates = true
[static]
 

Creates the directory specified in path. Permissions are set by default to rwx by user. The intermediate directories in the path are created if they do not already exist. When only_node_zero_creates is true, only node zero creates the directories. Otherwise, all nodes create the directories.

void SAMRAI::tbox::Utilities::renameFile const char *  old_filename,
const char *  new_filename
[static]
 

Rename a file.

void SAMRAI::tbox::Utilities::abort const string &  message,
const string &  filename,
const int  line
[static]
 

Aborts the run after printing an error message with file and linenumber information.

void SAMRAI::tbox::Utilities::printWarning const string &  message,
const string &  filename,
const int  line
[static]
 

Logs warning message with file & location.


The documentation for this struct was generated from the following files:
Generated on Fri Dec 2 11:33:18 2005 for SAMRAI by  doxygen 1.4.2