#include "bddint.h"
Go to the source code of this file.
Functions | |
static void | chars (char c, int n, FILE *fp) |
void | cmu_bdd_print_profile_aux (cmu_bdd_manager bddm, long *level_counts, char *(*var_naming_fn)(cmu_bdd_manager, bdd, pointer), pointer env, int line_length, FILE *fp) |
void | cmu_bdd_print_profile (cmu_bdd_manager bddm, bdd f, char *(*var_naming_fn)(cmu_bdd_manager, bdd, pointer), pointer env, int line_length, FILE *fp) |
void | cmu_bdd_print_profile_multiple (cmu_bdd_manager bddm, bdd *fs, char *(*var_naming_fn)(cmu_bdd_manager, bdd, pointer), pointer env, int line_length, FILE *fp) |
void | cmu_bdd_print_function_profile (cmu_bdd_manager bddm, bdd f, char *(*var_naming_fn)(cmu_bdd_manager, bdd, pointer), pointer env, int line_length, FILE *fp) |
void | cmu_bdd_print_function_profile_multiple (cmu_bdd_manager bddm, bdd *fs, char *(*var_naming_fn)(cmu_bdd_manager, bdd, pointer), pointer env, int line_length, FILE *fp) |
Variables | |
static char | profile_width [] = "XXXXXXXXX" |
static void chars | ( | char | c, | |
int | n, | |||
FILE * | fp | |||
) | [static] |
Definition at line 14 of file bddprprofile.c.
void cmu_bdd_print_function_profile | ( | cmu_bdd_manager | bddm, | |
bdd | f, | |||
char *(*)(cmu_bdd_manager, bdd, pointer) | var_naming_fn, | |||
pointer | env, | |||
int | line_length, | |||
FILE * | fp | |||
) |
Definition at line 145 of file bddprprofile.c.
00151 { 00152 long *level_counts; 00153 00154 if (bdd_check_arguments(1, f)) 00155 { 00156 level_counts=(long *)mem_get_block((SIZE_T)((bddm->vars+1)*sizeof(long))); 00157 cmu_bdd_function_profile(bddm, f, level_counts); 00158 cmu_bdd_print_profile_aux(bddm, level_counts, var_naming_fn, env, line_length, fp); 00159 mem_free_block((pointer)level_counts); 00160 } 00161 else 00162 fputs("overflow\n", fp); 00163 }
void cmu_bdd_print_function_profile_multiple | ( | cmu_bdd_manager | bddm, | |
bdd * | fs, | |||
char *(*)(cmu_bdd_manager, bdd, pointer) | var_naming_fn, | |||
pointer | env, | |||
int | line_length, | |||
FILE * | fp | |||
) |
Definition at line 170 of file bddprprofile.c.
00176 { 00177 long *level_counts; 00178 00179 bdd_check_array(fs); 00180 level_counts=(long *)mem_get_block((SIZE_T)((bddm->vars+1)*sizeof(long))); 00181 cmu_bdd_function_profile_multiple(bddm, fs, level_counts); 00182 cmu_bdd_print_profile_aux(bddm, level_counts, var_naming_fn, env, line_length, fp); 00183 mem_free_block((pointer)level_counts); 00184 }
void cmu_bdd_print_profile | ( | cmu_bdd_manager | bddm, | |
bdd | f, | |||
char *(*)(cmu_bdd_manager, bdd, pointer) | var_naming_fn, | |||
pointer | env, | |||
int | line_length, | |||
FILE * | fp | |||
) |
Definition at line 99 of file bddprprofile.c.
00105 { 00106 long *level_counts; 00107 00108 if (bdd_check_arguments(1, f)) 00109 { 00110 level_counts=(long *)mem_get_block((SIZE_T)((bddm->vars+1)*sizeof(long))); 00111 cmu_bdd_profile(bddm, f, level_counts, 1); 00112 cmu_bdd_print_profile_aux(bddm, level_counts, var_naming_fn, env, line_length, fp); 00113 mem_free_block((pointer)level_counts); 00114 } 00115 else 00116 fputs("overflow\n", fp); 00117 }
void cmu_bdd_print_profile_aux | ( | cmu_bdd_manager | bddm, | |
long * | level_counts, | |||
char *(*)(cmu_bdd_manager, bdd, pointer) | var_naming_fn, | |||
pointer | env, | |||
int | line_length, | |||
FILE * | fp | |||
) |
Definition at line 29 of file bddprprofile.c.
00035 { 00036 long i, n; 00037 int l; 00038 char *name; 00039 int max_prefix_len; 00040 int max_profile_width; 00041 int histogram_column; 00042 int histogram_width; 00043 int profile_scale; 00044 long total; 00045 00046 n=bddm->vars; 00047 /* max_... initialized with values for leaf nodes */ 00048 max_prefix_len=5; 00049 max_profile_width=level_counts[n]; 00050 total=level_counts[n]; 00051 for (i=0; i < n; ++i) 00052 if (level_counts[i]) 00053 { 00054 sprintf(profile_width, "%ld", level_counts[i]); 00055 l=strlen(bdd_var_name(bddm, bddm->variables[bddm->indexindexes[i]], var_naming_fn, env))+strlen(profile_width); 00056 if (l > max_prefix_len) 00057 max_prefix_len=l; 00058 if (level_counts[i] > max_profile_width) 00059 max_profile_width=level_counts[i]; 00060 total+=level_counts[i]; 00061 } 00062 histogram_column=max_prefix_len+3; 00063 histogram_width=line_length-histogram_column-1; 00064 if (histogram_width < 20) 00065 histogram_width=20; /* Random minimum width */ 00066 if (histogram_width >= max_profile_width) 00067 profile_scale=1; 00068 else 00069 profile_scale=(max_profile_width+histogram_width-1)/histogram_width; 00070 for (i=0; i < n; ++i) 00071 if (level_counts[i]) 00072 { 00073 name=bdd_var_name(bddm, bddm->variables[bddm->indexindexes[i]], var_naming_fn, env); 00074 fputs(name, fp); 00075 fputc(':', fp); 00076 sprintf(profile_width, "%ld", level_counts[i]); 00077 chars(' ', (int)(max_prefix_len-strlen(name)-strlen(profile_width)+1), fp); 00078 fputs(profile_width, fp); 00079 fputc(' ', fp); 00080 chars('#', level_counts[i]/profile_scale, fp); 00081 fputc('\n', fp); 00082 } 00083 fputs("leaf:", fp); 00084 sprintf(profile_width, "%ld", level_counts[n]); 00085 chars(' ', (int)(max_prefix_len-4-strlen(profile_width)+1), fp); 00086 fputs(profile_width, fp); 00087 fputc(' ', fp); 00088 chars('#', level_counts[n]/profile_scale, fp); 00089 fputc('\n', fp); 00090 fprintf(fp, "Total: %ld\n", total); 00091 }
void cmu_bdd_print_profile_multiple | ( | cmu_bdd_manager | bddm, | |
bdd * | fs, | |||
char *(*)(cmu_bdd_manager, bdd, pointer) | var_naming_fn, | |||
pointer | env, | |||
int | line_length, | |||
FILE * | fp | |||
) |
Definition at line 124 of file bddprprofile.c.
00130 { 00131 long *level_counts; 00132 00133 bdd_check_array(fs); 00134 level_counts=(long *)mem_get_block((SIZE_T)((bddm->vars+1)*sizeof(long))); 00135 cmu_bdd_profile_multiple(bddm, fs, level_counts, 1); 00136 cmu_bdd_print_profile_aux(bddm, level_counts, var_naming_fn, env, line_length, fp); 00137 mem_free_block((pointer)level_counts); 00138 }
char profile_width[] = "XXXXXXXXX" [static] |
Definition at line 9 of file bddprprofile.c.