Context algorithm
Semi-predictive context algorithm implementation
 All Data Structures Files Functions Variables Typedefs Macros Pages
gammaFunc.h
Go to the documentation of this file.
1 /* Copyright 2013 Jorge Merlino
2 
3  This file is part of Context.
4 
5  Context is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Context is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with Context. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef GAMMA_FUNC_H
20 #define GAMMA_FUNC_H
21 
22 #include <gsl/gsl_sf_gamma.h>
23 #include <gsl/gsl_sf_log.h>
24 #include <gsl/gsl_math.h>
25 #include "statistics.h"
26 #include "alpha.h"
27 
29 double kt(statistics_t);
30 
32 double nodeCost(statistics_t);
33 
35 double escapeCost(statistics_t, Uint *);
36 
38 double log2Alpha ();
39 
41 double hAlpha ();
42 
43 #ifdef DEBUG
44 
46 int getHits();
47 
49 int getMisses();
50 
51 #endif
52 
53 #endif
double escapeCost(statistics_t stats, Uint *distinct)
Calculates the cost of escapes in a node.
Definition: gammaFunc.c:143
double kt(statistics_t stats)
Calculates the Krichevsky-Trofimov probability assignment.
Definition: gammaFunc.c:96
double hAlpha()
Returns the binary entropy of 1/alphasize.
Definition: gammaFunc.c:171
double log2Alpha()
Returns the log2 of the alphabet size.
Definition: gammaFunc.c:160
unsigned long Uint
Unsigned int type.
Definition: types.h:54
Structure that saves statistics for each tree node in the encoder.
Definition: statistics.h:25
double nodeCost(statistics_t stats)
Calculates the cost of a node.
Definition: gammaFunc.c:123