/* ** Copyright (C) 1995,2003-2004 Peter Schachte and The University of Melbourne. ** This file may only be copied under the terms of the GNU Library General ** Public License - see the file COPYING.LIB in the Mercury distribution. */ /***************************************************************** File : test_rglb.c Author : Peter Schachte Origin : Thu Jul 13 17:57:03 1995 Purpose : Timing test for bryant graph MR_ROBDD_restricted_glb code *****************************************************************/ #include #include #include "bryant.h" #include "timing.h" #define VARLIMIT 1024 int opcount; void usage(char *progname) { printf("usage: %s size maxvar [repetitions]\n", progname); printf(" creates all possible pairs of v <-> v1 & v2 & ... & vsize functions, computes\n"); printf(" their MR_ROBDD_glb, and restricts this to each threshold between 0 and maxvar. Each V\n"); printf(" and the vi are between 0 and maxvar inclusive. If repetitions is >0, this\n"); printf(" will be done that many times.\n"); } void init_array(int top, int v0, int array[]) { int i, val; for (i=0, val=0; i=VARLIMIT) { usage(argv[0]); printf("\n varmax must be between 1 <= varmax < %d\n", VARLIMIT); return 20; } if ((size=atoi(argv[1]))<0 || size>=varmax) { usage(argv[0]); printf("\n size must be between 0 <= size < varmax\n"); return 20; } repetitions=(argc>3 ? atoi(argv[3]) : 1); if (repetitions <= 0) repetitions = 1; opcount = 0; clock0 = milli_time(); for (reps=repetitions; reps>0; --reps) { for (thresh=0; thresh<=varmax; ++thresh) { for (vf=0; vf0; --reps) { for (thresh=0; thresh<=varmax; ++thresh) { for (vf=0; vf