/disk4/html/www/moses/doxygen/irstlm/trunk/src/util.h File Reference

#include <string>
#include <fstream>
#include "gzfilebuf.h"
#include "n_gram.h"

Go to the source code of this file.

Classes

class  inputfilestream

Defines

#define MAX(a, b)   (((a)>(b))?(a):(b))
#define MIN(a, b)   (((a)<(b))?(a):(b))
#define UNUSED(x)   { (void) x; }
#define _DEBUG_LEVEL   2
#define VERBOSE(level, str)   { }
#define IFVERBOSE(level)   { }
#define LMTMAXLEV   20
#define MAX_LINE   100000
#define UPPER_SINGLE_PRECISION_OF_0   0.000001
#define UPPER_DOUBLE_PRECISION_OF_0   0.000000000001
#define UPPER_SINGLE_PRECISION_OF_1   1.000001
#define LOWER_SINGLE_PRECISION_OF_1   0.999999
#define UPPER_DOUBLE_PRECISION_OF_1   1.000000000001
#define LOWER_DOUBLE_PRECISION_OF_1   0.999999999999

Functions

std::string gettempfolder ()
std::string createtempName ()
void createtempfile (mfstream &fileStream, std::string &filePath, std::ios_base::openmode flags)
void removefile (const std::string &filePath)
void * MMap (int fd, int access, off_t offset, size_t len, off_t *gap)
int Munmap (void *p, size_t len, int sync)
void ResetUserTime ()
void PrintUserTime (const std::string &message)
double GetUserTime ()
int parseWords (char *, const char **, int)
int parseline (istream &inp, int Order, ngram &ng, float &prob, float &bow)


Define Documentation

#define _DEBUG_LEVEL   2

Definition at line 17 of file util.h.

#define IFVERBOSE ( level   )     { }

Definition at line 28 of file util.h.

#define LMTMAXLEV   20

Definition at line 33 of file util.h.

#define LOWER_DOUBLE_PRECISION_OF_1   0.999999999999

Definition at line 47 of file util.h.

Referenced by mixture::discount().

#define LOWER_SINGLE_PRECISION_OF_1   0.999999

#define MAX ( a,
 )     (((a)>(b))?(a):(b))

Definition at line 12 of file util.h.

#define MAX_LINE   100000

Definition at line 34 of file util.h.

#define MIN ( a,
 )     (((a)<(b))?(a):(b))

Definition at line 13 of file util.h.

#define UNUSED (  )     { (void) x; }

#define UPPER_DOUBLE_PRECISION_OF_0   0.000000000001

Definition at line 43 of file util.h.

#define UPPER_DOUBLE_PRECISION_OF_1   1.000000000001

Definition at line 46 of file util.h.

Referenced by mixture::discount().

#define UPPER_SINGLE_PRECISION_OF_0   0.000001

#define UPPER_SINGLE_PRECISION_OF_1   1.000001

#define VERBOSE ( level,
str   )     { }

trace macros verbose macros

Definition at line 27 of file util.h.


Function Documentation

void createtempfile ( mfstream fileStream,
std::string &  filePath,
std::ios_base::openmode  flags 
)

std::string createtempName (  ) 

Definition at line 58 of file util.cpp.

References gettempfolder().

Referenced by createtempfile().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string gettempfolder (  ) 

Definition at line 39 of file util.cpp.

References str.

Referenced by createtempName().

Here is the caller graph for this function:

double GetUserTime (  ) 

Total wall time that the global timer has been in the "running" state since it was first "started".

Definition at line 26 of file Timer.cpp.

References Moses::g_timer, MosesTuning::Timer::get_elapsed_cpu_time(), Moses::Timer::get_elapsed_time(), and Timer::get_elapsed_time().

Referenced by Moses::Search::out_of_time().

Here is the call graph for this function:

Here is the caller graph for this function:

void* MMap ( int  fd,
int  access,
off_t  offset,
size_t  len,
off_t *  gap 
)

Definition at line 144 of file util.cpp.

Referenced by lmtable::expand_level_mmap(), lmtable::reset_mmap(), and lmtable::resize_level_mmap().

Here is the caller graph for this function:

int Munmap ( void *  p,
size_t  len,
int  sync 
)

Definition at line 194 of file util.cpp.

Referenced by lmtable::delete_level_mmap(), lmtable::reset_mmap(), lmtable::resize_level_mmap(), and lmtable::~lmtable().

Here is the caller graph for this function:

int parseline ( istream &  inp,
int  Order,
ngram ng,
float &  prob,
float &  bow 
)

Definition at line 272 of file util.cpp.

References ngram::dict, LMTMAXLEV, MAX_LINE, dictionary::OOV(), parseWords(), ngram::pushw(), and ngram::size.

Here is the call graph for this function:

int parseWords ( char *  ,
const char **  ,
int   
)

Definition at line 243 of file util.cpp.

void PrintUserTime ( const std::string &  message  ) 

void removefile ( const std::string &  filePath  ) 

void ResetUserTime (  ) 

Start global timer.

Definition at line 16 of file Timer.cpp.

References Moses::g_timer, MosesTuning::Timer::start(), Moses::Timer::start(), and Timer::start().

Referenced by batch_run(), decoder_main(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Thu Jul 6 00:31:25 2017 for Moses by  doxygen 1.5.9