ngramcache Class Reference

#include <ngramcache.h>

Collaboration diagram for ngramcache:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ngramcache (int n, int size, int maxentries, float lf=NGRAMCACHE_LOAD_FACTOR)
 ~ngramcache ()
int cursize ()
int maxsize ()
void reset (int n=0)
char * get (const int *ngp, char *&info)
char * get (const int *ngp, double &info)
char * get (const int *ngp, prob_and_state_t &info)
int add (const int *ngp, const char *&info)
int add (const int *ngp, const double &info)
int add (const int *ngp, const prob_and_state_t &info)
int isfull ()
void stat ()
void used ()
float set_load_factor (float value)


Detailed Description

Definition at line 46 of file ngramcache.h.


Constructor & Destructor Documentation

ngramcache::ngramcache ( int  n,
int  size,
int  maxentries,
float  lf = NGRAMCACHE_LOAD_FACTOR 
)

Definition at line 48 of file ngramcache.cpp.

References MP_BLOCK_SIZE, and NGRAMCACHE_LOAD_FACTOR.

ngramcache::~ngramcache (  ) 

Definition at line 62 of file ngramcache.cpp.


Member Function Documentation

int ngramcache::add ( const int *  ngp,
const prob_and_state_t info 
)

Definition at line 144 of file ngramcache.cpp.

References mempool::allocate(), and htable< T >::insert().

Here is the call graph for this function:

int ngramcache::add ( const int *  ngp,
const double &  info 
)

Definition at line 133 of file ngramcache.cpp.

References mempool::allocate(), and htable< T >::insert().

Here is the call graph for this function:

int ngramcache::add ( const int *  ngp,
const char *&  info 
)

Definition at line 122 of file ngramcache.cpp.

References mempool::allocate(), and htable< T >::insert().

Here is the call graph for this function:

int ngramcache::cursize (  )  [inline]

Definition at line 67 of file ngramcache.h.

char * ngramcache::get ( const int *  ngp,
prob_and_state_t info 
)

Definition at line 109 of file ngramcache.cpp.

References htable< T >::find().

Here is the call graph for this function:

char * ngramcache::get ( const int *  ngp,
double &  info 
)

Definition at line 96 of file ngramcache.cpp.

References htable< T >::find().

Here is the call graph for this function:

char * ngramcache::get ( const int *  ngp,
char *&  info 
)

Definition at line 83 of file ngramcache.cpp.

References htable< T >::find().

Here is the call graph for this function:

int ngramcache::isfull (  )  [inline]

Definition at line 80 of file ngramcache.h.

int ngramcache::maxsize (  )  [inline]

Definition at line 70 of file ngramcache.h.

void ngramcache::reset ( int  n = 0  ) 

Definition at line 72 of file ngramcache.cpp.

References MP_BLOCK_SIZE.

float ngramcache::set_load_factor ( float  value  )  [inline]

Definition at line 88 of file ngramcache.h.

void ngramcache::stat (  ) 

Definition at line 156 of file ngramcache.cpp.

References mempool::used(), htable< T >::used(), and mempool::wasted().

Referenced by used().

Here is the call graph for this function:

Here is the caller graph for this function:

void ngramcache::used (  )  [inline]

Definition at line 84 of file ngramcache.h.

References stat().

Here is the call graph for this function:


The documentation for this class was generated from the following files:

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