Main Page   Compound List   File List   Compound Members   File Members  

two_byte_alphas.c File Reference

represent a floating point with a 2-byte integer. More...

#include <math.h>
#include "ngram.h"

Go to the source code of this file.

Functions

unsigned short short_alpha (double long_alpha, double *alpha_array, unsigned short *size_of_alpha_array, int elements_in_range, double min_range, double max_range)
double double_alpha (unsigned short short_alpha, double *alpha_array, int size_of_alpha_array, int elements_in_range, double min_range, double max_range)


Detailed Description

represent a floating point with a 2-byte integer.

Each of the integers 0 ... 65535 are associated with a floating point number. For the lower integers, the floating point numbers with which they are associated are equally log-linearly spaced across the range specified by the -min_alpha and -max_alpha values (note that these values correspond to the log to the base 10 of the backoff weights). The last N integers (where N is specified by the -out_of_range_alphas switch) correspond exactly to values of alpha which are encountered which fall outside this range. Therefore, a small range with a small value of N will allow the alphas to be represented most accurately, but if more than N out of range alphas are encountered, then the program will fail. The default values are min_alpha = -3.2, max_alpha, max_alpha = 2.5, out_of_range_alphaa = 10000. This method does, however, introduce slight inaccuracies, and so it is only recommended when memory is short. By default, the alphas are stored in four bytes.

Definition in file two_byte_alphas.c.


Function Documentation

double double_alpha unsigned short    short_alpha,
double *    alpha_array,
int    size_of_alpha_array,
int    elements_in_range,
double    min_range,
double    max_range
 

Definition at line 95 of file two_byte_alphas.c.

References quit(), and short_alpha().

Referenced by bo_ng_prob(), and for().

unsigned short short_alpha double    long_alpha,
double *    alpha_array,
unsigned short *    size_of_alpha_array,
int    elements_in_range,
double    min_range,
double    max_range
 

Definition at line 46 of file two_byte_alphas.c.

References i, and quit().

Referenced by compute_back_off(), and double_alpha().


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