MT Namespace Reference
Detailed Description
Marc Toussaint namespace.
Classes
Typedefs
Functions
-
int debugBreakpoint ()
-
char skip (std::istream &is, char *skipchars)
- skips the chars (typically white characters) when parsing from the istream
-
std::ofstream & log (const char *name="MT.log", bool _nolog=false)
- access to the log-file
-
void open (std::ofstream &fs, const char *name, char *errmsg="")
- open an output-file with name '
name'
-
void open (std::ifstream &fs, const char *name, char *errmsg="")
- open an input-file with name '
name'
-
template<class T> void save (const T &x, const char *filename)
- a standard method to save an object into a file. The same as std::ofstream file; MT::open(file,filename); file <<x; file.close();
-
template<class T> void load (T &x, const char *filename)
- a standard method to load object from a file. The same as std::ifstream file; MT::open(file,filename); file >>x; file.close();
-
bool contains (const char *s, char c)
- returns true if the (0-terminated) string s contains c
-
void skipLine (std::istream &is)
- skips a newline character (same as skip(is,"\n");)
-
byte bit (byte *str, uint i)
- returns the i-th of str
-
void flip (byte &b, uint i)
- flips the i-th bit of b
-
void flip (int &b, uint i)
- filps the i-th bit of b
-
double modMetric (double x, double y, double mod)
- the distance between x and y w.r.t. a circular topology (e.g. modMetric(1,8,10)=3)
-
double sign (double x)
- the sign (+/-1) of x (+1 for zero)
-
double linsig (double x)
- returns 0 for x<0, 1 for x>1, x for 0<x<1
-
float phi (float dx, float dy)
- the angle of the vector (dx,dy) in [-pi,pi]
-
double DIV (double x, double y, bool force=false)
- save division, checks for division by zero; force=true will return zero if y=0
-
double sigmoid11 (double x)
-
template<class T> T MIN (T a, T b)
-
template<class T> T MAX (T a, T b)
-
double approxExp (double x)
- approximate exp (sets up a static value table)
-
double Log (double x)
- ordinary Log, but cutting off for small values
-
uint Log2 (uint n)
- integer log2
-
double sqr (double x)
- square of a double
-
double realTime ()
- real time since start of the process in floating-point seconds (probably in micro second resolution) -- Windows checked!
-
double cpuTime ()
- user CPU time of this process in floating-point seconds (pure processor time) -- Windows checked!
-
double sysTime ()
- system CPU time of this process in floating-point seconds (the time spend for file input/output, x-server stuff, etc.) -- not implemented for Windows!
-
double totalTime ()
- total CPU time of this process in floating-point seconds (same as cpuTime + sysTime) -- not implemented for Windows!
-
char * date ()
- the absolute real time and date as string
-
void wait (double sec)
- wait real time
-
void wait ()
- wait for an ENTER at the console
-
long mem ()
- the integral shared memory size -- not implemented for Windows!
-
void resetTimer ()
- push reset on the stop watch (user CPU time)
-
double getTimer (bool reset=true)
- read the stop watch (user CPU time)
-
void init (int _argc, char *_argv[])
- memorize the command line arguments and open a log file
-
bool checkOption (const char *tag)
- returns false if command-line option
-tag
was not found
-
bool getOption (const char *tag, char *&option)
- returns false if command-line option
-tag
was not found
-
void openConfigFile (char *name=0)
- Open a (possibly new) config file with name '
name'
.
If name
is not specified, it searches for a command line-option '-cfg' and, if not found, it assumes name=MT
.cfg.
-
void initQt ()
- create a Qt application
Variables
-
bool IOraw
- stream modifier for some classes (Array in particular)
-
Rnd rnd
- The global Rnd object.
[]