Context algorithm
Semi-predictive context algorithm implementation
 All Data Structures Files Functions Variables Typedefs Macros Pages
statistics.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 STATISTICS_H
20 #define STATISTICS_H
21 
22 #include "types.h"
23 
25 typedef struct statistics {
29  double cost;
30 } *statistics_t;
31 
34 
37 
40 
43 
45 void freeBuffer();
46 
47 #endif
48 
Uint * count
List with the number of occurrences of each character in this state.
Definition: statistics.h:26
struct statistics * statistics_t
Structure that saves statistics for each tree node in the encoder.
void freeBuffer()
Deletes all statistics stored in the buffer.
Definition: statistics.c:74
unsigned char Uchar
Unsigned char type.
Definition: types.h:48
double cost
Cost assigned to this subtree.
Definition: statistics.h:29
unsigned long Uint
Unsigned int type.
Definition: types.h:54
Uint symbolCount
Number of occuring symbols.
Definition: statistics.h:28
statistics_t getStatistics()
Returns a new statistics structure, can be created or obtained from the buffer.
Definition: statistics.c:51
statistics_t allocStatistics()
Creates and initializes a new statistics structure instance.
Definition: statistics.c:29
Structure that saves statistics for each tree node in the encoder.
Definition: statistics.h:25
void returnStatistics(statistics_t st)
Puts a statistics structure that is no longer used into the buffer.
Definition: statistics.c:66
void freeStatistics(statistics_t st)
Deletes a statistics structure instance.
Definition: statistics.c:42
Uchar * symbols
List of occuring symbols.
Definition: statistics.h:27