utils.h File Reference

Utilites and helper functions. More...

#include <string>
#include <sstream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <vector>
#include "chomp/system/config.h"
#include "chomp/system/textfile.h"
#include "chomp/cubes/cube.h"
#include "chomp/multiwork/mw.h"
#include "config.h"
#include "typedefs.h"
#include "eigenval.h"

Go to the source code of this file.

Classes

class  local_value< T >
 Initializes the given variable with the value provided and restores the previous value at the end of the current block. More...

Functions

bool fileExists (const char *filename)
 Returns 'true' iff the given file exists and it is allowed to read it.
template<class intType1, class intType2, class intType3>
bool internalBoundaryPoint (const intType1 *coord, const intType2 *left, const intType2 *right, const intType3 *limit, int dim)
 Verifies whether the given box is located at the boundary of the small region which is either not at the boundary of the large region, or is adjacent to some other similar region.
template<class intType>
void computeParam (const intType *curCoord, double *leftMapParam, double *rightMapParam)
 Computes the real coordinates of the parameter cube which corresponds to the given box.
parRectsubRectangles (parCoord *zeroIter, parCoord *maxIter, std::vector< parCoord > *subCoords, int minCount)
 Determines heuristically an optimal subdivision of a large parameter region into the given minimal number of smaller regions.
template<class intType>
int countDigits (intType x)
 Returns the number of digits of the given non-negative integer number.
template<class intType1, class intType2>
std::string coord2str (const intType1 *coords, const intType2 *maxCoords, int dim)
 Generates an underscore-separated list of non-negative coordinates padded with zeros to the same width assuming that their values are below the given limits.
template<class intType>
std::string coord2str (const intType *coords, int dim)
 Generates an underscore-separated list of non-negative coordinates.
void coordMinMax (const theMorseDecompositionType &morseDec, spcCoord *coordLeftMin, spcCoord *coordRightMax)
 Updates the minimal and maximal coordinates of the box which contains all the Morse sets.
template<class typeCubes>
void subdivideCubes (const typeCubes &X, typeCubes &result)
 Subdivides one set of cubes to another set of cubes with respect to twice finer grid.
template<class typeCube, class typeCubes>
void subdivideCube (const typeCube &q, typeCubes &result)
 Subdivides a cube to a set of cubes with respect to twice finer grid.
template<class typeCubes>
void embedCubes (const typeCubes &X, typeCubes &result)
 Embeds a set of cubes to another set of cubes with respect to twice coarser grid.


Detailed Description

Utilites and helper functions.

This file contains the definitions of various little useful utility procedures for the Conley-Morse graphs computation software.

Author:
Pawel Pilarczyk

Definition in file utils.h.


Function Documentation

template<class intType>
void computeParam ( const intType *  curCoord,
double *  leftMapParam,
double *  rightMapParam 
) [inline]

Computes the real coordinates of the parameter cube which corresponds to the given box.

Uses the globally defined ranges.

Definition at line 131 of file utils.h.

References custom::pop3p::paramCount, custom::pop3p::paramDim, custom::pop3p::paramLeft, custom::pop3p::paramRight, custom::pop3p::paramSelect, and custom::pop3p::paramSubdiv.

Referenced by Worker::Process(), and runSingeComp().

template<class intType>
std::string coord2str ( const intType *  coords,
int  dim 
) [inline]

Generates an underscore-separated list of non-negative coordinates.

Definition at line 299 of file utils.h.

template<class intType1, class intType2>
std::string coord2str ( const intType1 *  coords,
const intType2 *  maxCoords,
int  dim 
) [inline]

Generates an underscore-separated list of non-negative coordinates padded with zeros to the same width assuming that their values are below the given limits.

Definition at line 280 of file utils.h.

References countDigits().

Referenced by Coordinator::Prepare(), and Worker::Process().

void coordMinMax ( const theMorseDecompositionType morseDec,
spcCoord coordLeftMin,
spcCoord coordRightMax 
) [inline]

Updates the minimal and maximal coordinates of the box which contains all the Morse sets.

Definition at line 318 of file utils.h.

References custom::pop3p::spaceDim.

Referenced by Worker::Process(), and runSingeComp().

template<class intType>
int countDigits ( intType  x  )  [inline]

Returns the number of digits of the given non-negative integer number.

Definition at line 260 of file utils.h.

Referenced by coord2str().

template<class typeCubes>
void embedCubes ( const typeCubes &  X,
typeCubes &  result 
) [inline]

Embeds a set of cubes to another set of cubes with respect to twice coarser grid.

Definition at line 404 of file utils.h.

bool fileExists ( const char *  filename  )  [inline]

Returns 'true' iff the given file exists and it is allowed to read it.

Definition at line 62 of file utils.h.

Referenced by invMorseDec(), Coordinator::Prepare(), and Worker::Process().

template<class intType1, class intType2, class intType3>
bool internalBoundaryPoint ( const intType1 *  coord,
const intType2 *  left,
const intType2 *  right,
const intType3 *  limit,
int  dim 
) [inline]

Verifies whether the given box is located at the boundary of the small region which is either not at the boundary of the large region, or is adjacent to some other similar region.

Definition at line 108 of file utils.h.

Referenced by Worker::Process().

template<class typeCube, class typeCubes>
void subdivideCube ( const typeCube &  q,
typeCubes &  result 
) [inline]

Subdivides a cube to a set of cubes with respect to twice finer grid.

Definition at line 380 of file utils.h.

template<class typeCubes>
void subdivideCubes ( const typeCubes &  X,
typeCubes &  result 
) [inline]

Subdivides one set of cubes to another set of cubes with respect to twice finer grid.

Definition at line 350 of file utils.h.

Referenced by checkEmptyInv(), computeConleyIndex(), computeMorseDecomposition(), and matchMorseSets().

parRect* subRectangles ( parCoord zeroIter,
parCoord maxIter,
std::vector< parCoord > *  subCoords,
int  minCount 
) [inline]

Determines heuristically an optimal subdivision of a large parameter region into the given minimal number of smaller regions.

Fills in the provided array of vectors with the division coordinates. Allocates a rectangle for iterating this region and returns its pointer. Note: The rectangle is built upon the two arrays provided; they should not be deleted or otherwise the pointers stored within the rectangle become invalid.

Definition at line 168 of file utils.h.

References custom::pop3p::paramDim, and custom::pop3p::paramSubdiv.

Referenced by Coordinator::Coordinator().


Generated on Sun Mar 28 17:47:58 2010 for The Conley-Morse Graphs Software by  doxygen 1.5.3