Skip to content

Latest commit

 

History

History
967 lines (625 loc) · 70.4 KB

API.md

File metadata and controls

967 lines (625 loc) · 70.4 KB

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 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 INLINEstd::stringgetVersion() Get version of the library.
public template<>
INLINEstd::stringstring(const T value)
Converts input into a string.
public INLINEboolhasPrefix(const std::string & text,const std::string & prefix) Checks if a string begins with a substring.
public INLINEboolhasSuffix(const std::string & text,const std::string & suffix) Checks if a string ends with a substring.
public INLINEboolcontains(const std::string & text,const std::string & substring) Checks if a string contains a substring.
public INLINEstd::stringreplace(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 INLINEvoidapplyReplace(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 INLINEboolequal(const char * charString,const std::string string1) Checks if a char string is equal to a std::string.
public INLINEstd::stringtoUpperCase(std::string input) Convert a string to upper case.
public INLINEstd::stringtoLowerCase(std::string input) Convert a string to lower case.
public template<>
INLINEstd::stringprependNumber(const T value,const std::size_t symbolsBeforePoint,const char symbolToPrepend)
public INLINEstd::size_tcounter(const std::size_t value) Returns ID starting from zero or the specified value.
public INLINEstd::stringmarker(const std::size_t value) Returns a string containing the word "Marker" and its ID.
public INLINEvoidprintMarker(const std::size_t value) Calls marker() and prints result to stdout.
public template<>
INLINETsign(const T value)
Returns signum of the value.
public template<>
INLINETmin(const T a,const T b)
Returns minimum of two values.
public template<>
INLINETmax(const T a,const T b)
Returns maximum of two values.
public template<>
INLINETmin(const std::vector< T > & input)
Returns minimum of vector values.
public template<>
INLINETmax(const std::vector< T > & input)
Returns maximum of vector values.
public template<>
INLINETmin(const std::vector< std::vector< T > > & input)
Returns minimum of matrix values.
public template<>
INLINETmax(const std::vector< std::vector< T > > & input)
Returns maximum of matrix values.
public template<>
INLINEboolisSquare(const T value)
Checks if number is square.
public template<>
INLINEboolisSquare(const std::vector< std::vector< T > > & matrix)
Checks if matrix is square.
public template<>
INLINEvoidgenerateRandomVector(std::vector< T > & vector,const std::size_t length,const T min,const T max)
public template<>
INLINEvoidgenerateRandomMatrix(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<>
INLINEvoidgenerateRandomMatrix(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<>
INLINEvoidinverseMatrix(std::vector< std::vector< T > > matrix,std::vector< std::vector< T > > & inverse)
public template<>
INLINEvoidinverseMatrix(std::vector< std::vector< T > > & matrix)
public template<>
INLINEvoidtranslateMatrixIntoVector(std::vector< std::vector< T > > & matrix,std::vector< T > & vector)
Elongates matrix into a vector.
public template<>
INLINEvoidtranslateVectorIntoSquareMatrix(std::vector< T > & vector,std::vector< std::vector< T > > & matrix)
Transform vector into a square matrix (if possible)
public template<>
INLINEvoidgenerateCirculantMatrix(std::vector< std::vector< T > > & matrix,std::vector< T > & source,const bool moveToTheRight)
public template<>
INLINEvoidmultiply(const std::vector< std::vector< T > > & left,const std::vector< std::vector< T > > & right,std::vector< std::vector< T > > & result)
public template<>
INLINEvoidmultiply(const std::vector< std::vector< T > > & left,const std::vector< T > & right,std::vector< T > & result)
public template<>
INLINEvoidmultiply(const std::vector< T > & left,const std::vector< T > & right,T & result)
Calculate vector-vector multiplication.
public template<>
INLINEvoidmultiplyElementWise(const std::vector< std::vector< T > > & left,const std::vector< std::vector< T > > & right,std::vector< std::vector< T > > & result)
public template<>
INLINEvoidmultiplyElementWise(const std::vector< T > & left,const std::vector< T > & right,std::vector< T > & result)
public template<>
INLINEvoidmultiplyComplexElementWise(const std::vector< std::vector< T > > & left,const std::vector< std::vector< T > > & right,std::vector< std::vector< T > > & result)
#### Parameters
public template<>
INLINEstd::stringcomplexIntoString(const std::vector< T > complexValue)
#### Parameters
public template<>
INLINEvoidconjugate(std::vector< std::vector< T > > & complexVector)
#### Parameters
public template<>
INLINEvoidfft(std::vector< std::vector< T > > & complexVector)
#### Parameters
public template<>
INLINEvoidifft(std::vector< std::vector< T > > & complexVector)
#### Parameters
public INLINEstd::chrono::high_resolution_clock::time_pointtime() Returns current time point.
public INLINEstd::chrono::system_clock::time_pointsystemTime() Returns current time point.
public INLINEdoubleduration(const std::chrono::high_resolution_clock::time_point start,const std::chrono::high_resolution_clock::time_point finish,const std::string scale)
public INLINEdoubleduration(const std::chrono::high_resolution_clock::time_point start,const std::string scale)
public INLINEvoidprintDuration(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 INLINEvoidprintDuration(const std::chrono::high_resolution_clock::time_point start,const std::string scale,const std::size_t count)
public INLINEstd::stringgetDateAndTime(std::chrono::system_clock::time_point timePoint) Get date and time.
public INLINEstd::stringgetDate(std::chrono::system_clock::time_point timePoint) Get date.
public INLINEstd::stringgetTime(std::chrono::system_clock::time_point timePoint) Get time.
public INLINEstd::stringparseParameter(const char * input,const std::string name)
public template<>
INLINEvoidassignFromVectorByIntervalCondition(T & value,const T parameter,const std::vector< std::vector< T > > intervals)
#### Parameters
public template<>
INLINEvoidassignFromVectorByIntervalCondition(T & firstValue,T & secondValue,const T parameter,const std::vector< std::vector< T > > intervals)
#### Parameters
public INLINEboolassignBooleanParameter(const char * input,const std::string name,bool & value)
public INLINEboolassignCharParameter(const char * input,const std::string name,char & value)
public INLINEboolassignStringParameter(const char * input,const std::string name,std::string & value)
public template<>
INLINEboolassignParameter(const char * input,const std::string name,T & value)
#### Parameters
public INLINEboolassignAbsDoubleParameter(const char * input,const std::string name,double & value)
public template<>
INLINEboolassignByCheckingParameter(const char * input,const std::string parameter,T & value,const T supposed)
#### Parameters
public INLINEvoidclearScreen()
public INLINEvoidsetLocale(const std::string locale)
public INLINEvoidshowProgressBar(double progress,const int screenWidth)
public INLINEvoidprintLine(const std::string line,const int screenWidth)
public template<>
INLINEvoidparseFileInMatrix(const std::string filename,const char separator,std::vector< std::vector< T > > & matrix)
#### Parameters
public template<>
INLINEvoidparseFileInVector(const std::string filename,const char separator,std::vector< T > & vector)
#### Parameters
public INLINEvoidparseFileIntoString(const std::string filename,std::string & content) #### Exceptions
public template<>
INLINEvoidaccumulateFileInMatrix(const std::string filename,const char separator,std::vector< std::vector< T > > & matrix)
#### Parameters
public template<>
INLINEvoidaccumulateFileInVector(const std::string filename,const char separator,std::vector< T > & vector,const bool checkForNaN)
#### Parameters
public template<>
INLINEvoidprintMatrix(const std::vector< std::vector< T > > & matrix,const bool transpose,const int precision)
#### Parameters
public template<>
INLINEvoidprintVector(const std::vector< T > & vector,const int precision)
#### Parameters
public template<>
INLINEvoidprint(const std::vector< std::vector< T > > & matrix,const bool transpose,const int precision)
#### Parameters
public template<>
INLINEvoidprint(const std::vector< T > & vector,const int precision)
#### Parameters
public template<>
INLINEvoidprint(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<>
INLINEvoidprintStyle(const T income,const std::string style)
#### Parameters
public template<>
INLINEvoidprintBlack(const T income)
#### Parameters
public template<>
INLINEvoidprintRed(const T income)
#### Parameters
public template<>
INLINEvoidprintGreen(const T income)
#### Parameters
public template<>
INLINEvoidprintYellow(const T income)
#### Parameters
public template<>
INLINEvoidprintBlue(const T income)
#### Parameters
public template<>
INLINEvoidprintMagenta(const T income)
#### Parameters
public template<>
INLINEvoidprintCyan(const T income)
#### Parameters
public template<>
INLINEvoidprintWhite(const T income)
#### Parameters
public template<>
INLINEvoidprintBold(const T income)
#### Parameters
public template<>
INLINEvoidprintUnderline(const T income)
#### Parameters
public INLINEvoidprintAllStyles()
public INLINEvoidclearStyles()
public template<>
INLINEvoidsaveMatrix(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<>
INLINEvoidsaveVector(const std::string filename,const std::vector< T > & vector,std::string comment,std::string type,std::string delimiter)
#### Parameters
public INLINEvoidsaveLine(const std::string filename,const std::string line,std::string comment) #### Exceptions
public template<>
INLINEvoidsave(const std::string filename,const std::vector< std::vector< T > > & matrix,std::string comment)
public template<>
INLINEvoidsave(const std::string filename,const std::vector< T > & vector,std::string comment)
public template<>
INLINEvoidsave(const std::string filename,const std::string line,std::string comment)
public INLINEvoidsaveLog(const std::string filename,std::string log,const bool timestamp,const std::string stampSeparator) #### Exceptions
public INLINEvoidsaveLog(const std::string filename,std::vector< std::string > & logs,const bool timestamp,const std::string stampSeparator) #### Exceptions
public template<>
INLINEboolloadA3R(const std::string filename,std::vector< std::vector< T > > & positions,double & radius)
#### Parameters
public template<>
INLINEboolsaveA3R(const std::string filename,const std::vector< std::vector< T > > & positions,const double radius)
#### Parameters
public template<>
INLINEvoidloadXYZ(const std::string filename,std::vector< std::vector< T > > & matrix)
#### Parameters
public template<>
INLINEvoidsaveXYZ(const std::string filename,const std::vector< std::vector< T > > & matrix,const std::vector< T > & tones,std::string elementName)
#### Parameters
public template<>
INLINEvoidsaveXYZ(const std::string filename,const std::vector< std::vector< T > > & matrix,std::string elementName)
#### Parameters
public INLINEboolfolderExists(const std::string name) Check if folder exists.
public INLINEstd::size_tcountLinesInFile(const std::string filename,const std::string token)
public INLINEstd::vector< std::string >listFilesWithExtension(std::string path,const std::string extension,const std::string prefix,const bool addPathToFileNames)
public INLINEstd::stringexecute(const std::string command)

Members

public INLINEstd::stringgetVersion()

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<>
INLINEstd::stringstring(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 INLINEboolhasPrefix(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 INLINEboolhasSuffix(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 INLINEboolcontains(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 INLINEstd::stringreplace(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 INLINEvoidapplyReplace(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 INLINEboolequal(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 INLINEstd::stringtoUpperCase(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 INLINEstd::stringtoLowerCase(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<>
INLINEstd::stringprependNumber(const T value,const std::size_t symbolsBeforePoint,const char symbolToPrepend)

public INLINEstd::size_tcounter(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 INLINEstd::stringmarker(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 INLINEvoidprintMarker(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<>
INLINETsign(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<>
INLINETmin(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<>
INLINETmax(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<>
INLINETmin(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<>
INLINETmax(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<>
INLINETmin(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<>
INLINETmax(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<>
INLINEboolisSquare(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<>
INLINEboolisSquare(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<>
INLINEvoidgenerateRandomVector(std::vector< T > & vector,const std::size_t length,const T min,const T max)

public template<>
INLINEvoidgenerateRandomMatrix(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<>
INLINEvoidgenerateRandomMatrix(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<>
INLINEvoidinverseMatrix(std::vector< std::vector< T > > matrix,std::vector< std::vector< T > > & inverse)

public template<>
INLINEvoidinverseMatrix(std::vector< std::vector< T > > & matrix)

public template<>
INLINEvoidtranslateMatrixIntoVector(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<>
INLINEvoidtranslateVectorIntoSquareMatrix(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 If matrix is not square

public template<>
INLINEvoidgenerateCirculantMatrix(std::vector< std::vector< T > > & matrix,std::vector< T > & source,const bool moveToTheRight)

public template<>
INLINEvoidmultiply(const std::vector< std::vector< T > > & left,const std::vector< std::vector< T > > & right,std::vector< std::vector< T > > & result)

public template<>
INLINEvoidmultiply(const std::vector< std::vector< T > > & left,const std::vector< T > & right,std::vector< T > & result)

public template<>
INLINEvoidmultiply(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<>
INLINEvoidmultiplyElementWise(const std::vector< std::vector< T > > & left,const std::vector< std::vector< T > > & right,std::vector< std::vector< T > > & result)

public template<>
INLINEvoidmultiplyElementWise(const std::vector< T > & left,const std::vector< T > & right,std::vector< T > & result)

public template<>
INLINEvoidmultiplyComplexElementWise(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<>
INLINEstd::stringcomplexIntoString(const std::vector< T > complexValue)

Parameters

  • T A number type

public template<>
INLINEvoidconjugate(std::vector< std::vector< T > > & complexVector)

Parameters

  • T A number type

public template<>
INLINEvoidfft(std::vector< std::vector< T > > & complexVector)

Parameters

  • T A number type

public template<>
INLINEvoidifft(std::vector< std::vector< T > > & complexVector)

Parameters

  • T A number type

public INLINEstd::chrono::high_resolution_clock::time_pointtime()

Returns current time point.

This function returns current time point using std::chrono

Returns

std::chrono::high_resolution_clock entity

public INLINEstd::chrono::system_clock::time_pointsystemTime()

Returns current time point.

This function returns current time point using std::chrono

Returns

std::chrono::system_clock entity

public INLINEdoubleduration(const std::chrono::high_resolution_clock::time_point start,const std::chrono::high_resolution_clock::time_point finish,const std::string scale)

public INLINEdoubleduration(const std::chrono::high_resolution_clock::time_point start,const std::string scale)

public INLINEvoidprintDuration(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 INLINEvoidprintDuration(const std::chrono::high_resolution_clock::time_point start,const std::string scale,const std::size_t count)

public INLINEstd::stringgetDateAndTime(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 INLINEstd::stringgetDate(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 INLINEstd::stringgetTime(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 INLINEstd::stringparseParameter(const char * input,const std::string name)

public template<>
INLINEvoidassignFromVectorByIntervalCondition(T & value,const T parameter,const std::vector< std::vector< T > > intervals)

Parameters

  • T Any comparable type

public template<>
INLINEvoidassignFromVectorByIntervalCondition(T & firstValue,T & secondValue,const T parameter,const std::vector< std::vector< T > > intervals)

Parameters

  • T Any comparable type

public INLINEboolassignBooleanParameter(const char * input,const std::string name,bool & value)

public INLINEboolassignCharParameter(const char * input,const std::string name,char & value)

public INLINEboolassignStringParameter(const char * input,const std::string name,std::string & value)

public template<>
INLINEboolassignParameter(const char * input,const std::string name,T & value)

Parameters

  • T Any printable type

public INLINEboolassignAbsDoubleParameter(const char * input,const std::string name,double & value)

public template<>
INLINEboolassignByCheckingParameter(const char * input,const std::string parameter,T & value,const T supposed)

Parameters

  • T Any type

public INLINEvoidclearScreen()

public INLINEvoidsetLocale(const std::string locale)

public INLINEvoidshowProgressBar(double progress,const int screenWidth)

public INLINEvoidprintLine(const std::string line,const int screenWidth)

public template<>
INLINEvoidparseFileInMatrix(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<>
INLINEvoidparseFileInVector(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 INLINEvoidparseFileIntoString(const std::string filename,std::string & content)

Exceptions

  • std::runtime_error If file could not be open

public template<>
INLINEvoidaccumulateFileInMatrix(const std::string filename,const char separator,std::vector< std::vector< T > > & matrix)

Parameters

  • T A number type

public template<>
INLINEvoidaccumulateFileInVector(const std::string filename,const char separator,std::vector< T > & vector,const bool checkForNaN)

Parameters

  • T A number type

public template<>
INLINEvoidprintMatrix(const std::vector< std::vector< T > > & matrix,const bool transpose,const int precision)

Parameters

  • T Any printable type

public template<>
INLINEvoidprintVector(const std::vector< T > & vector,const int precision)

Parameters

  • T Any printable type

public template<>
INLINEvoidprint(const std::vector< std::vector< T > > & matrix,const bool transpose,const int precision)

Parameters

  • T Any printable type

public template<>
INLINEvoidprint(const std::vector< T > & vector,const int precision)

Parameters

  • T Any printable type

public template<>
INLINEvoidprint(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<>
INLINEvoidprintStyle(const T income,const std::string style)

Parameters

  • T Any printable type

public template<>
INLINEvoidprintBlack(const T income)

Parameters

  • T Any printable type

public template<>
INLINEvoidprintRed(const T income)

Parameters

  • T Any printable type

public template<>
INLINEvoidprintGreen(const T income)

Parameters

  • T Any printable type

public template<>
INLINEvoidprintYellow(const T income)

Parameters

  • T Any printable type

public template<>
INLINEvoidprintBlue(const T income)

Parameters

  • T Any printable type

public template<>
INLINEvoidprintMagenta(const T income)

Parameters

  • T Any printable type

public template<>
INLINEvoidprintCyan(const T income)

Parameters

  • T Any printable type

public template<>
INLINEvoidprintWhite(const T income)

Parameters

  • T Any printable type

public template<>
INLINEvoidprintBold(const T income)

Parameters

  • T Any printable type

public template<>
INLINEvoidprintUnderline(const T income)

Parameters

  • T Any printable type

public INLINEvoidclearStyles()

public template<>
INLINEvoidsaveMatrix(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<>
INLINEvoidsaveVector(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 INLINEvoidsaveLine(const std::string filename,const std::string line,std::string comment)

Exceptions

  • std::runtime_error If file could not be open

public template<>
INLINEvoidsave(const std::string filename,const std::vector< std::vector< T > > & matrix,std::string comment)

public template<>
INLINEvoidsave(const std::string filename,const std::vector< T > & vector,std::string comment)

public template<>
INLINEvoidsave(const std::string filename,const std::string line,std::string comment)

public INLINEvoidsaveLog(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 INLINEvoidsaveLog(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<>
INLINEboolloadA3R(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<>
INLINEboolsaveA3R(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<>
INLINEvoidloadXYZ(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<>
INLINEvoidsaveXYZ(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<>
INLINEvoidsaveXYZ(const std::string filename,const std::vector< std::vector< T > > & matrix,std::string elementName)

Parameters

  • T Any printable type

public INLINEboolfolderExists(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 INLINEstd::size_tcountLinesInFile(const std::string filename,const std::string token)

public INLINEstd::vector< std::string >listFilesWithExtension(std::string path,const std::string extension,const std::string prefix,const bool addPathToFileNames)

public INLINEstd::stringexecute(const std::string command)

Generated by Moxygen