Context algorithm
Semi-predictive context algorithm implementation
 All Data Structures Files Functions Variables Typedefs Macros Pages
gammaFunc.h File Reference
#include <gsl/gsl_sf_gamma.h>
#include <gsl/gsl_sf_log.h>
#include <gsl/gsl_math.h>
#include "statistics.h"
#include "alpha.h"

Go to the source code of this file.

Functions

double kt (statistics_t)
 Calculates the Krichevsky-Trofimov probability assignment. More...
 
double nodeCost (statistics_t)
 Calculates the cost of a node. More...
 
double escapeCost (statistics_t, Uint *)
 Calculates the cost of escapes in a node. More...
 
double log2Alpha ()
 Returns the log2 of the alphabet size. More...
 
double hAlpha ()
 Returns the binary entropy of 1/alphasize. More...
 

Function Documentation

double escapeCost ( statistics_t  stats,
Uint distinct 
)

Calculates the cost of escapes in a node.

Parameters
[in]statsThe statistics needed to calculate the probability assignment.
Returns
KT probability assignment.

Definition at line 143 of file gammaFunc.c.

double hAlpha ( )

Returns the binary entropy of 1/alphasize.

Returns
binary entropy of 1/alphasize.

Definition at line 171 of file gammaFunc.c.

double kt ( statistics_t  stats)

Calculates the Krichevsky-Trofimov probability assignment.

Parameters
[in]statsThe statistics needed to calculate the probability assignment.
Returns
KT probability assignment.

Definition at line 96 of file gammaFunc.c.

double log2Alpha ( )

Returns the log2 of the alphabet size.

Returns
log2 of the alphabet size.

Definition at line 160 of file gammaFunc.c.

double nodeCost ( statistics_t  stats)

Calculates the cost of a node.

Parameters
[in]statsThe statistics needed to calculate the probability assignment.
Returns
KT probability assignment.

Definition at line 123 of file gammaFunc.c.