Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Classes | Enumerations | Functions
limbo Namespace Reference

namespace for Limbo More...

Namespaces

 algorithms
 namespace for Limbo.algorithms
 
 containers
 namespace for Limbo.Containers
 
 geometry
 namespace for Limbo.Geometry
 
 programoptions
 namespace for Limbo.ProgramOptions
 
 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
}
 message type for print functions
 

Functions

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

generic function to get lowest value of numbers

Template Parameters
Tnumber type
template<typename T >
lowest ()
 
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

Function Documentation

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

string limbo::to_string ( int  val)
inline

convert integer to string

Parameters
valinteger
Returns
string

Definition at line 24 of file ToString.h.

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.

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.

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.

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.

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.

string limbo::to_string ( float  val)
inline

convert float to string

Parameters
valfloat
Returns
string

Definition at line 78 of file ToString.h.

string limbo::to_string ( double  val)
inline

convert double to string

Parameters
valdouble
Returns
string

Definition at line 88 of file ToString.h.

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.

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.

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.

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.