#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "precomp.h"
Go to the source code of this file.
Data Structures | |
struct | tnode |
struct | lnode |
Defines | |
#define | INFINITY (1.0 / 0.0) |
#define | EPSILON (1.0 / (1UL << PREC_INTER)) |
#define | ABOVE_MIN(len, delta, z) ((len) + PREC_INTER - log2(delta) + (z) + EPSILON >= min) |
#define | MIN(x, y) ((x < y) ? x : y) |
Typedefs | |
typedef struct tnode * | tree_t |
typedef struct lnode * | list_t |
Functions | |
list_t | list_alloc (tree_t a, list_t s) |
tree_t | leaf_alloc (int m, int t) |
tree_t | tree_alloc (int m, int t, tree_t *s) |
int | l2 (unsigned long x) |
int | is_leaf (int m, int t) |
double | bino_d (int a, int b) |
double | binomial_d (int a, int b) |
double | log_bino_d (int a, int b) |
double | log_binomial_d (int a, int b) |
double | dicho_si_lb_node (int i, distrib_t d) |
double | dicho_si_lb_leaf (int m, int t, int l) |
void | dicho_si_lb_rec (int m, int t, precomp_t p, double **pe) |
double ** | dicho_si_lb (precomp_t p) |
double | dicho_si_node (int i, distrib_t d) |
double | dicho_si_leaf (int m, int t, int l) |
void | dicho_si_rec (int m, int t, precomp_t p, double **pe) |
double ** | dicho_si (precomp_t p) |
double * | dicho_self_info_bounds (precomp_t p) |
unsigned long | update_delta (int i, distrib_t d, unsigned long delta) |
unsigned long | adjust_delta (unsigned long delta, int *l) |
double | dicho_si_from_list (list_t l, unsigned long delta, int len, double z, precomp_t p) |
double | tree_search (tree_t a, list_t path, list_t todo, unsigned long delta, int len, double z, precomp_t p) |
tree_t | dicho_build_tree (int m, int t, precomp_t p) |
void | clear_tree (tree_t a, precomp_t p) |
double | dicho_searchmin (precomp_t p, double min_value) |
distrib_t | init_proba (int m, int t, int i) |
leaf_info_t | leaf_info (int m, int t) |
double | max_si_loss (int m, int t, distrib_t d) |
void | distrib_clear (distrib_t dist) |
precomp_t | precomp_build (int m, int t, int reduc) |
void | write_precomp (precomp_t p, FILE *output_stream) |
void | clear_precomp (precomp_t p) |
Variables | |
double ** | si_lb |
double | min = 0 |
#define ABOVE_MIN | ( | len, | |||
delta, | |||||
z | ) | ((len) + PREC_INTER - log2(delta) + (z) + EPSILON >= min) |
#define EPSILON (1.0 / (1UL << PREC_INTER)) |
#define INFINITY (1.0 / 0.0) |
Definition at line 27 of file precomp.c.
Referenced by dicho_si_from_list(), log_binomial_d(), and tree_search().
#define MIN | ( | x, | |||
y | ) | ((x < y) ? x : y) |
Referenced by clear_precomp(), precomp_build(), and write_precomp().
unsigned long adjust_delta | ( | unsigned long | delta, | |
int * | l | |||
) |
Definition at line 329 of file precomp.c.
References l2(), and PREC_INTER.
Referenced by dicho_si_from_list(), and tree_search().
double bino_d | ( | int | a, | |
int | b | |||
) |
double binomial_d | ( | int | a, | |
int | b | |||
) |
Definition at line 125 of file precomp.c.
References bino_d().
Referenced by dicho_si_from_list(), dicho_si_lb_leaf(), dicho_si_leaf(), init_proba(), leaf_info(), and max_si_loss().
void clear_precomp | ( | precomp_t | p | ) |
Definition at line 727 of file precomp.c.
References precomp::distrib, distrib_clear(), is_leaf(), precomp::m, distrib_t::max, MIN, precomp::offset, and precomp::t.
Referenced by main().
Definition at line 446 of file precomp.c.
References tnode::m, distrib_t::max, distrib_t::min, precomp_get_distrib, tnode::sons, and tnode::t.
Referenced by dicho_searchmin().
Definition at line 420 of file precomp.c.
References is_leaf(), leaf_alloc(), distrib_t::max, distrib_t::min, precomp_get_distrib, and tree_alloc().
Referenced by dicho_searchmin().
double dicho_searchmin | ( | precomp_t | p, | |
double | min_value | |||
) |
Definition at line 459 of file precomp.c.
References clear_tree(), dicho_build_tree(), dicho_si_lb(), precomp::m, min, PREC_INTER, precomp::real_m, precomp::real_t, si_lb, precomp::t, and tree_search().
Referenced by main().
double* dicho_self_info_bounds | ( | precomp_t | p | ) |
Definition at line 296 of file precomp.c.
References dicho_si(), dicho_si_lb(), EPSILON, precomp::m, precomp::real_m, precomp::real_t, si_lb, and precomp::t.
Referenced by main().
double** dicho_si | ( | precomp_t | p | ) |
Definition at line 274 of file precomp.c.
References dicho_si_rec(), precomp::m, and precomp::t.
Referenced by dicho_self_info_bounds().
Definition at line 336 of file precomp.c.
References ABOVE_MIN, adjust_delta(), binomial_d(), leaf_info_t::deadbits, INFINITY, precomp::leaf_info, tnode::m, min, lnode::next, PREC_INTER, si_lb, tnode::t, and lnode::tree.
Referenced by tree_search().
double** dicho_si_lb | ( | precomp_t | p | ) |
Definition at line 208 of file precomp.c.
References dicho_si_lb_rec(), precomp::m, and precomp::t.
Referenced by dicho_searchmin(), and dicho_self_info_bounds().
double dicho_si_lb_leaf | ( | int | m, | |
int | t, | |||
int | l | |||
) |
Definition at line 167 of file precomp.c.
References binomial_d(), and PREC_INTER.
Referenced by dicho_si_lb_rec().
double dicho_si_lb_node | ( | int | i, | |
distrib_t | d | |||
) |
Definition at line 154 of file precomp.c.
References distrib_get_proba, distrib_t::max, PREC_INTER, and PREC_PROBA.
Referenced by dicho_si_lb_rec(), and max_si_loss().
void dicho_si_lb_rec | ( | int | m, | |
int | t, | |||
precomp_t | p, | |||
double ** | pe | |||
) |
Definition at line 179 of file precomp.c.
References leaf_info_t::deadbits, dicho_si_lb_leaf(), dicho_si_lb_node(), is_leaf(), precomp::leaf_info, distrib_t::max, distrib_t::min, and precomp_get_distrib.
Referenced by dicho_si_lb(), and dicho_si_rec().
double dicho_si_leaf | ( | int | m, | |
int | t, | |||
int | l | |||
) |
Definition at line 239 of file precomp.c.
References binomial_d().
Referenced by dicho_si_rec().
double dicho_si_node | ( | int | i, | |
distrib_t | d | |||
) |
Definition at line 226 of file precomp.c.
References distrib_get_proba, distrib_t::max, and PREC_PROBA.
Referenced by dicho_si_rec().
void dicho_si_rec | ( | int | m, | |
int | t, | |||
precomp_t | p, | |||
double ** | pe | |||
) |
Definition at line 247 of file precomp.c.
References leaf_info_t::deadbits, dicho_si_lb_rec(), dicho_si_leaf(), dicho_si_node(), is_leaf(), precomp::leaf_info, distrib_t::max, distrib_t::min, and precomp_get_distrib.
Referenced by dicho_si().
void distrib_clear | ( | distrib_t | dist | ) |
Definition at line 544 of file precomp.c.
References distrib_t::prob.
Referenced by clear_precomp(), and precomp_build().
distrib_t init_proba | ( | int | m, | |
int | t, | |||
int | i | |||
) |
Definition at line 475 of file precomp.c.
References binomial_d(), distrib_get_proba, distrib_t::max, distrib_t::min, PREC_PROBA, distrib_t::prob, and round().
Referenced by precomp_build().
tree_t leaf_alloc | ( | int | m, | |
int | t | |||
) |
Definition at line 47 of file precomp.c.
References tnode::m, tnode::sons, and tnode::t.
Referenced by dicho_build_tree().
leaf_info_t leaf_info | ( | int | m, | |
int | t | |||
) |
Definition at line 499 of file precomp.c.
References binomial_d(), leaf_info_t::deadbits, l2(), leaf_info_t::maximum, PREC_INTER, and PREC_PROBA.
Referenced by precomp_build().
Definition at line 40 of file precomp.c.
References lnode::next, and lnode::tree.
Referenced by tree_search().
double log_bino_d | ( | int | a, | |
int | b | |||
) |
double log_binomial_d | ( | int | a, | |
int | b | |||
) |
Definition at line 139 of file precomp.c.
References INFINITY, and log_bino_d().
Referenced by main().
double max_si_loss | ( | int | m, | |
int | t, | |||
distrib_t | d | |||
) |
Definition at line 528 of file precomp.c.
References binomial_d(), dicho_si_lb_node(), distrib_t::max, and distrib_t::min.
Referenced by precomp_build().
precomp_t precomp_build | ( | int | m, | |
int | t, | |||
int | reduc | |||
) |
Definition at line 548 of file precomp.c.
References precomp::distrib, distrib_clear(), init_proba(), is_leaf(), leaf_info(), precomp::leaf_info, precomp::m, distrib_t::max, max_si_loss(), MIN, distrib_t::min, precomp::offset, precomp::real_m, precomp::real_t, and precomp::t.
Referenced by main().
Definition at line 55 of file precomp.c.
References tnode::m, tnode::sons, and tnode::t.
Referenced by dicho_build_tree().
double tree_search | ( | tree_t | a, | |
list_t | path, | |||
list_t | todo, | |||
unsigned long | delta, | |||
int | len, | |||
double | z, | |||
precomp_t | p | |||
) |
Definition at line 380 of file precomp.c.
References ABOVE_MIN, adjust_delta(), dicho_si_from_list(), INFINITY, list_alloc(), tnode::m, distrib_t::max, distrib_t::min, lnode::next, precomp_get_distrib, si_lb, tnode::sons, tnode::t, lnode::tree, and update_delta().
Referenced by dicho_searchmin().
unsigned long update_delta | ( | int | i, | |
distrib_t | d, | |||
unsigned long | delta | |||
) |
Definition at line 320 of file precomp.c.
References distrib_get_proba, distrib_t::max, and PREC_PROBA.
Referenced by tree_search().
void write_precomp | ( | precomp_t | p, | |
FILE * | output_stream | |||
) |
Definition at line 631 of file precomp.c.
References leaf_info_t::deadbits, precomp::distrib, distrib_get_proba, is_leaf(), precomp::leaf_info, precomp::m, distrib_t::max, leaf_info_t::maximum, MIN, distrib_t::min, min, precomp::real_m, precomp::real_t, and precomp::t.
Referenced by main().
double min = 0 |
Definition at line 289 of file precomp.c.
Referenced by best_wf(), dicho_searchmin(), dicho_si_from_list(), main(), workfactor(), and write_precomp().
double** si_lb |
Definition at line 288 of file precomp.c.
Referenced by dicho_searchmin(), dicho_self_info_bounds(), dicho_si_from_list(), and tree_search().