Added timer for bests solutions
This commit is contained in:
10
lceb.h
10
lceb.h
@@ -1,3 +1,4 @@
|
||||
#include <time.h>
|
||||
|
||||
#define MAXINPUT 6 /* max numbers as input */
|
||||
#define ALLOCSIZE 1024 /* # of elements to alloc when needed */
|
||||
@@ -55,6 +56,7 @@ typedef struct best {
|
||||
char *oper;
|
||||
NODE *root;
|
||||
int *values;
|
||||
struct timespec timer;
|
||||
} BEST;
|
||||
|
||||
/* tree.c */
|
||||
@@ -103,6 +105,8 @@ extern char *nth_comb(int n);
|
||||
//extern int eval_stack(STACK *stack);
|
||||
/* tree version */
|
||||
extern int eval_node(NODE *node, int depth, int *pvals, char *pops, int *ncalcs);
|
||||
extern int get_totnodes();
|
||||
extern int get_totleaves();
|
||||
|
||||
/* best.c */
|
||||
extern int stopped();
|
||||
@@ -110,3 +114,9 @@ extern void set_target (int n);
|
||||
extern int check_best(int res, int nops, NODE *node, int *values, char *ops);
|
||||
extern void print_best(NODE *node, int *values, char *pops, int depth);
|
||||
extern void print_bests();
|
||||
|
||||
/* timer.c */
|
||||
extern int sigint_received;
|
||||
extern void start_timer();
|
||||
extern void set_timer(struct timespec *timer);
|
||||
extern double get_timer(struct timespec timer);
|
||||
|
Reference in New Issue
Block a user