void initial_Window(void) { //creates the window to show if(mode==0){ iSetColor(0,255,100); iFilledRectangle(0,0,window_sizeX,window_sizeY); iShowBMP(0,0,"func_plot.bmp"); iShowBMP(700,400,"cartesian.bmp"); iShowBMP(700,300,"polar.bmp"); iShowBMP(400,200,"help.bmp"); iShowBMP(250,200,"credit.bmp"); } if(mode==1) cartesian_draw(); else if(mode==2) polar_draw(); else if(mode==4) help_view(); else if(mode==5) show_credits(); }
//---------------------------------------------------------------------- // required virtual method void SepStratSampler::draw(){ n_ = mod_->suf()->n(); sumsq_ = mod_->suf()->center_sumsq(mod_->mu()); sumsq_upper_chol_ = sumsq_.chol(); sumsq_upper_chol_.transpose_inplace_square(); clock_t start = clock(); bool ok = fast_draw(); if(ok){ // cout << "fast draw" << endl; ++fast_count_; clock_t done = clock(); double fast_time = done - start; fast_time_ += fast_time/CLOCKS_PER_SEC; return; } clock_t bail = clock(); double wasted_time = bail-start; wasted_time_ += wasted_time/CLOCKS_PER_SEC; if(runif() < polar_frac_){ // backup is a polar draw // cout << "polar draw" << endl; polar_draw(); ++polar_count_; clock_t done = clock(); double polar_time = done - bail; polar_time_ += polar_time/CLOCKS_PER_SEC; }else{ // backup is a one-at-a-time draw // cout << "stable draw" << endl; stable_draw(); ++stable_count_; clock_t done = clock(); double stable_time = done - bail; stable_time_ += stable_time/CLOCKS_PER_SEC; } }