bool TTimeHists::Run() { // run all tests with current settings, and check for identity of content. Double_t check[2]; Long64_t rep[2]; for (int h = 0; h < 2; ++h) { rep[h] = 0; SetupValues(); try { TStopwatch w; w.Start(); SetupHist((EHist) h); w.Stop(); do { w.Start(kFALSE); Fill((EHist) h); check[h] = Check((EHist) h); w.Stop(); ++rep[h]; } while ((!h && w.RealTime() < 0.1) || (h && rep[0] > 0 && rep[1] < rep[0])); fTime[h][0] = (1.* fNum * rep[h]) / w.RealTime() / 1E6; fTime[h][1] = (1.* fNum * rep[h]) / w.CpuTime() / 1E6; if (h == 1 && (fTime[h][0] > 1E20 || fTime[h][1] > 1E20)) { do { // some more cycles: w.Start(kFALSE); Fill((EHist) h); Check((EHist) h); w.Stop(); ++rep[h]; } while (w.RealTime() < 0.1); fTime[h][0] = (1.* fNum * rep[h]) / w.RealTime() / 1E6; fTime[h][1] = (1.* fNum * rep[h]) / w.CpuTime() / 1E6; } if (fTime[h][0] > 1E20) fTime[h][0] = 1E20; if (fTime[h][1] > 1E20) fTime[h][1] = 1E20; } catch (std::exception&) { fTime[h][0] = fTime[h][1] = -1.; check[h] = -1.; // can never be < 1 without exception rep[h] = -1; } } if (check[0] != check[1]) if (check[0] != -1.) printf("ERROR: mismatch of histogram (%g) and sparse histogram (%g) for dim=%d, bins=%d!\n", check[0], check[1], fDim, fBins); // else // printf("ERROR: cannot allocate histogram for dim=%d, bins=%d - out of memory!\n", // fDim, fBins); return (check[0] == check[1]); }
//--------------------------------------------------------------------------- void __fastcall TSegmentationForm::SetupSegmentation_Values() { if(this->SegmentationTypeRadio->ItemIndex == 0) { SegmentationCriteriaRadio->Enabled = false; ValuesGroup->Enabled = false; } else { SegmentationCriteriaRadio->Enabled = true; ValuesGroup->Enabled = true; } SetupValues(); }
void __fastcall TSegmentationForm::SegmentationCriteriaRadioClick(TObject *Sender) { SetupValues(); }