Cambridge SMT System
MertCommon.h File Reference
#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <cstdlib>
#include "tropical-sparse-tuple-weight.h"
#include "tropical-sparse-tuple-weight-decls.h"
Include dependency graph for MertCommon.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MertOpt
 

Macros

#define tracer   std::cerr << Time()
 

Typedefs

typedef unsigned int Sid
 
typedef long long Wid
 
typedef std::vector< WidNGram
 
typedef std::vector< WidSentence
 

Functions

std::string Time ()
 
void ReplacePattern (std::string &newname, std::string pattern, const char *pat, std::string rep)
 
void ReplacePattern (std::string &newname, std::string pattern, const char *pat, float f)
 
void ReplacePattern (std::string &newname, std::string pattern, const char *pat, int i)
 
std::string ExpandPath (std::string pattern, const int idx)
 
void InitializeFromLimits (std::vector< Sid > &ids, const std::string limits)
 
void InitializeFromScript (std::vector< Sid > &ids, const std::string filename)
 
std::vector< PARAMSInitializeVectorsFromFile (const std::string &)
 
std::vector< PARAMSInitializeVectorsFromAxes (unsigned int)
 
std::vector< PARAMSInitializeVectorsFromRandom ()
 
std::vector< PARAMSInitializeVectors (const std::string &)
 
std::string ReadWeight (const std::string &)
 
std::ostream & operator<< (std::ostream &strm, const PARAMS &)
 
std::ostream & operator<< (std::ostream &o, const Sentence &s)
 
PARAMS operator- (const PARAMS &, const PARAMS &)
 
PARAMS operator+ (const PARAMS &, const PARAMS &)
 
std::vector< std::string > InitRefDataFilenames (int, char **)
 

Variables

MertOpt opts
 
const double kDoubleDelta = 1.0F / 4096.0F
 

Macro Definition Documentation

#define tracer   std::cerr << Time()

Definition at line 26 of file MertCommon.h.

Typedef Documentation

typedef std::vector<Wid> NGram

Definition at line 47 of file MertCommon.h.

typedef std::vector<Wid> Sentence

Definition at line 48 of file MertCommon.h.

typedef unsigned int Sid

Definition at line 45 of file MertCommon.h.

typedef long long Wid

Definition at line 46 of file MertCommon.h.

Function Documentation

std::string ExpandPath ( std::string  pattern,
const int  idx 
)

Definition at line 51 of file MertCommon.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void InitializeFromLimits ( std::vector< Sid > &  ids,
const std::string  limits 
)

Definition at line 56 of file MertCommon.cpp.

Here is the caller graph for this function:

void InitializeFromScript ( std::vector< Sid > &  ids,
const std::string  filename 
)

Definition at line 65 of file MertCommon.cpp.

Here is the caller graph for this function:

std::vector<PARAMS> InitializeVectors ( const std::string &  )

Definition at line 126 of file MertCommon.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector<PARAMS> InitializeVectorsFromAxes ( unsigned  int)

Definition at line 108 of file MertCommon.cpp.

std::vector<PARAMS> InitializeVectorsFromFile ( const std::string &  )
std::vector<PARAMS> InitializeVectorsFromRandom ( )

Definition at line 121 of file MertCommon.cpp.

std::vector<std::string> InitRefDataFilenames ( int  ,
char **   
)

Definition at line 192 of file MertCommon.cpp.

Here is the caller graph for this function:

PARAMS operator+ ( const PARAMS ,
const PARAMS  
)

Definition at line 176 of file MertCommon.cpp.

PARAMS operator- ( const PARAMS ,
const PARAMS  
)

Definition at line 163 of file MertCommon.cpp.

std::ostream& operator<< ( std::ostream &  strm,
const PARAMS  
)

Definition at line 152 of file MertCommon.cpp.

std::ostream& operator<< ( std::ostream &  o,
const Sentence s 
)

Definition at line 78 of file MertCommon.cpp.

std::string ReadWeight ( const std::string &  )

Definition at line 140 of file MertCommon.cpp.

Here is the caller graph for this function:

void ReplacePattern ( std::string &  newname,
std::string  pattern,
const char *  pat,
std::string  rep 
)

Definition at line 26 of file MertCommon.cpp.

Here is the caller graph for this function:

void ReplacePattern ( std::string &  newname,
std::string  pattern,
const char *  pat,
float  f 
)

Definition at line 36 of file MertCommon.cpp.

Here is the call graph for this function:

void ReplacePattern ( std::string &  newname,
std::string  pattern,
const char *  pat,
int  i 
)

Definition at line 44 of file MertCommon.cpp.

Here is the call graph for this function:

std::string Time ( )

Definition at line 16 of file MertCommon.cpp.

Variable Documentation

const double kDoubleDelta = 1.0F / 4096.0F

Definition at line 52 of file MertCommon.h.

MertOpt opts

Definition at line 14 of file MertCommon.cpp.