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

#include <cstring>
#include <cstdlib>
#include <iostream>
#include <sys/types.h>
#include <sys/mman.h>
#include "timer.h"
#include "util.h"

Go to the source code of this file.

Functions

string gettempfolder ()
string createtempName ()
void createtempfile (mfstream &fileStream, 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 *sentence, const char **words, int max)
int parseline (istream &inp, int Order, ngram &ng, float &prob, float &bow)

Variables

Timer g_timer


Function Documentation

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

Definition at line 76 of file util.cpp.

References createtempName(), and mfstream::open().

Referenced by lmtable::checkbounds(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

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:

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 235 of file util.cpp.

References Timer::get_elapsed_time().

Here is the call 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 *  sentence,
const char **  words,
int  max 
)

Definition at line 243 of file util.cpp.

Referenced by lmmacro::load(), lmInterpolation::load(), lmclass::load(), main(), and parseline().

Here is the caller graph for this function:

void PrintUserTime ( const std::string &  message  ) 

Print out an optional message followed by the current global timer timing.

Definition at line 230 of file util.cpp.

References Timer::check().

Here is the call graph for this function:

void removefile ( const std::string &  filePath  ) 

void ResetUserTime (  ) 

Start global timer.

Definition at line 225 of file util.cpp.

References Timer::start().

Here is the call graph for this function:


Variable Documentation

Definition at line 222 of file util.cpp.


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