int main(void) { vga_init(); /* Create virtual screen. */ vbuf = malloc(VWIDTH * VHEIGHT); gl_setcontextvirtual(VWIDTH, VHEIGHT, 1, 8, vbuf); /* Set Mode X-style 320x240x256. */ vga_setmode(G320x240x256); gl_setrgbpalette(); vga_clear(); boxes(); demo1(); demo2(); vga_setmode(G320x200x256); /* Set linear 320x200x256. */ gl_setrgbpalette(); demo3(); vga_setmode(TEXT); exit(0); }
/* cs_ci_demo3: read a matrix and test Cholesky update/downdate */ int main (void) { problem *Prob = get_problem (stdin, 0) ; demo3 (Prob) ; free_problem (Prob) ; return (0) ; }
int main (int argc, char **argv) { FILE *f ; problem *Prob ; int trials, ok, demo ; if (argc < 2) return (-1) ; printf ("cs_test, file: %s\n", argv [1]) ; for (demo = 2 ; demo <= 3 ; demo++) { printf ("demo: %d\n", demo) ; for (trials = 0 ; trials < 4000 ; trials++) { malloc_count = trials ; f = fopen (argv [1], "r") ; if (!f) return (-1) ; Prob = get_problem (f, (demo == 2) ? 1e-14 : 0) ; fclose (f) ; if (Prob) ok = (demo == 2) ? demo2 (Prob) : demo3 (Prob) ; free_problem (Prob) ; if (malloc_count > 0) break ; } printf ("demo %d # trials: %d\n", demo, trials) ; } return (0) ; }
int main() { /* * Call ppgbeg to initiate PGPLOT and open the output device; cpgbeg * will prompt the user to supply the device name and type. */ if(cpgbeg(0, "?", 1, 1) != 1) exit(EXIT_FAILURE); cpgask(1); /* * Call each demo. */ demo1(); demo2(); demo3(); /* * Finally, call cpgend to terminate things properly. */ cpgend(); return EXIT_SUCCESS; }