|
VAPOR3 3.9.4
|
Namespaces | |
| namespace | FileUtils |
| namespace | TMSUtils |
Classes | |
| class | EasyThreads |
| class | MyBase |
| Wasp base class. More... | |
| class | MyPython |
| class | OptionParser |
| class | SmartBuf |
| class | Version |
Functions | |
| COMMON_API void | Splitpath (std::string path, std::string &volume, std::string &dir, std::string &file, bool nofile) |
| COMMON_API double | GetTime () |
| COMMON_API int | MkDirHier (const std::string &dir) |
| COMMON_API std::string | GetEnvironmentalVariable (const std::string &name) |
| COMMON_API std::string | GetAppPath (const string &app, const string &name, const vector< string > &paths, bool forwardSeparator=true) |
| COMMON_API int | IsOdd (int x) |
| COMMON_API int | IsPowerOfTwo (unsigned int x) |
| Return true if power of two. | |
| COMMON_API int | Min (int a, int b) |
| COMMON_API int | Max (int a, int b) |
| COMMON_API size_t | Min (size_t a, size_t b) |
| COMMON_API size_t | Max (size_t a, size_t b) |
| COMMON_API float | Min (float a, float b) |
| COMMON_API float | Max (float a, float b) |
| COMMON_API double | Min (double a, double b) |
| COMMON_API double | Max (double a, double b) |
| COMMON_API double | LogBaseN (double x, double n) |
| COMMON_API int | ILog2 (int n) |
| COMMON_API int | StrCmpNoCase (const string &s, const string &t) |
| Case-insensitive string comparison. | |
| COMMON_API void | StrRmWhiteSpace (string &s) |
| Remove white space from a string. | |
| COMMON_API void | StrToWordVec (const string &s, vector< string > &v) |
| Parse a string, returning a vector of words. | |
| COMMON_API std::vector< std::string > & | SplitString (const std::string &s, char delim, std::vector< std::string > &elems) |
| COMMON_API std::vector< size_t > & | SplitString (const std::string &s, char delim, std::vector< size_t > &elems) |
| COMMON_API std::vector< int > & | SplitString (const std::string &s, char delim, std::vector< int > &elems) |
| COMMON_API std::vector< float > & | SplitString (const std::string &s, char delim, std::vector< float > &elems) |
| COMMON_API std::vector< double > & | SplitString (const std::string &s, char delim, std::vector< double > &elems) |
| COMMON_API unsigned long long | GetBits64 (unsigned long long targ, int pos, int n) |
| COMMON_API unsigned long long | SetBits64 (unsigned long long targ, int pos, int n, unsigned long long src) |
| COMMON_API double | ran1 (long *) |
| COMMON_API int | CvtToInt (const char *from, void *to) |
| COMMON_API int | CvtToFloat (const char *from, void *to) |
| COMMON_API int | CvtToDouble (const char *from, void *to) |
| COMMON_API int | CvtToChar (const char *from, void *to) |
| COMMON_API int | CvtToBoolean (const char *from, void *to) |
| COMMON_API int | CvtToString (const char *from, void *to) |
| COMMON_API int | CvtToCPPStr (const char *from, void *to) |
| COMMON_API int | CvtToDimension2D (const char *from, void *to) |
| COMMON_API int | CvtToDimension3D (const char *from, void *to) |
| COMMON_API int | CvtToStrVec (const char *from, void *to) |
| COMMON_API int | CvtToIntVec (const char *from, void *to) |
| COMMON_API int | CvtToSize_tVec (const char *from, void *to) |
| COMMON_API int | CvtToFloatVec (const char *from, void *to) |
| COMMON_API int | CvtToDoubleVec (const char *from, void *to) |
| COMMON_API int | CvtToIntRange (const char *from, void *to) |
| COMMON_API TIME64_T | MkTime64 (struct tm *t) |
| COMMON_API struct tm * | LocalTime64_r (const TIME64_T *t, struct tm *p) |
| COMMON_API struct tm * | GmTime64_r (const TIME64_T *t, struct tm *p) |
| COMMON_API std::string | GetResourcePath (const std::string &name) |
| COMMON_API std::string | GetSharePath (const std::string &name) |
| COMMON_API std::string | GetPythonPath () |
| COMMON_API std::string | GetPythonVersion () |
| COMMON_API std::string | GetPythonDir () |
| COMMON_API void | RegisterResourceFinder (std::string(*cb)(const std::string &)) |
| COMMON_API size_t | LinearizeCoords (const size_t *coords, const size_t *dims, size_t n) |
| COMMON_API size_t | LinearizeCoords (const std::vector< size_t > &coords, const std::vector< size_t > &dims) |
| COMMON_API size_t | LinearizeCoords (const size_t *coords, const size_t *min, const size_t *max, size_t n) |
| COMMON_API size_t | LinearizeCoords (const std::vector< size_t > &coords, const std::vector< size_t > &min, const std::vector< size_t > &max) |
| COMMON_API void | IncrementCoords (const size_t *min, const size_t *max, size_t *counter, size_t n, int dim) |
| COMMON_API std::vector< size_t > | IncrementCoords (const std::vector< size_t > &min, const std::vector< size_t > &max, std::vector< size_t > counter, int dim=0) |
| COMMON_API std::vector< size_t > | Dims (const std::vector< size_t > &min, const std::vector< size_t > &max) |
| COMMON_API size_t | VProduct (const size_t *a, size_t n) |
| COMMON_API size_t | VProduct (const std::vector< size_t > &a) |
| COMMON_API void | VectorizeCoords (size_t offset, const size_t *min, const size_t *max, size_t *coords, size_t n) |
| COMMON_API std::vector< size_t > | VectorizeCoords (size_t offset, const std::vector< size_t > &min, const std::vector< size_t > &max) |
| COMMON_API void | VectorizeCoords (size_t offset, const size_t *dims, size_t *coords, size_t n) |
| COMMON_API std::vector< size_t > | VectorizeCoords (size_t offset, const std::vector< size_t > &dims) |
| COMMON_API void | Transpose (const float *a, float *b, size_t p1, size_t m1, size_t s1, size_t p2, size_t m2, size_t s2) |
| COMMON_API void | Transpose (const float *a, float *b, size_t s1, size_t s2) |
| COMMON_API bool | BinarySearchRange (const std::vector< double > &sorted, double x, size_t &i) |
| COMMON_API bool | NearlyEqual (float a, float b, float epsilon=std::numeric_limits< float >::epsilon(), float abs_th=std::numeric_limits< float >::epsilon()) |
| COMMON_API void | _VAssertFailed (const char *expr, const char *path, const unsigned int line) |
Variables | |
| const float | ABOVE_GRID = 0.f |
| const float | BELOW_GRID = 0.f |
| COMMON_API void Wasp::_VAssertFailed | ( | const char * | expr, |
| const char * | path, | ||
| const unsigned int | line | ||
| ) |
| COMMON_API bool Wasp::BinarySearchRange | ( | const std::vector< double > & | sorted, |
| double | x, | ||
| size_t & | i | ||
| ) |
| COMMON_API int Wasp::CvtToBoolean | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API int Wasp::CvtToChar | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API int Wasp::CvtToCPPStr | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API int Wasp::CvtToDimension2D | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API int Wasp::CvtToDimension3D | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API int Wasp::CvtToDouble | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API int Wasp::CvtToDoubleVec | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API int Wasp::CvtToFloat | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API int Wasp::CvtToFloatVec | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API int Wasp::CvtToInt | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API int Wasp::CvtToIntRange | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API int Wasp::CvtToIntVec | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API int Wasp::CvtToSize_tVec | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API int Wasp::CvtToString | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API int Wasp::CvtToStrVec | ( | const char * | from, |
| void * | to | ||
| ) |
| COMMON_API std::vector< size_t > Wasp::Dims | ( | const std::vector< size_t > & | min, |
| const std::vector< size_t > & | max | ||
| ) |
Return the dimesions of a subregion
return the dimensions of a subregion enclosed by min and max
| COMMON_API std::string Wasp::GetAppPath | ( | const string & | app, |
| const string & | name, | ||
| const vector< string > & | paths, | ||
| bool | forwardSeparator = true |
||
| ) |
| COMMON_API unsigned long long Wasp::GetBits64 | ( | unsigned long long | targ, |
| int | pos, | ||
| int | n | ||
| ) |
Retrieve a sequence of bits
Extract n bits from targ starting at position pos counting from the left. E.g. GetBits64(I,4,3) will extract bits at bit position 4,3,2, right adjusted
| returns | the extracted bits |
| COMMON_API std::string Wasp::GetEnvironmentalVariable | ( | const std::string & | name | ) |
| COMMON_API std::string Wasp::GetPythonDir | ( | ) |
Returns python home e.g. if python if installed in /home/lib/python2.7 this will return /home on Linux/Mac but it will return /home/lib/python2.7 on Windows
| COMMON_API std::string Wasp::GetPythonPath | ( | ) |
Returns full python installation path e.g. /home/lib/python2.7
| COMMON_API std::string Wasp::GetPythonVersion | ( | ) |
Returns python version e.g. 3.6
| COMMON_API std::string Wasp::GetResourcePath | ( | const std::string & | name | ) |
| COMMON_API std::string Wasp::GetSharePath | ( | const std::string & | name | ) |
Referenced by VAPoR::SetHDF5PluginPath().
| COMMON_API double Wasp::GetTime | ( | ) |
| COMMON_API struct tm * Wasp::GmTime64_r | ( | const TIME64_T * | t, |
| struct tm * | p | ||
| ) |
| COMMON_API int Wasp::ILog2 | ( | int | n | ) |
| COMMON_API void Wasp::IncrementCoords | ( | const size_t * | min, |
| const size_t * | max, | ||
| size_t * | counter, | ||
| size_t | n, | ||
| int | dim | ||
| ) |
Increment a coordinate vector by one
Increments counter along the dimension dim by one within the range of min to max. Overflow is possible, resulting in wraparound and setting counter back to min
| COMMON_API std::vector< size_t > Wasp::IncrementCoords | ( | const std::vector< size_t > & | min, |
| const std::vector< size_t > & | max, | ||
| std::vector< size_t > | counter, | ||
| int | dim = 0 |
||
| ) |
|
inline |
| COMMON_API int Wasp::IsPowerOfTwo | ( | unsigned int | x | ) |
Return true if power of two.
Returns a non-zero value if the input parameter is a power of two
| [in] | x | An integer |
| status |
| COMMON_API size_t Wasp::LinearizeCoords | ( | const size_t * | coords, |
| const size_t * | dims, | ||
| size_t | n | ||
| ) |
Linearize multi-dimensional coordinates
Convert multi-dimensional coordinates, coords, for a space with dimensions, dims, to a linear offset from the origin of dims
| [in] | coords | A vector of integer coordinates into a an array with dimensions given by dims. The minimum coordinate value is zero. The maximum coordinate value is dims[i] - 1. |
| [in] | dims | A vector defining the dimensions of an array. The size of dims must equal size of coords. |
| offset | The offset from the first element of the array to the address specified by coords |
| COMMON_API size_t Wasp::LinearizeCoords | ( | const size_t * | coords, |
| const size_t * | min, | ||
| const size_t * | max, | ||
| size_t | n | ||
| ) |
Linearize multi-dimensional coordinates
Convert multi-dimensional coordinates, coords, for a space with minimum and maximum coordinates given by min, and max, respectively.
| [in] | coords | A vector of integer coordinates into a an array with boundaries defined by min and max. The minimum coordinate value is min[i] and the maximum is max[i]. |
| [in] | min | Minimum valid coordinate value |
| [in] | min | Maximum valid coordinate value |
| offset | The offset from the first element of the array to the address specified by coords |
| COMMON_API size_t Wasp::LinearizeCoords | ( | const std::vector< size_t > & | coords, |
| const std::vector< size_t > & | dims | ||
| ) |
| COMMON_API size_t Wasp::LinearizeCoords | ( | const std::vector< size_t > & | coords, |
| const std::vector< size_t > & | min, | ||
| const std::vector< size_t > & | max | ||
| ) |
| COMMON_API struct tm * Wasp::LocalTime64_r | ( | const TIME64_T * | t, |
| struct tm * | p | ||
| ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| COMMON_API int Wasp::MkDirHier | ( | const std::string & | dir | ) |
| COMMON_API TIME64_T Wasp::MkTime64 | ( | struct tm * | t | ) |
| COMMON_API bool Wasp::NearlyEqual | ( | float | a, |
| float | b, | ||
| float | epsilon = std::numeric_limits< float >::epsilon(), |
||
| float | abs_th = std::numeric_limits< float >::epsilon() |
||
| ) |
Floating point comparison for near equality.
Perform a floating point comparison to see if two values are nearly equal;
For values close to zero the comparison is made directly againt abs_th.
For values not close to zero the comparison is made against epsilon multiplied by the magnitude of a + b.
See https://stackoverflow.com/questions/4915462/how-should-i-do-floating-point-comparison
| COMMON_API double Wasp::ran1 | ( | long * | ) |
| COMMON_API void Wasp::RegisterResourceFinder | ( | std::string(*)(const std::string &) | cb | ) |
Register an additional function which returns a path for a given resource. This function will be given precidence over the default resource search paths.
| COMMON_API unsigned long long Wasp::SetBits64 | ( | unsigned long long | targ, |
| int | pos, | ||
| int | n, | ||
| unsigned long long | src | ||
| ) |
Set a sequence of bits
Set n bits in targ starting at position pos counting from the left. The bits are obtained from src
| returns | \targ with the indicated bits set |
| COMMON_API void Wasp::Splitpath | ( | std::string | path, |
| std::string & | volume, | ||
| std::string & | dir, | ||
| std::string & | file, | ||
| bool | nofile | ||
| ) |
| COMMON_API std::vector< double > & Wasp::SplitString | ( | const std::string & | s, |
| char | delim, | ||
| std::vector< double > & | elems | ||
| ) |
| COMMON_API std::vector< float > & Wasp::SplitString | ( | const std::string & | s, |
| char | delim, | ||
| std::vector< float > & | elems | ||
| ) |
| COMMON_API std::vector< int > & Wasp::SplitString | ( | const std::string & | s, |
| char | delim, | ||
| std::vector< int > & | elems | ||
| ) |
| COMMON_API std::vector< size_t > & Wasp::SplitString | ( | const std::string & | s, |
| char | delim, | ||
| std::vector< size_t > & | elems | ||
| ) |
| COMMON_API std::vector< std::string > & Wasp::SplitString | ( | const std::string & | s, |
| char | delim, | ||
| std::vector< std::string > & | elems | ||
| ) |
| COMMON_API int Wasp::StrCmpNoCase | ( | const string & | s, |
| const string & | t | ||
| ) |
Case-insensitive string comparison.
Performs a case-insensitive comparison of two C++ strings. Behaviour is otherwise identical to the C++ std::string.compare() method.
| COMMON_API void Wasp::StrRmWhiteSpace | ( | string & | s | ) |
Remove white space from a string.
Performs in-place removal of all white space from a string.
| [in,out] | s | The string. |
| COMMON_API void Wasp::StrToWordVec | ( | const string & | s, |
| vector< string > & | v | ||
| ) |
Parse a string, returning a vector of words.
Parses a string containing a white-space delimited collection of words. The words are in order of occurence and returned as a vector of strings with all white space removed.
| [in] | s | The input string. |
| [out] | v | The output vector. |
| COMMON_API void Wasp::Transpose | ( | const float * | a, |
| float * | b, | ||
| size_t | p1, | ||
| size_t | m1, | ||
| size_t | s1, | ||
| size_t | p2, | ||
| size_t | m2, | ||
| size_t | s2 | ||
| ) |
| COMMON_API void Wasp::Transpose | ( | const float * | a, |
| float * | b, | ||
| size_t | s1, | ||
| size_t | s2 | ||
| ) |
| COMMON_API void Wasp::VectorizeCoords | ( | size_t | offset, |
| const size_t * | dims, | ||
| size_t * | coords, | ||
| size_t | n | ||
| ) |
Vectorize a coordinate offset. Inverse of VectorizeLinearize
| COMMON_API void Wasp::VectorizeCoords | ( | size_t | offset, |
| const size_t * | min, | ||
| const size_t * | max, | ||
| size_t * | coords, | ||
| size_t | n | ||
| ) |
Vectorize a coordinate offset. Inverse of VectorizeLinearize
| COMMON_API std::vector< size_t > Wasp::VectorizeCoords | ( | size_t | offset, |
| const std::vector< size_t > & | dims | ||
| ) |
| COMMON_API std::vector< size_t > Wasp::VectorizeCoords | ( | size_t | offset, |
| const std::vector< size_t > & | min, | ||
| const std::vector< size_t > & | max | ||
| ) |
| COMMON_API size_t Wasp::VProduct | ( | const size_t * | a, |
| size_t | n | ||
| ) |
Return the scalar product of the elements of a vector
| COMMON_API size_t Wasp::VProduct | ( | const std::vector< size_t > & | a | ) |
| const float Wasp::ABOVE_GRID = 0.f |