Limbo 3.5.4
Loading...
Searching...
No Matches
limbo Namespace Reference

namespace for Limbo More...

Namespaces

namespace  algorithms
 namespace for Limbo.algorithms
namespace  containers
 namespace for Limbo.Containers
namespace  geometry
 namespace for Limbo.Geometry
namespace  programoptions
 namespace for Limbo.ProgramOptions
namespace  solvers
 namespace for Limbo.Solvers

Classes

struct  StaticAssert
 static assertion More...
struct  StaticAssert< true >
 template specialization More...

Enumerations

enum  MessageType {
  kNONE = 0 , kINFO = 1 , kWARN = 2 , kERROR = 3 ,
  kDEBUG = 4 , kASSERT = 5
}

Functions

template<typename T>
abs (T const &t)
 generalized api can handle both integer and floating points
template<typename Iterator>
std::iterator_traits< Iterator >::value_type sum (Iterator first, Iterator last)
 get summation of an array
template<typename Iterator>
std::iterator_traits< Iterator >::value_type average (Iterator first, Iterator last)
 get average of an array
template<typename Iterator>
std::iterator_traits< Iterator >::value_type max (Iterator first, Iterator last)
 get max of an array
template<typename Iterator>
std::iterator_traits< Iterator >::value_type min (Iterator first, Iterator last)
 get min of an array
int limboPrint (MessageType m, const char *format,...)
 formatted print with prefix
int limboPrintStream (MessageType m, FILE *stream, const char *format,...)
 formatted print with prefix to stream
int limboVPrintStream (MessageType m, FILE *stream, const char *format, va_list args)
 formatted print with prefix to stream
int limboSPrint (MessageType m, char *buf, const char *format,...)
 formatted print with prefix to buffer
int limboVSPrint (MessageType m, char *buf, const char *format, va_list args)
 formatted print with prefix to buffer
int limboSPrintPrefix (MessageType m, char *prefix)
 print prefix message to buffer
void limboPrintAssertMsg (const char *expr, const char *fileName, unsigned lineNum, const char *funcName, const char *format,...)
 print message for assertion failure with additional message, see limboAssertMsg(condition, args...)
void limboPrintAssertMsg (const char *expr, const char *fileName, unsigned lineNum, const char *funcName)
 print message for assertion failure without additional message, see limboAssert(condition)
bool is_integer (string const &s)
 check whether string represents an integer
bool is_float (string const &s)
 check whether string represents an float
bool is_number (string const &s)
 check whether string represents a number, either integer or floating point number
string toupper (string const &s)
 convert string to upper case
string tolower (string const &s)
 convert string to lower case
bool iequals (string const &s1, string const &s2)
 check two strings equal, case-insensitive
string get_file_path (const string &s)
 get relative path of a file
string get_file_name (const string &s)
 get pure name of a file (no path)
string get_file_suffix (const string &s)
 get suffix of a file
string trim_file_suffix (string const &s)
 trim the suffix of a file
string get_first_word (string const &str)
 fetch the first word of a string, assume delimiter is space or tab
string to_string (int val)
 convert integer to string
string to_string (long val)
 convert long integer to string
string to_string (long long val)
 convert long long integer to string
string to_string (unsigned int val)
 convert unsigned integer to string
string to_string (unsigned long val)
 convert unsigned long integer to string
string to_string (unsigned long long val)
 convert unsigned long long integer to string
string to_string (float val)
 convert float to string
string to_string (double val)
 convert double to string
string to_string (long double val)
 convert long double to string
generic functions to get lowest value of numbers, i.e., min for integers, -max for floating point numbers
template<typename T>
lowest ()
 generic function to get lowest value of numbers
template<>
char lowest< char > ()
 specialization for integer types
template<>
unsigned char lowest< unsigned char > ()
 specialization for integer types
template<>
short lowest< short > ()
 specialization for integer types
template<>
unsigned short lowest< unsigned short > ()
 specialization for integer types
template<>
int lowest< int > ()
 specialization for integer types
template<>
unsigned int lowest< unsigned int > ()
 specialization for integer types
template<>
long lowest< long > ()
 specialization for integer types
template<>
unsigned long lowest< unsigned long > ()
 specialization for integer types
template<>
long long lowest< long long > ()
 specialization for integer types
template<>
unsigned long long lowest< unsigned long long > ()
 specialization for integer types
template<>
float lowest< float > ()
 specialization for floating point types
template<>
double lowest< double > ()
 specialization for floating point types
template<>
long double lowest< long double > ()
 specialization for floating point types

Detailed Description

namespace for Limbo

TODO.

namespace for Limbo

Enumeration Type Documentation

◆ MessageType

enum limbo::MessageType

Definition at line 23 of file PrintMsg.h.

Function Documentation

◆ abs()

template<typename T>
T limbo::abs ( T const & t)
inline

generalized api can handle both integer and floating points

Returns
absolute value of a number

Definition at line 21 of file Math.h.

◆ average()

template<typename Iterator>
std::iterator_traits< Iterator >::value_type limbo::average ( Iterator first,
Iterator last )
inline

get average of an array

Parameters
firstbegin iterator
lastend iterator
Returns
average value of an array
Template Parameters
Iteratoriterator type

Definition at line 44 of file Math.h.

◆ get_file_name()

string limbo::get_file_name ( const string & s)
inline

get pure name of a file (no path)

Parameters
sfile name
Returns
the pure name of a file (no path)

Definition at line 127 of file String.h.

◆ get_file_path()

string limbo::get_file_path ( const string & s)
inline

get relative path of a file

Parameters
sfile name
Returns
the relative path of a file

Definition at line 118 of file String.h.

◆ get_file_suffix()

string limbo::get_file_suffix ( const string & s)
inline

get suffix of a file

Parameters
sfile name
Returns
the suffix of a file

Definition at line 136 of file String.h.

◆ get_first_word()

string limbo::get_first_word ( string const & str)
inline

fetch the first word of a string, assume delimiter is space or tab

Parameters
strstring
Returns
the first word of a string, assume delimiter is space or tab

Definition at line 154 of file String.h.

◆ iequals()

bool limbo::iequals ( string const & s1,
string const & s2 )
inline

check two strings equal, case-insensitive

Parameters
s1string
s2string
Returns
true if s1 and s2 are equal case-insensitively

Definition at line 108 of file String.h.

◆ is_float()

bool limbo::is_float ( string const & s)
inline

check whether string represents an float

Parameters
sstring
Returns
true if s is an float

Definition at line 41 of file String.h.

◆ is_integer()

bool limbo::is_integer ( string const & s)
inline

check whether string represents an integer

Parameters
sstring
Returns
true if s is an integer

Definition at line 28 of file String.h.

◆ is_number()

bool limbo::is_number ( string const & s)
inline

check whether string represents a number, either integer or floating point number

Parameters
sstring
Returns
true if s is a number

Definition at line 62 of file String.h.

◆ limboPrint()

int limbo::limboPrint ( MessageType m,
const char * format,
... )
inline

formatted print with prefix

forward declaration

Parameters
mprefix message
formatrefer to the usage of printf
Returns

Definition at line 49 of file PrintMsg.h.

◆ limboPrintAssertMsg() [1/2]

void limbo::limboPrintAssertMsg ( const char * expr,
const char * fileName,
unsigned lineNum,
const char * funcName )
inline

print message for assertion failure without additional message, see limboAssert(condition)

Parameters
exprassertion condition
fileNamesource code of file where the assertion is
lineNumline number of the assertion
funcNamefunction name where the assertion is
Returns

Definition at line 182 of file PrintMsg.h.

◆ limboPrintAssertMsg() [2/2]

void limbo::limboPrintAssertMsg ( const char * expr,
const char * fileName,
unsigned lineNum,
const char * funcName,
const char * format,
... )
inline

print message for assertion failure with additional message, see limboAssertMsg(condition, args...)

Parameters
exprassertion condition
fileNamesource code of file where the assertion is
lineNumline number of the assertion
funcNamefunction name where the assertion is
formatrefer to the usage of printf
Returns

Definition at line 163 of file PrintMsg.h.

◆ limboPrintStream()

int limbo::limboPrintStream ( MessageType m,
FILE * stream,
const char * format,
... )
inline

formatted print with prefix to stream

Parameters
mprefix message
stream
formatrefer to the usage of printf
Returns

Definition at line 64 of file PrintMsg.h.

◆ limboSPrint()

int limbo::limboSPrint ( MessageType m,
char * buf,
const char * format,
... )
inline

formatted print with prefix to buffer

Parameters
mprefix message
bufbuffer
formatrefer to the usage of printf
Returns

Definition at line 101 of file PrintMsg.h.

◆ limboSPrintPrefix()

int limbo::limboSPrintPrefix ( MessageType m,
char * prefix )
inline

print prefix message to buffer

Parameters
mprefix message
prefixtarget buffer
Returns

Definition at line 134 of file PrintMsg.h.

◆ limboVPrintStream()

int limbo::limboVPrintStream ( MessageType m,
FILE * stream,
const char * format,
va_list args )
inline

formatted print with prefix to stream

Parameters
mprefix message
stream
formatrefer to the usage of printf
argsargument list
Returns

Definition at line 80 of file PrintMsg.h.

◆ limboVSPrint()

int limbo::limboVSPrint ( MessageType m,
char * buf,
const char * format,
va_list args )
inline

formatted print with prefix to buffer

Parameters
mprefix message
bufbuffer
formatrefer to the usage of printf
argsargument list
Returns

Definition at line 117 of file PrintMsg.h.

◆ lowest()

template<typename T>
T limbo::lowest ( )
inline

generic function to get lowest value of numbers

Template Parameters
Tnumber type

◆ lowest< char >()

template<>
char limbo::lowest< char > ( )
inline

specialization for integer types

Definition at line 97 of file Math.h.

◆ lowest< double >()

template<>
double limbo::lowest< double > ( )
inline

specialization for floating point types

Definition at line 163 of file Math.h.

◆ lowest< float >()

template<>
float limbo::lowest< float > ( )
inline

specialization for floating point types

Definition at line 157 of file Math.h.

◆ lowest< int >()

template<>
int limbo::lowest< int > ( )
inline

specialization for integer types

Definition at line 121 of file Math.h.

◆ lowest< long >()

template<>
long limbo::lowest< long > ( )
inline

specialization for integer types

Definition at line 133 of file Math.h.

◆ lowest< long double >()

template<>
long double limbo::lowest< long double > ( )
inline

specialization for floating point types

Definition at line 169 of file Math.h.

◆ lowest< long long >()

template<>
long long limbo::lowest< long long > ( )
inline

specialization for integer types

Definition at line 145 of file Math.h.

◆ lowest< short >()

template<>
short limbo::lowest< short > ( )
inline

specialization for integer types

Definition at line 109 of file Math.h.

◆ lowest< unsigned char >()

template<>
unsigned char limbo::lowest< unsigned char > ( )
inline

specialization for integer types

Definition at line 103 of file Math.h.

◆ lowest< unsigned int >()

template<>
unsigned int limbo::lowest< unsigned int > ( )
inline

specialization for integer types

Definition at line 127 of file Math.h.

◆ lowest< unsigned long >()

template<>
unsigned long limbo::lowest< unsigned long > ( )
inline

specialization for integer types

Definition at line 139 of file Math.h.

◆ lowest< unsigned long long >()

template<>
unsigned long long limbo::lowest< unsigned long long > ( )
inline

specialization for integer types

Definition at line 151 of file Math.h.

◆ lowest< unsigned short >()

template<>
unsigned short limbo::lowest< unsigned short > ( )
inline

specialization for integer types

Definition at line 115 of file Math.h.

◆ max()

template<typename Iterator>
std::iterator_traits< Iterator >::value_type limbo::max ( Iterator first,
Iterator last )
inline

get max of an array

Parameters
firstbegin iterator
lastend iterator
Returns
max value of an array
Template Parameters
Iteratoriterator type

Definition at line 61 of file Math.h.

◆ min()

template<typename Iterator>
std::iterator_traits< Iterator >::value_type limbo::min ( Iterator first,
Iterator last )
inline

get min of an array

Parameters
firstbegin iterator
lastend iterator
Returns
min value of an array
Template Parameters
Iteratoriterator type

Definition at line 77 of file Math.h.

◆ sum()

template<typename Iterator>
std::iterator_traits< Iterator >::value_type limbo::sum ( Iterator first,
Iterator last )
inline

get summation of an array

Parameters
firstbegin iterator
lastend iterator
Returns
sum value of an array
Template Parameters
Iteratoriterator type

Definition at line 31 of file Math.h.

◆ to_string() [1/9]

string limbo::to_string ( double val)
inline

convert double to string

Parameters
valdouble
Returns
string

Definition at line 88 of file ToString.h.

◆ to_string() [2/9]

string limbo::to_string ( float val)
inline

convert float to string

Parameters
valfloat
Returns
string

Definition at line 78 of file ToString.h.

◆ to_string() [3/9]

string limbo::to_string ( int val)
inline

convert integer to string

Parameters
valinteger
Returns
string

Definition at line 24 of file ToString.h.

◆ to_string() [4/9]

string limbo::to_string ( long double val)
inline

convert long double to string

Parameters
vallong double
Returns
string

Definition at line 98 of file ToString.h.

◆ to_string() [5/9]

string limbo::to_string ( long long val)
inline

convert long long integer to string

Parameters
vallong long integer
Returns
string

Definition at line 42 of file ToString.h.

◆ to_string() [6/9]

string limbo::to_string ( long val)
inline

convert long integer to string

Parameters
vallong integer
Returns
string

Definition at line 33 of file ToString.h.

◆ to_string() [7/9]

string limbo::to_string ( unsigned int val)
inline

convert unsigned integer to string

Parameters
valunsigned integer
Returns
string

Definition at line 51 of file ToString.h.

◆ to_string() [8/9]

string limbo::to_string ( unsigned long long val)
inline

convert unsigned long long integer to string

Parameters
valunsigned long long integer
Returns
string

Definition at line 69 of file ToString.h.

◆ to_string() [9/9]

string limbo::to_string ( unsigned long val)
inline

convert unsigned long integer to string

Parameters
valunsigned long integer
Returns
string

Definition at line 60 of file ToString.h.

◆ tolower()

string limbo::tolower ( string const & s)
inline

convert string to lower case

Parameters
sstring
Returns
lower case copy of s

Definition at line 95 of file String.h.

◆ toupper()

string limbo::toupper ( string const & s)
inline

convert string to upper case

Parameters
sstring
Returns
upper case copy of s

Definition at line 83 of file String.h.

◆ trim_file_suffix()

string limbo::trim_file_suffix ( string const & s)
inline

trim the suffix of a file

Parameters
sfile name
Returns
string without suffix of the file

Definition at line 145 of file String.h.