Main Page   Compound List   File List   Compound Members   File Members  

short_indices.c File Reference

Procedures to allow the indices which point into the next table to be stored as two-byte integers, rather than four byte integers. More...

#include "rr_libs/general.h"
#include "ngram.h"

Go to the source code of this file.

Functions

unsigned short new_index (int full_index, int *ind_table, unsigned short *ind_table_size, int position_in_list)
int get_full_index (unsigned short short_index, int *ind_table, unsigned short ind_table_size, int position_in_list)


Detailed Description

Procedures to allow the indices which point into the next table to be stored as two-byte integers, rather than four byte integers.

Procedures to allow the indices which point into the next table to be stored as two-byte integers, rather than four byte integers.

All that is stored of the indices are two bytes corresponding to the offset. For each table, we also store an array indicating where the non-offset part increases (which we can do, since the indices will be monotonically increasing).

This is probably best illustrated with an example. Suppose our array contains the following:

ind_table[0]=0 ind_table[1]=30 ind_table[2]=73

and the stored indices are called index[0..100]. Then the actual indices are

actual_index[0..29] = (0*key) + index[0..29] actual_index[30..72] = (1*key) + index[30..72] actual_index[73..100] = (2*key) + index[73..100]

Definition in file short_indices.c.


Function Documentation

int get_full_index unsigned short    short_index,
int *    ind_table,
unsigned short    ind_table_size,
int    position_in_list
 

Definition at line 66 of file short_indices.c.

References KEY.

Referenced by arpa_bo_ng_prob(), bo_ng_prob(), compute_back_off(), increment_context(), load_arpa_lm(), and num_of_types().

unsigned short new_index int    full_index,
int *    ind_table,
unsigned short *    ind_table_size,
int    position_in_list
 

Definition at line 51 of file short_indices.c.

References KEY.

Referenced by load_arpa_lm(), and main().


Generated on Tue Dec 21 13:54:47 2004 by doxygen1.2.18