Summary
Members | Descriptions |
---|---|
define INLINE |
If defined, funstions will be marked as inline. |
define AI_DIRENT_SUPPORT |
|
define AI_GCC5_SUPPORT |
|
define AI_SHELL_SUPPORT |
|
define STRINGIFY |
Convert a variable name into text. |
define TO_STRING |
Convert a variable value into text. |
define PRINT_LINE |
Print the line number. |
namespace ai |
Main namespace. |
Members
define
INLINE
If defined, funstions will be marked as inline.
If defined, funstions will be marked as inline. Comment the line if you want to omit this behavior
define
AI_DIRENT_SUPPORT
define
AI_GCC5_SUPPORT
define
AI_SHELL_SUPPORT
define
STRINGIFY
Convert a variable name into text.
This macro converts a variable name into text, which is useful for debugging
define
TO_STRING
Convert a variable value into text.
This macro converts a variable value into text, so you can access the constants defined at compile time as std::string
define
PRINT_LINE
Print the line number.
This macro prints the line number on which it was called
namespace ai
Main namespace.
Main namespace containing all the functions of AiLibrary
Summary
Members | Descriptions |
---|---|
public INLINE std::string getVersion () |
Get version of the library. |
public template<> INLINE std::string string (const T value) |
Converts input into a string. |
public INLINE bool hasPrefix (const std::string & text,const std::string & prefix) |
Checks if a string begins with a substring. |
public INLINE bool hasSuffix (const std::string & text,const std::string & suffix) |
Checks if a string ends with a substring. |
public INLINE bool contains (const std::string & text,const std::string & substring) |
Checks if a string contains a substring. |
public INLINE std::string replace (std::string text,const std::string & substring,const std::string & replacement) |
Replaces all occurrences of a substring in a copy of the initial string with your text. |
public INLINE void applyReplace (std::string & text,const std::string & substring,const std::string & replacement) |
Modifies your string by replacing all occurrences of a substring string with your text. |
public INLINE bool equal (const char * charString,const std::string string1) |
Checks if a char string is equal to a std::string. |
public INLINE std::string toUpperCase (std::string input) |
Convert a string to upper case. |
public INLINE std::string toLowerCase (std::string input) |
Convert a string to lower case. |
public template<> INLINE std::string prependNumber (const T value,const std::size_t symbolsBeforePoint,const char symbolToPrepend) |
|
public INLINE std::size_t counter (const std::size_t value) |
Returns ID starting from zero or the specified value. |
public INLINE std::string marker (const std::size_t value) |
Returns a string containing the word “Marker” and its ID. |
public INLINE void printMarker (const std::size_t value) |
Calls marker() and prints result to stdout. |
public template<> INLINE T sign (const T value) |
Returns signum of the value. |
public template<> INLINE T min (const T a,const T b) |
Returns minimum of two values. |
public template<> INLINE T max (const T a,const T b) |
Returns maximum of two values. |
public template<> INLINE T min (const std::vector< T > & input) |
Returns minimum of vector values. |
public template<> INLINE T max (const std::vector< T > & input) |
Returns maximum of vector values. |
public template<> INLINE T min (const std::vector< std::vector< T > > & input) |
Returns minimum of matrix values. |
public template<> INLINE T max (const std::vector< std::vector< T > > & input) |
Returns maximum of matrix values. |
public template<> INLINE bool isSquare (const T value) |
Checks if number is square. |
public template<> INLINE bool isSquare (const std::vector< std::vector< T > > & matrix) |
Checks if matrix is square. |
public template<> INLINE void generateRandomVector (std::vector< T > & vector,const std::size_t length,const T min,const T max) |
|
public template<> INLINE void generateRandomMatrix (std::vector< std::vector< T > > & matrix,const std::size_t xSize,const std::size_t ySize,const T min,const T max) |
Fill matrix with random values. |
public template<> INLINE void generateRandomMatrix (std::vector< std::vector< T > > & matrix,const std::size_t size,const T min,const T max) |
Fill matrix with random values. |
public template<> void rotateMatrix (std::vector< std::vector< T > > & matrix,const bool rotateClockwise) |
Rotate square matrix. |
public template<> INLINE void inverseMatrix (std::vector< std::vector< T > > matrix,std::vector< std::vector< T > > & inverse) |
|
public template<> INLINE void inverseMatrix (std::vector< std::vector< T > > & matrix) |
|
public template<> INLINE void translateMatrixIntoVector (std::vector< std::vector< T > > & matrix,std::vector< T > & vector) |
Elongates matrix into a vector. |
public template<> INLINE void translateVectorIntoSquareMatrix (std::vector< T > & vector,std::vector< std::vector< T > > & matrix) |
Transform vector into a square matrix (if possible) |
public template<> INLINE void generateCirculantMatrix (std::vector< std::vector< T > > & matrix,std::vector< T > & source,const bool moveToTheRight) |
|
public template<> INLINE void multiply (const std::vector< std::vector< T > > & left,const std::vector< std::vector< T > > & right,std::vector< std::vector< T > > & result) |
|
public template<> INLINE void multiply (const std::vector< std::vector< T > > & left,const std::vector< T > & right,std::vector< T > & result) |
|
public template<> INLINE void multiply (const std::vector< T > & left,const std::vector< T > & right,T & result) |
Calculate vector-vector multiplication. |
public template<> INLINE void multiplyElementWise (const std::vector< std::vector< T > > & left,const std::vector< std::vector< T > > & right,std::vector< std::vector< T > > & result) |
|
public template<> INLINE void multiplyElementWise (const std::vector< T > & left,const std::vector< T > & right,std::vector< T > & result) |
|
public template<> INLINE void multiplyComplexElementWise (const std::vector< std::vector< T > > & left,const std::vector< std::vector< T > > & right,std::vector< std::vector< T > > & result) |
#### Parameters |
public template<> INLINE std::string complexIntoString (const std::vector< T > complexValue) |
#### Parameters |
public template<> INLINE void conjugate (std::vector< std::vector< T > > & complexVector) |
#### Parameters |
public template<> INLINE void fft (std::vector< std::vector< T > > & complexVector) |
#### Parameters |
public template<> INLINE void ifft (std::vector< std::vector< T > > & complexVector) |
#### Parameters |
public INLINE std::chrono::high_resolution_clock::time_point time () |
Returns current time point. |
public INLINE std::chrono::system_clock::time_point systemTime () |
Returns current time point. |
public INLINE double duration (const std::chrono::high_resolution_clock::time_point start,const std::chrono::high_resolution_clock::time_point finish,const std::string scale) |
|
public INLINE double duration (const std::chrono::high_resolution_clock::time_point start,const std::string scale) |
|
public INLINE void printDuration (const std::chrono::high_resolution_clock::time_point start,const std::chrono::high_resolution_clock::time_point finish,const std::string scale,const std::size_t count) |
|
public INLINE void printDuration (const std::chrono::high_resolution_clock::time_point start,const std::string scale,const std::size_t count) |
|
public INLINE std::string getDateAndTime (std::chrono::system_clock::time_point timePoint) |
Get date and time. |
public INLINE std::string getDate (std::chrono::system_clock::time_point timePoint) |
Get date. |
public INLINE std::string getTime (std::chrono::system_clock::time_point timePoint) |
Get time. |
public INLINE std::string parseParameter (const char * input,const std::string name) |
|
public template<> INLINE void assignFromVectorByIntervalCondition (T & value,const T parameter,const std::vector< std::vector< T > > intervals) |
#### Parameters |
public template<> INLINE void assignFromVectorByIntervalCondition (T & firstValue,T & secondValue,const T parameter,const std::vector< std::vector< T > > intervals) |
#### Parameters |
public INLINE bool assignBooleanParameter (const char * input,const std::string name,bool & value) |
|
public INLINE bool assignCharParameter (const char * input,const std::string name,char & value) |
|
public INLINE bool assignStringParameter (const char * input,const std::string name,std::string & value) |
|
public template<> INLINE bool assignParameter (const char * input,const std::string name,T & value) |
#### Parameters |
public INLINE bool assignAbsDoubleParameter (const char * input,const std::string name,double & value) |
|
public template<> INLINE bool assignByCheckingParameter (const char * input,const std::string parameter,T & value,const T supposed) |
#### Parameters |
public INLINE void clearScreen () |
|
public INLINE void setLocale (const std::string locale) |
|
public INLINE void showProgressBar (double progress,const int screenWidth) |
|
public INLINE void printLine (const std::string line,const int screenWidth) |
|
public template<> INLINE void parseFileInMatrix (const std::string filename,const char separator,std::vector< std::vector< T > > & matrix) |
#### Parameters |
public template<> INLINE void parseFileInVector (const std::string filename,const char separator,std::vector< T > & vector) |
#### Parameters |
public INLINE void parseFileIntoString (const std::string filename,std::string & content) |
#### Exceptions |
public template<> INLINE void accumulateFileInMatrix (const std::string filename,const char separator,std::vector< std::vector< T > > & matrix) |
#### Parameters |
public template<> INLINE void accumulateFileInVector (const std::string filename,const char separator,std::vector< T > & vector,const bool checkForNaN) |
#### Parameters |
public template<> INLINE void printMatrix (const std::vector< std::vector< T > > & matrix,const bool transpose,const int precision) |
#### Parameters |
public template<> INLINE void printVector (const std::vector< T > & vector,const int precision) |
#### Parameters |
public template<> INLINE void print (const std::vector< std::vector< T > > & matrix,const bool transpose,const int precision) |
#### Parameters |
public template<> INLINE void print (const std::vector< T > & vector,const int precision) |
#### Parameters |
public template<> INLINE void print (const T value,const std::string name) |
#### Parameters |
public static std::string black ("\30m") |
Terminal color code for black. |
public static std::string red ("\31m") |
Terminal color code for red. |
public static std::string green ("\32m") |
Terminal color code for green. |
public static std::string yellow ("\33m") |
Terminal color code for yellow. |
public static std::string blue ("\34m") |
Terminal color code for blue. |
public static std::string magenta ("\35m") |
Terminal color code for magenta. |
public static std::string cyan ("\36m") |
Terminal color code for cyan. |
public static std::string white ("\37m") |
Terminal color code for white. |
public static std::string bold ("\1m") |
Terminal style code for bold. |
public static std::string underline ("\4m") |
Terminal style code for underline. |
public static std::string reset ("\0m") |
Terminal code to reset special formatting. |
public template<> INLINE void printStyle (const T income,const std::string style) |
#### Parameters |
public template<> INLINE void printBlack (const T income) |
#### Parameters |
public template<> INLINE void printRed (const T income) |
#### Parameters |
public template<> INLINE void printGreen (const T income) |
#### Parameters |
public template<> INLINE void printYellow (const T income) |
#### Parameters |
public template<> INLINE void printBlue (const T income) |
#### Parameters |
public template<> INLINE void printMagenta (const T income) |
#### Parameters |
public template<> INLINE void printCyan (const T income) |
#### Parameters |
public template<> INLINE void printWhite (const T income) |
#### Parameters |
public template<> INLINE void printBold (const T income) |
#### Parameters |
public template<> INLINE void printUnderline (const T income) |
#### Parameters |
public INLINE void printAllStyles () |
|
public INLINE void clearStyles () |
|
public template<> INLINE void saveMatrix (const std::string filename,const std::vector< std::vector< T > > & matrix,std::string comment,const bool transpose,std::string type,std::string delimiter,const std::size_t tokenWidth) |
#### Parameters |
public template<> INLINE void saveVector (const std::string filename,const std::vector< T > & vector,std::string comment,std::string type,std::string delimiter) |
#### Parameters |
public INLINE void saveLine (const std::string filename,const std::string line,std::string comment) |
#### Exceptions |
public template<> INLINE void save (const std::string filename,const std::vector< std::vector< T > > & matrix,std::string comment) |
|
public template<> INLINE void save (const std::string filename,const std::vector< T > & vector,std::string comment) |
|
public template<> INLINE void save (const std::string filename,const std::string line,std::string comment) |
|
public INLINE void saveLog (const std::string filename,std::string log,const bool timestamp,const std::string stampSeparator) |
#### Exceptions |
public INLINE void saveLog (const std::string filename,std::vector< std::string > & logs,const bool timestamp,const std::string stampSeparator) |
#### Exceptions |
public template<> INLINE bool loadA3R (const std::string filename,std::vector< std::vector< T > > & positions,double & radius) |
#### Parameters |
public template<> INLINE bool saveA3R (const std::string filename,const std::vector< std::vector< T > > & positions,const double radius) |
#### Parameters |
public template<> INLINE void loadXYZ (const std::string filename,std::vector< std::vector< T > > & matrix) |
#### Parameters |
public template<> INLINE void saveXYZ (const std::string filename,const std::vector< std::vector< T > > & matrix,const std::vector< T > & tones,std::string elementName) |
#### Parameters |
public template<> INLINE void saveXYZ (const std::string filename,const std::vector< std::vector< T > > & matrix,std::string elementName) |
#### Parameters |
public INLINE bool folderExists (const std::string name) |
Check if folder exists. |
public INLINE std::size_t countLinesInFile (const std::string filename,const std::string token) |
|
public INLINE std::vector< std::string > listFilesWithExtension (std::string path,const std::string extension,const std::string prefix,const bool addPathToFileNames) |
|
public INLINE std::string execute (const std::string command) |
Members
public
INLINE
std::string
getVersion
()
Get version of the library.
This function returns version of the AiLibrary (we use SemVer)
Returns
Version as a string
See also: https://semver.org
public template<>
INLINE
std::string
string
(const T value)
Converts input into a string.
This function converts your variable into std::string using std::ostringstream
Parameters
T
Any printable type
Parameters
value
Your variable to convert
Returns
std::string copy of your input
public
INLINE
bool
hasPrefix
(const std::string & text,const std::string & prefix)
Checks if a string begins with a substring.
This function checks if a string begins with a substring
Parameters
-
text
Your string to test -
prefix
Your substring
Returns
True if string begins with a substring, false otherwise
public
INLINE
bool
hasSuffix
(const std::string & text,const std::string & suffix)
Checks if a string ends with a substring.
This function checks if a string ends with a substring
Parameters
-
text
Your string to test -
suffix
Your substring
Returns
True if string ends with a substring, false otherwise
public
INLINE
bool
contains
(const std::string & text,const std::string & substring)
Checks if a string contains a substring.
This function checks if a string contains a substring
Parameters
-
text
Your string to test -
substring
Your substring
Returns
True if string contains a substring, false otherwise
public
INLINE
std::string
replace
(std::string text,const std::string & substring,const std::string & replacement)
Replaces all occurrences of a substring in a copy of the initial string with your text.
This function replaces all occurrences of a substring in a string with your text and return the result. Initial string stays the same
Parameters
-
text
Your string to modify -
substring
Your substring to find in the string -
replacement
Replacement for all the substring occurrences
Returns
Modified copy of the initial string
public
INLINE
void
applyReplace
(std::string & text,const std::string & substring,const std::string & replacement)
Modifies your string by replacing all occurrences of a substring string with your text.
This function replaces all occurrences of a substring in a string with your text (modifies the initial string)
Parameters
-
text
Your string to modify -
substring
Your substring to find in the string -
replacement
Replacement for all the substring occurrences
public
INLINE
bool
equal
(const char * charString,const std::string string1)
Checks if a char string is equal to a std::string.
This function compares a char string with a std::string
Parameters
-
charString
Your char string to compare -
string1
Your std::string to compare
Returns
True if strings are equal, false otherwise
public
INLINE
std::string
toUpperCase
(std::string input)
Convert a string to upper case.
This function converts the given string to upper case and returns the result
Parameters
input
String to convert
Returns
Uppercase string
public
INLINE
std::string
toLowerCase
(std::string input)
Convert a string to lower case.
This function converts the given string to lower case and returns the result
Parameters
input
String to convert
Returns
Lowercase string
public template<>
INLINE
std::string
prependNumber
(const T value,const std::size_t symbolsBeforePoint,const char symbolToPrepend)
public
INLINE
std::size_t
counter
(const std::size_t value)
Returns ID starting from zero or the specified value.
This function returns ID (increases it at each call) starting from zero or the specified non-negative value
Parameters
value
Optional. The non-negative value to which the counter should be reset. Zero by default
Returns
Counter value
public
INLINE
std::string
marker
(const std::size_t value)
Returns a string containing the word “Marker” and its ID.
This function returns a string containing the word “marker” and its ID (increases it at each call). ID specified in the same way as in the function counter()
Parameters
value
Optional. The non-negative value to which the counter should be reset. Zero by default
Returns
Marker string
public
INLINE
void
printMarker
(const std::size_t value)
Calls marker() and prints result to stdout.
This function calls marker() and prints result to stdout
Parameters
value
Optional. The non-negative value to which the counter should be reset. Zero by default
public template<>
INLINE
T
sign
(const T value)
Returns signum of the value.
This function returns signum of the number value (usign copysign())
Parameters
T
A number type
Parameters
value
The number to which signum is applied
Returns
-1 for negative values, +1 for positive, 0 for zero
public template<>
INLINE
T
min
(const T a,const T b)
Returns minimum of two values.
This function compares two values and returns a minimum
Parameters
T
A number type
Parameters
-
a
First number -
b
Second number
Returns
Minimum of two values
public template<>
INLINE
T
max
(const T a,const T b)
Returns maximum of two values.
This function compares two values and returns a maximum
Parameters
T
A number type
Parameters
-
a
First number -
b
Second number
Returns
Maximum of two values
public template<>
INLINE
T
min
(const std::vector< T > & input)
Returns minimum of vector values.
This function compares vector values using min() and returns a minimum
Parameters
T
A number type
Parameters
input
Vector to search for a minimum value
Returns
Minimum of vector values
public template<>
INLINE
T
max
(const std::vector< T > & input)
Returns maximum of vector values.
This function compares vector values using max() and returns a maximum
Parameters
T
A number type
Parameters
input
Vector to search for a maximum value
Returns
Maximum of vector values
public template<>
INLINE
T
min
(const std::vector< std::vector< T > > & input)
Returns minimum of matrix values.
This function compares matrix values using min() and returns a minimum
Parameters
T
A number type
Parameters
input
Matrix to search for a minimum value
Returns
Minimum of matrix values
public template<>
INLINE
T
max
(const std::vector< std::vector< T > > & input)
Returns maximum of matrix values.
This function compares matrix values using max() and returns a maximum
Parameters
T
A number type
Parameters
input
Matrix to search for a maximum value
Returns
Maximum of matrix values
public template<>
INLINE
bool
isSquare
(const T value)
Checks if number is square.
This function checks if number is square
Parameters
T
A number type
Parameters
value
Number to test
Returns
True if number is a square, false otherwise
public template<>
INLINE
bool
isSquare
(const std::vector< std::vector< T > > & matrix)
Checks if matrix is square.
This function checks if matrix is square
Parameters
T
A number type
Parameters
matrix
Matrix to test
Returns
True if matrix is square, false otherwise
public template<>
INLINE
void
generateRandomVector
(std::vector< T > & vector,const std::size_t length,const T min,const T max)
public template<>
INLINE
void
generateRandomMatrix
(std::vector< std::vector< T > > & matrix,const std::size_t xSize,const std::size_t ySize,const T min,const T max)
Fill matrix with random values.
This function fills the matrix of given sizes with random values using std::random_device and generateRandomVector()
Parameters
T
A number type
Parameters
-
matrix
Matrix to fill -
xSize
Required length of the matrix -
ySize
Required height of the matrix -
min
Lower limit of generated values, no limitation by default -
max
Upper limit of generated values, no limitation by default
public template<>
INLINE
void
generateRandomMatrix
(std::vector< std::vector< T > > & matrix,const std::size_t size,const T min,const T max)
Fill matrix with random values.
This function fills the square matrix of given sizes with random values using std::random_device and generateRandomVector()
Parameters
T
A number type
Parameters
-
matrix
Matrix to fill -
size
Required size of the square matrix -
min
Lower limit of generated values, no limitation by default -
max
Upper limit of generated values, no limitation by default
public template<>
void
rotateMatrix
(std::vector< std::vector< T > > & matrix,const bool rotateClockwise)
Rotate square matrix.
This function rotates the square matrix 90 degrees clockwise or anticlockwise
Parameters
T
Any copiable type
Parameters
-
matrix
Matrix to rotate -
rotateClockwise
Optional. If true, rotate clockwise. Otherwise, rotate anticlockwise (default)
public template<>
INLINE
void
inverseMatrix
(std::vector< std::vector< T > > matrix,std::vector< std::vector< T > > & inverse)
public template<>
INLINE
void
inverseMatrix
(std::vector< std::vector< T > > & matrix)
public template<>
INLINE
void
translateMatrixIntoVector
(std::vector< std::vector< T > > & matrix,std::vector< T > & vector)
Elongates matrix into a vector.
This function converts the matrix into a vector, writing each row one after another in a line
Parameters
T
A number type
Parameters
-
matrix
Matrix to tranform -
vector
Vector to store the result
public template<>
INLINE
void
translateVectorIntoSquareMatrix
(std::vector< T > & vector,std::vector< std::vector< T > > & matrix)
Transform vector into a square matrix (if possible)
This function converts the vector into a matrix, if possible. Otherwise, an exception will be thrown at runtime
Parameters
T
A number type
Parameters
-
vector
Vector to tranform -
matrix
Matrix to store the result
Exceptions
std::runtime_error
Ifmatrix
is not square
public template<>
INLINE
void
generateCirculantMatrix
(std::vector< std::vector< T > > & matrix,std::vector< T > & source,const bool moveToTheRight)
public template<>
INLINE
void
multiply
(const std::vector< std::vector< T > > & left,const std::vector< std::vector< T > > & right,std::vector< std::vector< T > > & result)
public template<>
INLINE
void
multiply
(const std::vector< std::vector< T > > & left,const std::vector< T > & right,std::vector< T > & result)
public template<>
INLINE
void
multiply
(const std::vector< T > & left,const std::vector< T > & right,T & result)
Calculate vector-vector multiplication.
This function calculates vector-vector multiplication
Parameters
T
A number type
Parameters
-
left
Left vector to multiply -
right
Right vector to multiply -
result
Variable to store result
Exceptions
std::runtime_error
If input sizes are inappropriate
public template<>
INLINE
void
multiplyElementWise
(const std::vector< std::vector< T > > & left,const std::vector< std::vector< T > > & right,std::vector< std::vector< T > > & result)
public template<>
INLINE
void
multiplyElementWise
(const std::vector< T > & left,const std::vector< T > & right,std::vector< T > & result)
public template<>
INLINE
void
multiplyComplexElementWise
(const std::vector< std::vector< T > > & left,const std::vector< std::vector< T > > & right,std::vector< std::vector< T > > & result)
Parameters
T
A number type
public template<>
INLINE
std::string
complexIntoString
(const std::vector< T > complexValue)
Parameters
T
A number type
public template<>
INLINE
void
conjugate
(std::vector< std::vector< T > > & complexVector)
Parameters
T
A number type
public template<>
INLINE
void
fft
(std::vector< std::vector< T > > & complexVector)
Parameters
T
A number type
public template<>
INLINE
void
ifft
(std::vector< std::vector< T > > & complexVector)
Parameters
T
A number type
public
INLINE
std::chrono::high_resolution_clock::time_point
time
()
Returns current time point.
This function returns current time point using std::chrono
Returns
std::chrono::high_resolution_clock entity
public
INLINE
std::chrono::system_clock::time_point
systemTime
()
Returns current time point.
This function returns current time point using std::chrono
Returns
std::chrono::system_clock entity
public
INLINE
double
duration
(const std::chrono::high_resolution_clock::time_point start,const std::chrono::high_resolution_clock::time_point finish,const std::string scale)
public
INLINE
double
duration
(const std::chrono::high_resolution_clock::time_point start,const std::string scale)
public
INLINE
void
printDuration
(const std::chrono::high_resolution_clock::time_point start,const std::chrono::high_resolution_clock::time_point finish,const std::string scale,const std::size_t count)
public
INLINE
void
printDuration
(const std::chrono::high_resolution_clock::time_point start,const std::string scale,const std::size_t count)
public
INLINE
std::string
getDateAndTime
(std::chrono::system_clock::time_point timePoint)
Get date and time.
This function converts the given moment to std::string containing the passed date and time
Parameters
timePoint
Optional. The moment on the system clock to be converted, the current time by default
Returns
std::string with date and time in the format yyyy.mm.dd HH:MM:SS
public
INLINE
std::string
getDate
(std::chrono::system_clock::time_point timePoint)
Get date.
This function converts the given moment to std::string containing the passed date
Parameters
timePoint
Optional. The moment on the system clock to be converted, the current time by default
Returns
std::string with date in the format yyyy.mm.dd
public
INLINE
std::string
getTime
(std::chrono::system_clock::time_point timePoint)
Get time.
This function converts the given moment to std::string containing the passed time
Parameters
timePoint
Optional. The moment on the system clock to be converted, the current time by default
Returns
std::string with date time in the format HH:MM:SS
public
INLINE
std::string
parseParameter
(const char * input,const std::string name)
public template<>
INLINE
void
assignFromVectorByIntervalCondition
(T & value,const T parameter,const std::vector< std::vector< T > > intervals)
Parameters
T
Any comparable type
public template<>
INLINE
void
assignFromVectorByIntervalCondition
(T & firstValue,T & secondValue,const T parameter,const std::vector< std::vector< T > > intervals)
Parameters
T
Any comparable type
public
INLINE
bool
assignBooleanParameter
(const char * input,const std::string name,bool & value)
public
INLINE
bool
assignCharParameter
(const char * input,const std::string name,char & value)
public
INLINE
bool
assignStringParameter
(const char * input,const std::string name,std::string & value)
public template<>
INLINE
bool
assignParameter
(const char * input,const std::string name,T & value)
Parameters
T
Any printable type
public
INLINE
bool
assignAbsDoubleParameter
(const char * input,const std::string name,double & value)
public template<>
INLINE
bool
assignByCheckingParameter
(const char * input,const std::string parameter,T & value,const T supposed)
Parameters
T
Any type
public
INLINE
void
clearScreen
()
public
INLINE
void
setLocale
(const std::string locale)
public
INLINE
void
showProgressBar
(double progress,const int screenWidth)
public
INLINE
void
printLine
(const std::string line,const int screenWidth)
public template<>
INLINE
void
parseFileInMatrix
(const std::string filename,const char separator,std::vector< std::vector< T > > & matrix)
Parameters
T
Any printable type
Exceptions
std::runtime_error
If file could not be open
public template<>
INLINE
void
parseFileInVector
(const std::string filename,const char separator,std::vector< T > & vector)
Parameters
T
Any printable type
Exceptions
std::runtime_error
If file could not be open
public
INLINE
void
parseFileIntoString
(const std::string filename,std::string & content)
Exceptions
std::runtime_error
If file could not be open
public template<>
INLINE
void
accumulateFileInMatrix
(const std::string filename,const char separator,std::vector< std::vector< T > > & matrix)
Parameters
T
A number type
public template<>
INLINE
void
accumulateFileInVector
(const std::string filename,const char separator,std::vector< T > & vector,const bool checkForNaN)
Parameters
T
A number type
public template<>
INLINE
void
printMatrix
(const std::vector< std::vector< T > > & matrix,const bool transpose,const int precision)
Parameters
T
Any printable type
public template<>
INLINE
void
printVector
(const std::vector< T > & vector,const int precision)
Parameters
T
Any printable type
public template<>
INLINE
void
print
(const std::vector< std::vector< T > > & matrix,const bool transpose,const int precision)
Parameters
T
Any printable type
public template<>
INLINE
void
print
(const std::vector< T > & vector,const int precision)
Parameters
T
Any printable type
public template<>
INLINE
void
print
(const T value,const std::string name)
Parameters
T
Any printable type
public static std::string
black
("\30m")
Terminal color code for black.
This terminal control sequences sets black font color
public static std::string
red
("\31m")
Terminal color code for red.
This terminal control sequences sets red font color
public static std::string
green
("\32m")
Terminal color code for green.
This terminal control sequences sets green font color
public static std::string
yellow
("\33m")
Terminal color code for yellow.
This terminal control sequences sets yellow font color
public static std::string
blue
("\34m")
Terminal color code for blue.
This terminal control sequences sets blue font color
public static std::string
magenta
("\35m")
Terminal color code for magenta.
This terminal control sequences sets magenta font color
public static std::string
cyan
("\36m")
Terminal color code for cyan.
This terminal control sequences sets cyan font color
public static std::string
white
("\37m")
Terminal color code for white.
This terminal control sequences sets white font color
public static std::string
bold
("\1m")
Terminal style code for bold.
This terminal control sequences sets bold font style
public static std::string
underline
("\4m")
Terminal style code for underline.
This terminal control sequences sets underline font style
public static std::string
reset
("\0m")
Terminal code to reset special formatting.
This terminal control sequences resets font to the default state
public template<>
INLINE
void
printStyle
(const T income,const std::string style)
Parameters
T
Any printable type
public template<>
INLINE
void
printBlack
(const T income)
Parameters
T
Any printable type
public template<>
INLINE
void
printRed
(const T income)
Parameters
T
Any printable type
public template<>
INLINE
void
printGreen
(const T income)
Parameters
T
Any printable type
public template<>
INLINE
void
printYellow
(const T income)
Parameters
T
Any printable type
public template<>
INLINE
void
printBlue
(const T income)
Parameters
T
Any printable type
public template<>
INLINE
void
printMagenta
(const T income)
Parameters
T
Any printable type
public template<>
INLINE
void
printCyan
(const T income)
Parameters
T
Any printable type
public template<>
INLINE
void
printWhite
(const T income)
Parameters
T
Any printable type
public template<>
INLINE
void
printBold
(const T income)
Parameters
T
Any printable type
public template<>
INLINE
void
printUnderline
(const T income)
Parameters
T
Any printable type
public
INLINE
void
printAllStyles
()
public
INLINE
void
clearStyles
()
public template<>
INLINE
void
saveMatrix
(const std::string filename,const std::vector< std::vector< T > > & matrix,std::string comment,const bool transpose,std::string type,std::string delimiter,const std::size_t tokenWidth)
Parameters
T
Any printable type
Exceptions
std::runtime_error
If file could not be open
public template<>
INLINE
void
saveVector
(const std::string filename,const std::vector< T > & vector,std::string comment,std::string type,std::string delimiter)
Parameters
T
Any printable type
Exceptions
std::runtime_error
If file could not be open
public
INLINE
void
saveLine
(const std::string filename,const std::string line,std::string comment)
Exceptions
std::runtime_error
If file could not be open
public template<>
INLINE
void
save
(const std::string filename,const std::vector< std::vector< T > > & matrix,std::string comment)
public template<>
INLINE
void
save
(const std::string filename,const std::vector< T > & vector,std::string comment)
public template<>
INLINE
void
save
(const std::string filename,const std::string line,std::string comment)
public
INLINE
void
saveLog
(const std::string filename,std::string log,const bool timestamp,const std::string stampSeparator)
Exceptions
std::runtime_error
If file could not be open
public
INLINE
void
saveLog
(const std::string filename,std::vector< std::string > & logs,const bool timestamp,const std::string stampSeparator)
Exceptions
std::runtime_error
If file could not be open
public template<>
INLINE
bool
loadA3R
(const std::string filename,std::vector< std::vector< T > > & positions,double & radius)
Parameters
T
A number type
Exceptions
std::runtime_error
If file could not be open
public template<>
INLINE
bool
saveA3R
(const std::string filename,const std::vector< std::vector< T > > & positions,const double radius)
Parameters
T
A number type
Exceptions
std::runtime_error
If file could not be open
public template<>
INLINE
void
loadXYZ
(const std::string filename,std::vector< std::vector< T > > & matrix)
Parameters
T
Any printable type
Exceptions
std::runtime_error
If file could not be open
See also: https://en.wikipedia.org/wiki/XYZ_file_format
public template<>
INLINE
void
saveXYZ
(const std::string filename,const std::vector< std::vector< T > > & matrix,const std::vector< T > & tones,std::string elementName)
Parameters
T
A number type
Exceptions
std::runtime_error
If file could not be open
public template<>
INLINE
void
saveXYZ
(const std::string filename,const std::vector< std::vector< T > > & matrix,std::string elementName)
Parameters
T
Any printable type
public
INLINE
bool
folderExists
(const std::string name)
Check if folder exists.
This function checks if the given directory actually exists
Parameters
name
Path to the folder
Returns
True if folder exists, false otherwise
public
INLINE
std::size_t
countLinesInFile
(const std::string filename,const std::string token)
public
INLINE
std::vector< std::string >
listFilesWithExtension
(std::string path,const std::string extension,const std::string prefix,const bool addPathToFileNames)
public
INLINE
std::string
execute
(const std::string command)
Generated by Moxygen