IGMPlot 3.16
Optimized IGMplot version able to use wfn/wfx/xyz files
Loading...
Searching...
No Matches
toolbox.cpp File Reference

implementation of methods declared in toolbox.h More...

#include <toolbox.h>
#include <iostream>
#include <string>
Include dependency graph for toolbox.cpp:

Functions

double getMaxFromPrec3DMatrix (double ***_3DMatrix, const unsigned int dimX, const unsigned int dimY, const unsigned int dimZ, double ***rho, const double lowerlimit, const double upperlimit)
 From a 3D matrix, return the maximum value found.
 
double getMinFromPrec3DMatrix (double ***_3DMatrix, const unsigned int dimX, const unsigned int dimY, const unsigned int dimZ, double ***rho, const double lowerlimit, const double upperlimit)
 From a 3D matrix, return the maximum value found.
 
double getMaxFrom2Matrices (double ***cube1, double ***cube2, double threshold, const unsigned int dimX, const unsigned int dimY, const unsigned int dimZ)
 From cube1, return the maximum value found for which cube2 > threshold.
 
double getMaxFromPrecVectorized3DMatrix (double *_Vectorized3DMatrix, double *cubeRho, const double lowerlimit, const double upperlimit, unsigned int dimX, const unsigned int dimY, const unsigned int dimZ)
 From a Vectorized 3D matrix, return the maximum value found.
 
std::string getCondensedInformationFromNumericSet (std::set< int > numericValues)
 From a set of numeric value, return a string version of the content with interval (if the information is 1,2,3,4,5,6,9; return "1-6, 9")
 
void space (size_t nbSpaces, size_t limit)
 Print spaces characters.
 
void printCurrentState (unsigned int done, unsigned int total, time_t ellapsed)
 Tool to display timing info for user.
 
double getScalarProduct (const double *vectorA, const double *vectorB)
 Tool procedure computing scalar product between two 3D vectors.
 
double getCrossProductMagn (const double *vectorA, const double *vectorB)
 computes the magnitude of the cross product between two given vectors
 
double getNormOfVector (const double *vectorA)
 Tool procedure computing the norm of a given 3D vector.
 
bool isStringInt (const std::string s)
 function to test that a string really represents an integer
 
bool invSym33 (double M[3][3], double MINV[3][3])
 function that computes the inverse of a 3x3 symmetric matrix
 
int modulo (int a, int b)
 function that returns the modulo of a by b (works for negative a values)
 
double distance (double a[3], double b[3])
 function that returns the distance between two points a and b
 
void getTransposed (double **M1, double M2[3][3])
 function that take the transposed matrix of M1 and put it in M2
 
void getTransposed (double M1[3][3], double M2[3][3])
 function that takes the transposed matrix of M1 and put it in M2
 
bool isNumeric (std::string const &str)
 function that takes a string as input and check it is numeric
 

Detailed Description

implementation of methods declared in toolbox.h

Function Documentation

◆ distance()

double distance ( double a[3],
double b[3] )

function that returns the distance between two points a and b

Parameters
a--> the first point
b--> the second point
Returns
the distance
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCondensedInformationFromNumericSet()

std::string getCondensedInformationFromNumericSet ( std::set< int > numericValues)

From a set of numeric value, return a string version of the content with interval (if the information is 1,2,3,4,5,6,9; return "1-6, 9")

Parameters
numericValuesThe set that contains numeric values (so sorted and unique)
Returns
The string version of the information
Here is the caller graph for this function:

◆ getCrossProductMagn()

double getCrossProductMagn ( const double * vectorA,
const double * vectorB )

computes the magnitude of the cross product between two given vectors

Parameters
vectorAThe first vector
vectorBThe second vector
Returns
The magnitude of the cross product

◆ getMaxFrom2Matrices()

double getMaxFrom2Matrices ( double *** cube1,
double *** cube2,
double threshold,
const unsigned int dimX,
const unsigned int dimY,
const unsigned int dimZ )

From cube1, return the maximum value found for which cube2 > threshold.

Parameters
cube1The matrix where to find the maximum value
cube2The matrix providing the condition test
dimXThe first dimension of the matrix
dimYThe second dimension of the matrix
dimZThe third dimension of the matrix
Returns
The maximum value found but according cube2
Here is the caller graph for this function:

◆ getMaxFromPrec3DMatrix()

double getMaxFromPrec3DMatrix ( double *** _3DMatrix,
const unsigned int dimX,
const unsigned int dimY,
const unsigned int dimZ,
double *** rho,
const double lowerlimit,
const double upperlimit )

From a 3D matrix, return the maximum value found.

Parameters
_3DMatrixThe matrix to parse the cube itself
dimXThe first dimension of the matrix
dimYThe second dimension of the matrix
dimZThe third dimension of the matrix
rhoThe ED cube
lowerlimitThe lower limit of the ED range used to filter the _3DMatrix cube
upperlimitThe upper limit of the ED range used to filter the _3DMatrix cube
Returns
The maximum value found but according the given rho threshold
Here is the caller graph for this function:

◆ getMaxFromPrecVectorized3DMatrix()

double getMaxFromPrecVectorized3DMatrix ( double * _Vectorized3DMatrix,
double * cubeRho,
const double lowerlimit,
const double upperlimit,
unsigned int dimX,
const unsigned int dimY,
const unsigned int dimZ )

From a Vectorized 3D matrix, return the maximum value found.

Parameters
_Vectorized3DMatrixThe matrix to parse the cube itself
cubeRhoThe electron density cube serving to filter the _Vectorized3DMatrix
lowerlimitThe lower limit of the ED range used to filter the _Vectorized3DMatrix
upperlimitThe upper limit of the ED range used to filter the _Vectorized3DMatrix
dimXThe first dimension of the matrix
dimYThe second dimension of the matrix
dimZThe third dimension of the matrix
Warning
The matrix is a vector
Returns
The maximum value found but according the given rho range
Here is the caller graph for this function:

◆ getMinFromPrec3DMatrix()

double getMinFromPrec3DMatrix ( double *** _3DMatrix,
const unsigned int dimX,
const unsigned int dimY,
const unsigned int dimZ,
double *** rho,
const double lowerlimit,
const double upperlimit )

From a 3D matrix, return the maximum value found.

Parameters
_3DMatrixThe matrix to parse the cube itself
dimXThe first dimension of the matrix
dimYThe second dimension of the matrix
dimZThe third dimension of the matrix
rhoThe ED cube
lowerlimitThe lower limit of the ED range used to filter the _3DMatrix cube
upperlimitThe upper limit of the ED range used to filter the _3DMatrix cube
Returns
The minimum value found but according the given rho threshold
Here is the caller graph for this function:

◆ getNormOfVector()

double getNormOfVector ( const double * vectorA)

Tool procedure computing the norm of a given 3D vector.

Parameters
vectorAThe vector to compute the norm
Returns
The vectorA norm
Here is the caller graph for this function:

◆ getScalarProduct()

double getScalarProduct ( const double * vectorA,
const double * vectorB )

Tool procedure computing scalar product between two 3D vectors.

Parameters
vectorAThe first vector
vectorBThe second vector
Returns
The scalar product vectorA*vectorB
Here is the caller graph for this function:

◆ getTransposed() [1/2]

void getTransposed ( double ** M1,
double M2[3][3] )

function that take the transposed matrix of M1 and put it in M2

Parameters
M1--> the first matrix (pointer of pointer here)
M2--> the second matrix (2D array here)
Here is the caller graph for this function:

◆ getTransposed() [2/2]

void getTransposed ( double M1[3][3],
double M2[3][3] )

function that takes the transposed matrix of M1 and put it in M2

Parameters
M1--> the first matrix (2D array here)
M2--> the second matrix (2D array here)

◆ invSym33()

bool invSym33 ( double M[3][3],
double MINV[3][3] )

function that computes the inverse of a 3x3 symmetric matrix


Parameters
Mthe matrix to be inversed
MINVthe inversed matrix
Returns
false if determinant = 0 else return true
Here is the caller graph for this function:

◆ isNumeric()

bool isNumeric ( std::string const & str)

function that takes a string as input and check it is numeric

Returns
true if only digit are present in the string
Here is the caller graph for this function:

◆ isStringInt()

bool isStringInt ( const std::string s)

function to test that a string really represents an integer


Parameters
sa string s
Returns
True if the string s is an integer
Here is the caller graph for this function:

◆ modulo()

int modulo ( int a,
int b )

function that returns the modulo of a by b (works for negative a values)

Parameters
a--> the numerator
b--> the divisor
Returns
the modulo of a by b

◆ printCurrentState()

void printCurrentState ( unsigned int done,
unsigned int total,
time_t ellapsed )

Tool to display timing info for user.

Parameters
doneThe number of grid points completed
totalThe total number of grid point to process
ellapsedThe time spent until now
Here is the caller graph for this function:

◆ space()

void space ( size_t nbSpaces,
size_t limit = 100 )

Print spaces characters.

Parameters
nbSpacesthenumber of space to print
limitthe upper bound for avoid odd behavior
Here is the caller graph for this function: