src/misc/espresso/cvrmisc.c File Reference
#include "espresso.h"
Go to the source code of this file.
Function Documentation
void cover_cost |
( |
IN pcover |
F, |
|
|
INOUT pcost |
cost | |
|
) |
| | |
Definition at line 14 of file cvrmisc.c.
00017 {
00018 register pcube p, last;
00019 pcube *T;
00020 int var;
00021
00022
00023 massive_count(T = cube1list(F));
00024 free_cubelist(T);
00025
00026 cost->cubes = F->count;
00027 cost->total = cost->in = cost->out = cost->mv = cost->primes = 0;
00028
00029
00030 for(var = 0; var < cube.num_binary_vars; var++)
00031 cost->in += cdata.var_zeros[var];
00032
00033
00034 for(var = cube.num_binary_vars; var < cube.num_vars - 1; var++)
00035 if (cube.sparse[var])
00036 cost->mv += F->count * cube.part_size[var] - cdata.var_zeros[var];
00037 else
00038 cost->mv += cdata.var_zeros[var];
00039
00040
00041 if (cube.num_binary_vars != cube.num_vars) {
00042 var = cube.num_vars - 1;
00043 cost->out = F->count * cube.part_size[var] - cdata.var_zeros[var];
00044 }
00045
00046
00047 foreach_set(F, last, p)
00048 cost->primes += TESTP(p, PRIME) != 0;
00049
00050
00051 cost->total = cost->in + cost->out + cost->mv;
00052 }
Definition at line 137 of file cvrmisc.c.
00139 {
00140 (void) fprintf(stderr, "espresso: %s\n", s);
00141 exit(1);
00142 }
char* fmt_cost |
( |
IN pcost |
cost |
) |
|
Definition at line 56 of file cvrmisc.c.
00058 {
00059 static char s[200];
00060
00061 if (cube.num_binary_vars == cube.num_vars - 1)
00062 (void) sprintf(s, "c=%d(%d) in=%d out=%d tot=%d",
00063 cost->cubes, cost->cubes - cost->primes, cost->in,
00064 cost->out, cost->total);
00065 else
00066 (void) sprintf(s, "c=%d(%d) in=%d mv=%d out=%d",
00067 cost->cubes, cost->cubes - cost->primes, cost->in,
00068 cost->mv, cost->out);
00069 return s;
00070 }
char* print_cost |
( |
IN pcover |
F |
) |
|
void print_trace |
( |
pcover |
T, |
|
|
char * |
name, |
|
|
long |
time | |
|
) |
| | |
Definition at line 106 of file cvrmisc.c.
00110 {
00111 (void) printf("# %s\tTime was %s, cost is %s\n",
00112 name, print_time(time), print_cost(T));
00113 (void) fflush(stdout);
00114 }
void size_stamp |
( |
IN pcover |
T, |
|
|
IN char * |
name | |
|
) |
| | |
Definition at line 96 of file cvrmisc.c.
00099 {
00100 (void) printf("# %s\tCost is %s\n", name, print_cost(T));
00101 (void) fflush(stdout);
00102 }
void totals |
( |
long |
time, |
|
|
int |
i, |
|
|
pcover |
T, |
|
|
pcost |
cost | |
|
) |
| | |