AQUAgpusph 4.1.2
|
Main AQUAgpusph namespace. More...
Namespaces | |
namespace | CalcServer |
Calculation server name space. | |
namespace | InputOutput |
Input/Output data interfaces. | |
Data Structures | |
class | Singleton |
Simple but versatile singleton instance (Meyers singleton). More... | |
class | Tokenizer |
Tool to evaluate math expressions. More... | |
Enumerations | |
enum | TLogLevel { L_DEBUG , L_INFO , L_WARNING , L_ERROR } |
Functions | |
int | isKeyPressed () |
Returns if a key press event has been registered. | |
bool | hasPrefix (const std::string &str, const std::string &prefix) |
Check if a string starts with an specific prefix. | |
bool | hasSuffix (const std::string &str, const std::string &suffix) |
Check if a string ends with an specific suffix. | |
void | replaceAll (std::string &str, const std::string &search, const std::string &replace) |
Replace all substring occurrences by another substring. | |
std::string | replaceAllCopy (std::string str, std::string search, std::string replace) |
Replace all substring occurrences by another substring. | |
void | ltrim (std::string &s) |
Remove all the blank spaces (including line breaks, tabulators...) string prefix. | |
void | rtrim (std::string &s) |
Remove all the blank spaces (including line breaks, tabulators...) string suffix. | |
void | trim (std::string &s) |
Remove all the blank spaces (including line breaks, tabulators...) string prefix and suffix. | |
std::string | ltrimCopy (std::string s) |
Remove all the blank spaces (including line breaks, tabulators...) string suffix. | |
std::string | rtrimCopy (std::string s) |
Remove all the blank spaces (including line breaks, tabulators...) string suffix. | |
std::string | trimCopy (std::string s) |
Remove all the blank spaces (including line breaks, tabulators...) string prefix and suffix. | |
std::string | xxd2string (unsigned char *arr, unsigned int len) |
Transform a xxd exported file into a C++ string. | |
void | toLower (std::string &str) |
Convert a string to lower case. | |
std::string | toLowerCopy (std::string str) |
Convert a string to lower case. | |
void | setStrConstants (std::string &str) |
Set several constants into a string. | |
std::string | setStrConstantsCopy (std::string str) |
Set several constants into a string. | |
std::vector< std::string > | split (std::string str, char chr) |
Split a string by a character. | |
std::vector< std::string > | split_formulae (std::string str) |
Split a list of split_formulae. | |
std::string | newFilePath (const std::string &basename, unsigned int &i, unsigned int digits=5) |
Look for a file path which is not already taken. | |
unsigned int | nextPowerOf2 (unsigned int x) |
Next number which is power of 2. | |
unsigned int | isPowerOf2 (unsigned int x) |
Check if a number is power of 2. | |
unsigned int | roundUp (unsigned int x, unsigned int divisor) |
Rounded up value which is divisible by <strong class=. | |
int | round (float n) |
Round an float value to an integer one. | |
const std::string | getFolderFromFilePath (const std::string file_path) |
Gets the folder path which contains the file <strong class=. | |
const std::string | getFileNameFromFilePath (const std::string file_path) |
Gets the file name of the path <strong class=. | |
const std::string | getExtensionFromFilePath (const std::string file_path) |
Gets the file extension. | |
bool | isFile (const std::string file_name) |
Check if the file <strong class= exist on the system. | |
bool | isRelativePath (const std::string path) |
Check if the path <strong class= is a relative or an absolute one. | |
size_t | getLocalWorkSize (cl_uint n, cl_command_queue queue) |
Compute the maximum local work size allowed by a device. | |
size_t | getGlobalWorkSize (cl_uint n, size_t local_work_size) |
Compute the global work size needed to compute <strong class= threads. | |
vec | Vzero () |
Return a null vector. | |
vec | Vx () |
Return the x direction unit vector. | |
vec | Vy () |
Return the y direction unit vector. | |
vec | Vz () |
Return the z direction unit vector. | |
vec | mult (float n, vec v) |
Multiply a vector by a scalar. | |
vec | add (vec a, vec b) |
Adding operation. | |
vec | sub (vec a, vec b) |
Subtracting operation. | |
float | dot (vec a, vec b) |
Inner product. | |
float | length (vec v) |
Compute the vector length. | |
vec | normalize (vec v) |
Compute a normalized vector copy (such that length() will return 1.0. | |
vec | cross (vec a, vec b) |
Cross product. | |
unsigned int | numberOfDigits (unsigned int number) |
Get the number of digits of an integer decimal text representation. | |
double | mod_operator (double v, double w) |
double | not_operator (double v) |
template<typename T > | |
T | min (T a, T b) |
Gets the minimum of two values. | |
template<typename T > | |
T | max (T a, T b) |
Gets the maximum of two values. | |
float | clamp (float x, float a, float b) |
Clamps a value between the bounds. | |
Variables | |
static std::string | folder |
static std::string | filename |
static std::string | extension |
Main AQUAgpusph namespace.
enum Aqua::TLogLevel |
Adding operation.
a | Vector to operate. |
b | Vector to operate. |
|
inline |
Clamps a value between the bounds.
x | Value to adjust into the bounds. |
a | Minimum value. |
b | Maximum value. |
Cross product.
a | Vector to operate. |
b | Vector to operate. |
Inner product.
a | Vector to operate. |
b | Vector to operate. |
const std::string Aqua::getExtensionFromFilePath | ( | const std::string | file_path | ) |
Gets the file extension.
Get the file extension from the full file path <strong class=.
file_path | The file path. |
const std::string Aqua::getFileNameFromFilePath | ( | const std::string | file_path | ) |
Gets the file name of the path <strong class=.
file_path | The file path. |
const std::string Aqua::getFolderFromFilePath | ( | const std::string | file_path | ) |
Gets the folder path which contains the file <strong class=.
file_path | The file path. |
size_t Aqua::getGlobalWorkSize | ( | cl_uint | n, |
size_t | local_work_size | ||
) |
Compute the global work size needed to compute <strong class= threads.
n | Amount of data to operate in kernel (aiming threads to launch). |
local_work_size | The local work size which will be applied. |
size_t Aqua::getLocalWorkSize | ( | cl_uint | n, |
cl_command_queue | queue | ||
) |
Compute the maximum local work size allowed by a device.
n | Amount of data to operate in kernel (aiming threads to launch). |
queue | Command queue. |
bool Aqua::hasPrefix | ( | const std::string & | str, |
const std::string & | prefix | ||
) |
Check if a string starts with an specific prefix.
str | String to be checked |
prefix | Prefix to be looked for |
bool Aqua::hasSuffix | ( | const std::string & | str, |
const std::string & | suffix | ||
) |
Check if a string ends with an specific suffix.
str | String to be checked |
suffix | Suffix to be looked for |
bool Aqua::isFile | ( | const std::string | file_name | ) |
Check if the file <strong class= exist on the system.
file_name | The file path. |
int Aqua::isKeyPressed | ( | ) |
Returns if a key press event has been registered.
unsigned int Aqua::isPowerOf2 | ( | unsigned int | x | ) |
Check if a number is power of 2.
Compute if a value is power of 2.
x | Value to test. |
bool Aqua::isRelativePath | ( | const std::string | path | ) |
Check if the path <strong class= is a relative or an absolute one.
path | The path. |
float Aqua::length | ( | vec | v | ) |
Compute the vector length.
v | Input vector. |
void Aqua::ltrim | ( | std::string & | s | ) |
Remove all the blank spaces (including line breaks, tabulators...) string prefix.
s | String to become trimmed |
std::string Aqua::ltrimCopy | ( | std::string | s | ) |
Remove all the blank spaces (including line breaks, tabulators...) string suffix.
s | String to become trimmed |
|
inline |
Gets the maximum of two values.
a | First value. |
b | Second value. |
|
inline |
Gets the minimum of two values.
a | First value. |
b | Second value. |
double Aqua::mod_operator | ( | double | v, |
double | w | ||
) |
Multiply a vector by a scalar.
n | Scalar to operate. |
v | Vector to operate. |
std::string Aqua::newFilePath | ( | const std::string & | basename, |
unsigned int & | i, | ||
unsigned int | digits = 5 |
||
) |
Look for a file path which is not already taken.
Several scape strings can be used, that will be replaced as follows:
"%d"
/"{index}"
will be replaced by the first integer which results in a non-existing file path"{mpi_rank}"
will be replaced by the process identifier index"{version}"
will be replaced by the AQUAgpusph package versionIn case a file path cannot be obtained, a std::invalid_argument exception will be raised.
basename | The base name of the file |
i | First index that will be checked. Also, the resulting file index is stored in this variable. |
unsigned int Aqua::nextPowerOf2 | ( | unsigned int | x | ) |
Next number which is power of 2.
Compute a value which, being power of two, is greater or equal than <strong class=.
x | Number to round up to a power of two. |
double Aqua::not_operator | ( | double | v | ) |
unsigned int Aqua::numberOfDigits | ( | unsigned int | number | ) |
Get the number of digits of an integer decimal text representation.
number | Number from which the number of digits should be computed. |
void Aqua::replaceAll | ( | std::string & | str, |
const std::string & | search, | ||
const std::string & | replace | ||
) |
Replace all substring occurrences by another substring.
str | String to be modified |
search | Substring to be replaced |
replace | Replacement substring |
std::string Aqua::replaceAllCopy | ( | std::string | str, |
std::string | search, | ||
std::string | replace | ||
) |
Replace all substring occurrences by another substring.
str | String to be modified |
search | Substring to be replaced |
replace | Replacement substring |
int Aqua::round | ( | float | n | ) |
Round an float value to an integer one.
n | Number to round. |
unsigned int Aqua::roundUp | ( | unsigned int | x, |
unsigned int | divisor | ||
) |
Rounded up value which is divisible by <strong class=.
Compute a value, which being divisible by <strong class=, is greater or equal than <strong class=.
x | Number to round up. |
divisor | Divisor. |
void Aqua::rtrim | ( | std::string & | s | ) |
Remove all the blank spaces (including line breaks, tabulators...) string suffix.
s | String to become trimmed |
std::string Aqua::rtrimCopy | ( | std::string | s | ) |
Remove all the blank spaces (including line breaks, tabulators...) string suffix.
s | String to become trimmed |
void Aqua::setStrConstants | ( | std::string & | str | ) |
Set several constants into a string.
Following scape strings can be used, that will be replaced as follows:
"{mpi_rank}"
will be replaced by the process identifier index"{version}"
will be replaced by the AQUAgpusph package versionstr | The string where constants shall be set |
std::string Aqua::setStrConstantsCopy | ( | std::string | str | ) |
Set several constants into a string.
Following scape strings can be used, that will be replaced as follows:
"{mpi_rank}"
will be replaced by the process identifier index"{version}"
will be replaced by the AQUAgpusph package versionstr | The string where constants shall be set |
std::vector< std::string > Aqua::split | ( | std::string | str, |
char | chr | ||
) |
Split a string by a character.
str | String to be split |
chr | Splitting cahracter |
std::vector< std::string > Aqua::split_formulae | ( | std::string | str | ) |
Split a list of split_formulae.
Formulae can be separated either by semicolon, ';', or by simple comma, ','. This function already takes care of parentheses, but it is not checking for syntax errors
str | String within formulae |
Subtracting operation.
a | Vector to operate. |
b | Vector to operate. |
void Aqua::toLower | ( | std::string & | str | ) |
Convert a string to lower case.
std::string Aqua::toLowerCopy | ( | std::string | str | ) |
Convert a string to lower case.
void Aqua::trim | ( | std::string & | s | ) |
Remove all the blank spaces (including line breaks, tabulators...) string prefix and suffix.
s | String to become trimmed |
std::string Aqua::trimCopy | ( | std::string | s | ) |
Remove all the blank spaces (including line breaks, tabulators...) string prefix and suffix.
s | String to become trimmed |
vec Aqua::Vx | ( | ) |
Return the x direction unit vector.
vec Aqua::Vy | ( | ) |
Return the y direction unit vector.
vec Aqua::Vz | ( | ) |
Return the z direction unit vector.
vec Aqua::Vzero | ( | ) |
Return a null vector.
std::string Aqua::xxd2string | ( | unsigned char * | arr, |
unsigned int | len | ||
) |
Transform a xxd exported file into a C++ string.
xdd can be used to embed external files into the program source code, by means of an include statement. However, the data is exported as a non-null terminated char array and its length. This method is appending the null character, and building a C++ string
arr | C-Like chars array |
len | C-Like chars array length |
|
static |
|
static |
|
static |