Context algorithm
Semi-predictive context algorithm implementation
|
#include "gammaTable.h"
#include "gammaFunc.h"
#include "debug.h"
#include "reset.h"
#include <math.h>
Go to the source code of this file.
Macros | |
#define | LNPI_2 M_LNPI / 2 |
Ln of PI/2. More... | |
Functions | |
static double | evalLogGamma (int n) |
Calculates Ln (gamma(n)). More... | |
static double | evalLogGamma2 (int n) |
Calculates Ln (gamma(n + 1/2)). More... | |
double | kt (statistics_t stats) |
Calculates the Krichevsky-Trofimov probability assignment. More... | |
double | nodeCost (statistics_t stats) |
Calculates the cost of a node. More... | |
double | escapeCost (statistics_t stats, Uint *distinct) |
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... | |
Variables | |
static double | alphasizeLog = 0 |
Log2 of the alphabet size. More... | |
static double | alphaEntropy = 0 |
Binary entropy of 1/alphasize. More... | |
#define LNPI_2 M_LNPI / 2 |
Ln of PI/2.
Definition at line 36 of file gammaFunc.c.
double escapeCost | ( | statistics_t | stats, |
Uint * | distinct | ||
) |
Calculates the cost of escapes in a node.
[in] | stats | The statistics needed to calculate the probability assignment. |
Definition at line 143 of file gammaFunc.c.
|
static |
Calculates Ln (gamma(n)).
[in] | n | the argument. |
Definition at line 49 of file gammaFunc.c.
|
static |
Calculates Ln (gamma(n + 1/2)).
[in] | n | the argument. |
Definition at line 73 of file gammaFunc.c.
double hAlpha | ( | ) |
Returns the binary entropy of 1/alphasize.
Definition at line 171 of file gammaFunc.c.
double kt | ( | statistics_t | stats | ) |
Calculates the Krichevsky-Trofimov probability assignment.
[in] | stats | The statistics needed to calculate the probability assignment. |
Definition at line 96 of file gammaFunc.c.
double log2Alpha | ( | ) |
Returns the log2 of the alphabet size.
Definition at line 160 of file gammaFunc.c.
double nodeCost | ( | statistics_t | stats | ) |
Calculates the cost of a node.
[in] | stats | The statistics needed to calculate the probability assignment. |
Definition at line 123 of file gammaFunc.c.
|
static |
Binary entropy of 1/alphasize.
Definition at line 42 of file gammaFunc.c.
|
static |
Log2 of the alphabet size.
Definition at line 39 of file gammaFunc.c.