void f11(H h) { // CHECK: call void @_ZN1HC1Ev // CHECK: call void @_Z3f10RK1H // CHECK: call void @_ZN1HD1Ev f10(H()); // CHECK: call void @_Z3f10RK1H // CHECK-NOT: call void @_ZN1HD1Ev // CHECK: ret void f10(h); }
int main(void) { f0(); f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); f10(); f11(); f12(); f13(); f14(); f15(); f16(); f17(); f18(); f19(); f20(); f21(); f22(); f23(); f24(); f25(); f26(); f27(); f28(); f29(); return 0; }
int main(void){ node n; n.i = 'r'; f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); f10(); f11(); f12(); f13(); f14(); f15(); putchar(f16()); f17('g'); putchar(f18(&n)->i); putchar(f19(en1) + 'a'); putchar(f20(en4) + 'a'); putchar(f21(en4) + 'a'); return 0; }
static void avx512f_test (void) { int i; for (i = 0; i < N; i++) { asm (""); f[i] = -256.0f + i; d[i] = -258.0 + i; k[i] = (i * 731) & (N - 1); q[i] = (i * 657) & (N - 1); t[i] = (i * 657) & (N - 1); l[i] = &f[(i * 239) & (N - 1)]; n[i] = &d[(i * 271) & (N - 1)]; r[i] = &t[(i * 323) & (N - 1)]; s[i] = &k[(i * 565) & (N - 1)]; m[i] = &s[(i * 13) & (N - 1)]; o[i] = &r[(i * 19) & (N - 1)]; } if (f1 () != 136448.0f || f2 (f) != 136448.0f || f3 () != 130304.0) abort (); if (f4 () != 261376 || f5 () != 135424.0 || f6 (d) != 135424.0) abort (); if (f7 () != 129280.0 || f8 () != 259840L || f9 () != 130816.0f) abort (); if (f10 (f) != 130816.0f || f11 () != 129792.0 || f12 (d) != 129792.0) abort (); }
int main() { int xx = 6; int aa[5] = {1, 2, 3, 4, 5}; int a = 0x0101; int b = 0x0202; int c; int *p = (int *)(&aa+1); c = a&(~b); c = c|b; char s[10] = "abcd"; char * B = "154546748764"; xx += (xx++); printf("%d\n", xx); xx = 6; xx += (++xx); printf("%d\n", xx); xx = 6; // (xx++) += xx; // printf("%d\n", xx); //printf("%d\n", xx); printf("%d\n", sizeof(B)); printf("%d\n", sizeof(s)); printf("%x, %d\n", c,c); printf("%d\n", Z*Z*Z); printf("%d,%d\n", *(aa+1), *(p-1)); f9(); f10(); f14(); //f14ex(); f17(); return 0; }
int main(void) { f0(); f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); f10(); f11(); f12(); f13(); f14(); f15(); f16(); f17(); f18(); f19(); return 0; }
int main(void) { f0(); f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); f10(); f11(); f12(); f13(); f14(); f15(); f16(); f17(); f18(); f19(); f20(); f21(); f22(); f23(); f24(); f25(); f26(); f27(); f28(); f29(); f30(); f31(); f32(); f33(); f34(); f35(); f36(); f37(); f38(); f39(); f40(); f41(); f42(); f43(); f44(); f45(); f46(); f47(); f48(); f49(); f50(); f51(); f52(); return 0; }
void ControlPresencial::MonitorizaFicheros(QString str) { // ControlPresencial* mc = new ControlPresencial; qDebug() << "Monitoriza ficheros " << str; QFileSystemWatcher *watcher = new QFileSystemWatcher(this); if(str.contains("inicio")){ QFile f("/home/pi/Desktop/RFID-US/errorconexion.log"); f.open(QIODevice::ReadWrite); QFile f2("/home/pi/Desktop/RFID-US/erroraulas.log"); f2.open(QIODevice::ReadWrite); QFile f3("/home/pi/Desktop/RFID-US/errorlector.log"); f3.open(QIODevice::ReadWrite); QFile f4("/home/pi/Desktop/RFID-US/usuarioregistrado.log"); f4.open(QIODevice::ReadWrite); QFile f5("/home/pi/Desktop/RFID-US/registro.xml"); f5.open(QIODevice::ReadWrite); QFile f6("/home/pi/Desktop/RFID-US/oklector.log"); f6.open(QIODevice::ReadWrite); QFile f7("/home/pi/Desktop/RFID-US/okconexion.log"); f7.open(QIODevice::ReadWrite); QFile f8("/home/pi/Desktop/RFID-US/errorconexionregistro.log"); f8.open(QIODevice::ReadWrite); QFile f9("/home/pi/Desktop/RFID-US/errorrecibido.log"); f9.open(QIODevice::ReadWrite); QFile f10("/home/pi/Desktop/RFID-US/errordom2.log"); f10.open(QIODevice::ReadWrite); QFile f11("/home/pi/Desktop/RFID-US/erroreneldom.log"); f11.open(QIODevice::ReadWrite); QFile f12("/home/pi/Desktop/RFID-US/errorbbdd.log"); f12.open(QIODevice::ReadWrite); QFile f13("/home/pi/Desktop/RFID-US/reintentarlector.log"); f13.open(QIODevice::ReadWrite); QObject::connect(watcher, SIGNAL(fileChanged(QString)),this, SLOT(showModified(QString))); watcher->addPath("/home/pi/Desktop/RFID-US/errorconexion.log"); watcher->addPath("/home/pi/Desktop/RFID-US/erroraulas.log"); watcher->addPath("/home/pi/Desktop/RFID-US/errorlector.log"); watcher->addPath("/home/pi/Desktop/RFID-US/usuarioregistrado.log"); watcher->addPath("/home/pi/Desktop/RFID-US/registro.xml"); watcher->addPath("/home/pi/Desktop/RFID-US/oklector.log"); watcher->addPath("/home/pi/Desktop/RFID-US/okconexion.log"); watcher->addPath("/home/pi/Desktop/RFID-US/errorconexionregistro.log"); watcher->addPath("/home/pi/Desktop/RFID-US/errorrecibido.log"); watcher->addPath("/home/pi/Desktop/RFID-US/errordom2.log"); watcher->addPath("/home/pi/Desktop/RFID-US/erroreneldom.log"); watcher->addPath("/home/pi/Desktop/RFID-US/errorbbdd.log"); watcher->addPath("/home/pi/Desktop/RFID-US/reintentarlector.log"); } else { QFile f(str); f.open(QIODevice::ReadWrite); qDebug() << "Creamos el fichero " << str; watcher->addPath(str); } }
int main() { int i; for( i = 0; i < 100; ++i ) { f10(); f20(); f30(); f40(); } return 0; }
double benchmarkEvaluation(double *x) { evaluations++; switch (instance) { case 1: return f1(x); case 2: return f2(x); case 3: return f3(x); case 4: return f4(x); case 5: return f5(x); case 6: return f6(x); case 7: return f7(x); case 8: return f8(x); case 9: return f9(x); case 10: return f10(x); case 11: return f11(x); case 12: return f12(x); case 13: return f13(x); case 14: return f14(x); case 15: return f15(x); case 16: return f16(x); case 17: return f17(x); case 18: return f18(x); case 19: return f19(x); case 20: return f20(x); default: printf("Benchmark instance %d not found.\n", instance); exit(EXIT_FAILURE); } }
int main(void) { f0(); f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); f10(); return 0; }
int main(void) { f0(); f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); f10(); f11(); f12(); f13(); f14(); f15(); f16(); f17(); f18(); f19(); f20(); f21(); f22(); f23(); f24(); f25(); f26(); f27(); f28(); f29(); f30(); f31(); f32(); f33(); f34(); f35(); f36(); f37(); f38(); f39(); f40(); f41(); f42(); f43(); f44(); f45(); f46(); f47(); f48(); f49(); f50(); f51(); f52(); f53(); f54(); f55(); f56(); f57(); f58(); f59(); f60(); f61(); f62(); f63(); f64(); f65(); f66(); f67(); f68(); f69(); f70(); f71(); f72(); f73(); f74(); f75(); f76(); f77(); f78(); f79(); f80(); f81(); f82(); f83(); f84(); f85(); f86(); f87(); f88(); f89(); f90(); f91(); f92(); f93(); f94(); f95(); f96(); f97(); f98(); f99(); f100(); f101(); f102(); f103(); f104(); f105(); f106(); f107(); f108(); f109(); f110(); f111(); f112(); f113(); f114(); f115(); f116(); f117(); f118(); f119(); f120(); f121(); f122(); f123(); f124(); f125(); f126(); f127(); f128(); f129(); f130(); f131(); f132(); f133(); f134(); f135(); f136(); f137(); f138(); f139(); f140(); f141(); f142(); f143(); f144(); f145(); f146(); f147(); f148(); f149(); f150(); f151(); f152(); f153(); f154(); f155(); f156(); f157(); f158(); f159(); f160(); f161(); f162(); f163(); f164(); f165(); f166(); f167(); f168(); f169(); f170(); f171(); f172(); f173(); f174(); f175(); f176(); f177(); f178(); f179(); f180(); f181(); f182(); f183(); f184(); f185(); f186(); f187(); f188(); f189(); f190(); f191(); f192(); f193(); f194(); f195(); f196(); f197(); f198(); f199(); return 0; }
/* Call functions through pointers and and check against expected results. */ void test (void) { CHECK_VOID_RESULT (v0 (), 1.0); CHECK_VOID_RESULT (v1 (1.0), 2.0); CHECK_VOID_RESULT (v5 (5.0, 6.0), 12.0); CHECK_VOID_RESULT (v9 (9.0, 10.0), 20.0); CHECK_VOID_RESULT (v2 (2.0), 3.0); CHECK_VOID_RESULT (v6 (6.0, 7.0), 14.0); CHECK_VOID_RESULT (v10 (10.0, 11.0), 22.0); CHECK_RESULT (f0 (), 1.0); CHECK_RESULT (f1 (1.0), 2.0); CHECK_RESULT (f5 (5.0, 6.0), 12.0); CHECK_RESULT (f9 (9.0, 10.0), 20.0); CHECK_RESULT (f2 (2.0), 3.0); CHECK_RESULT (f6 (6.0, 7.0), 14.0); CHECK_RESULT (f10 (10.0, 11.0), 22.0); CHECK_RESULT (d0 (), 1.0); CHECK_RESULT (d1 (1.0), 2.0); CHECK_RESULT (d5 (5.0, 6.0), 12.0); CHECK_RESULT (d9 (9.0, 10.0), 20.0); CHECK_RESULT (d2 (2.0), 3.0); CHECK_RESULT (d6 (6.0, 7.0), 14.0); CHECK_RESULT (d10 (10.0, 11.0), 22.0); CHECK_RESULT (cf0 (), 1.0 + 0.0i); CHECK_RESULT (cf1 (1.0), 2.0 + 1.0i); CHECK_RESULT (cf5 (5.0, 6.0), 12.0 + 5.0i); CHECK_RESULT (cf9 (9.0, 10.0), 20.0 + 9.0i); CHECK_RESULT (cf2 (2.0), 3.0 + 2.0i); CHECK_RESULT (cf6 (6.0, 7.0), 14.0 + 6.0i); CHECK_RESULT (cf10 (10.0, 11.0), 22.0 + 10.0i); CHECK_RESULT (cd0 (), 1.0 + 0.0i); CHECK_RESULT (cd1 (1.0), 2.0 + 1.0i); CHECK_RESULT (cd5 (5.0, 6.0), 12.0 + 5.0i); CHECK_RESULT (cd9 (9.0, 10.0), 20.0 + 9.0i); CHECK_RESULT (cd2 (2.0), 3.0 + 2.0i); CHECK_RESULT (cd6 (6.0, 7.0), 14.0 + 6.0i); CHECK_RESULT (cd10 (10.0, 11.0), 22.0 + 10.0i); CHECK_VOID_RESULT ((*pv0) (), 1.0); CHECK_VOID_RESULT ((*pv1) (1.0), 2.0); CHECK_VOID_RESULT ((*pv5) (5.0, 6.0), 12.0); CHECK_VOID_RESULT ((*pv9) (9.0, 10.0), 20.0); CHECK_VOID_RESULT ((*pv2) (2.0), 3.0); CHECK_VOID_RESULT ((*pv6) (6.0, 7.0), 14.0); CHECK_VOID_RESULT ((*pv10) (10.0, 11.0), 22.0); CHECK_RESULT ((*pf0) (), 1.0); CHECK_RESULT ((*pf1) (1.0), 2.0); CHECK_RESULT ((*pf5) (5.0, 6.0), 12.0); CHECK_RESULT ((*pf9) (9.0, 10.0), 20.0); CHECK_RESULT ((*pf2) (2.0), 3.0); CHECK_RESULT ((*pf6) (6.0, 7.0), 14.0); CHECK_RESULT ((*pf10) (10.0, 11.0), 22.0); CHECK_RESULT ((*pd0) (), 1.0); CHECK_RESULT ((*pd1) (1.0), 2.0); CHECK_RESULT ((*pd5) (5.0, 6.0), 12.0); CHECK_RESULT ((*pd9) (9.0, 10.0), 20.0); CHECK_RESULT ((*pd2) (2.0), 3.0); CHECK_RESULT ((*pd6) (6.0, 7.0), 14.0); CHECK_RESULT ((*pd10) (10.0, 11.0), 22.0); CHECK_RESULT ((*pcf0) (), 1.0 + 0.0i); CHECK_RESULT ((*pcf1) (1.0), 2.0 + 1.0i); CHECK_RESULT ((*pcf5) (5.0, 6.0), 12.0 + 5.0i); CHECK_RESULT ((*pcf9) (9.0, 10.0), 20.0 + 9.0i); CHECK_RESULT ((*pcf2) (2.0), 3.0 + 2.0i); CHECK_RESULT ((*pcf6) (6.0, 7.0), 14.0 + 6.0i); CHECK_RESULT ((*pcf10) (10.0, 11.0), 22.0 + 10.0i); CHECK_RESULT ((*pcd0) (), 1.0 + 0.0i); CHECK_RESULT ((*pcd1) (1.0), 2.0 + 1.0i); CHECK_RESULT ((*pcd5) (5.0, 6.0), 12.0 + 5.0i); CHECK_RESULT ((*pcd9) (9.0, 10.0), 20.0 + 9.0i); CHECK_RESULT ((*pcd2) (2.0), 3.0 + 2.0i); CHECK_RESULT ((*pcd6) (6.0, 7.0), 14.0 + 6.0i); CHECK_RESULT ((*pcd10) (10.0, 11.0), 22.0 + 10.0i); }
int main () { int i; check_vect (); for (i = 0; i < N; i++) { switch (i % 9) { case 0: asm (""); a[i] = - i - 1; b[i] = i + 1; break; case 1: a[i] = 0; b[i] = 0; break; case 2: a[i] = i + 1; b[i] = - i - 1; break; case 3: a[i] = i; b[i] = i + 7; break; case 4: a[i] = i; b[i] = i; break; case 5: a[i] = i + 16; b[i] = i + 3; break; case 6: a[i] = - i - 5; b[i] = - i; break; case 7: a[i] = - i; b[i] = - i; break; case 8: a[i] = - i; b[i] = - i - 7; break; } } for (i = 0; i < N; i++) { switch ((i / 9) % 3) { case 0: c[i] = a[i / 9]; d[i] = b[i / 9]; break; case 1: c[i] = a[i / 9 + 3]; d[i] = b[i / 9 + 3]; break; case 2: c[i] = a[i / 9 + 6]; d[i] = b[i / 9 + 6]; break; } } f1 (); for (i = 0; i < N; i++) if (j[i] != ((i % 3) == 0 && ((i / 9) % 3) == 0)) abort (); __builtin_memset (j, -6, sizeof (j)); f2 (); for (i = 0; i < N; i++) if (j[i] != ((i % 3) == 0 && ((i / 9) % 3) == 0)) abort (); __builtin_memset (j, -6, sizeof (j)); f3 (); for (i = 0; i < N; i++) if (j[i] != ((i % 3) == 0 && ((i / 9) % 3) == 0)) abort (); __builtin_memset (j, -6, sizeof (j)); f4 (); for (i = 0; i < N; i++) if (k[i] != ((i % 3) == 0 && ((i / 9) % 3) == 0)) abort (); __builtin_memset (k, -6, sizeof (k)); f5 (); for (i = 0; i < N; i++) if (k[i] != ((i % 3) == 0 && ((i / 9) % 3) == 0)) abort (); __builtin_memset (k, -6, sizeof (k)); f6 (); for (i = 0; i < N; i++) if (j[i] != ((i % 3) == 0 || ((i / 9) % 3) == 0)) abort (); __builtin_memset (j, -6, sizeof (j)); f7 (); for (i = 0; i < N; i++) if (j[i] != ((i % 3) == 0 || ((i / 9) % 3) == 0)) abort (); __builtin_memset (j, -6, sizeof (j)); f8 (); for (i = 0; i < N; i++) if (j[i] != ((i % 3) == 0 || ((i / 9) % 3) == 0)) abort (); __builtin_memset (j, -6, sizeof (j)); f9 (); for (i = 0; i < N; i++) if (k[i] != ((i % 3) == 0 || ((i / 9) % 3) == 0)) abort (); __builtin_memset (k, -6, sizeof (k)); f10 (); for (i = 0; i < N; i++) if (k[i] != ((i % 3) == 0 || ((i / 9) % 3) == 0)) abort (); __builtin_memset (k, -6, sizeof (k)); return 0; }
void GetEccenNpart_new(char* xname = "ile") { gStyle->SetOptStat(0); gStyle->SetTitle(0); char name[100]; TChain* ch = new TChain("t"); int n; //you need a file list of root ntuple: fxxxx.lis // sprintf(name,"f%s.lis",xname); cout << "open the filelist : " << name << endl; ifstream fin(name); string filename; while(!fin.eof()){ fin >> filename; if(filename.empty()) continue; cout << filename << endl; ch->AddFile(filename.c_str()); } fin.close(); double b; int ncoll; int npart; int nHitBbc_n, nHitBbc_s; double qBBC_n, qBBC_s; double vertex, ecc_std, ecc_rp, ecc_part,e4; double r_oll,r_geo,r_arith; ch->SetBranchAddress("b", &b ); ch->SetBranchAddress("vertex", &vertex ); ch->SetBranchAddress("ncoll", &ncoll ); ch->SetBranchAddress("npart", &npart ); ch->SetBranchAddress("ecc_std", &ecc_std ); ch->SetBranchAddress("ecc_rp", &ecc_rp ); ch->SetBranchAddress("ecc_part", &ecc_part ); ch->SetBranchAddress("r_ollitra", &r_oll ); ch->SetBranchAddress("r_geo", &r_geo ); ch->SetBranchAddress("r_arith", &r_arith ); ch->SetBranchAddress("e4", &e4 ); ch->SetBranchAddress("qBBC_n", &qBBC_n ); ch->SetBranchAddress("qBBC_s", &qBBC_s ); ch->SetBranchAddress("nHitBbc_n", &nHitBbc_n); ch->SetBranchAddress("nHitBbc_s", &nHitBbc_s); char fname[100]; sprintf(fname,"rootfile/g%s_cent.root",xname); TFile* fout = new TFile(fname,"recreate");//rootfile to save distributions TH1* hbbcq = new TH1D("hbbcq","hbbcq",12000,-0.5,2999.5); hbbcq->Sumw2(); TH1* hbbcqall = new TH1D("hbbcqall","hbbcqall",12000,-0.5,2999.5);hbbcqall->Sumw2(); TH1* hbbcqeff = new TH1D("hbbcqeff","hbbcqeff",12000,-0.5,2999.5);hbbcqeff->Sumw2(); n = ch->GetEntries(); cout << "events: "<< n << endl; //First loop determines the BBC trigger efficiency //as function of bbcq; for(int i=0; i<n; i++){ ch->GetEntry(i); if(nHitBbc_n>=2&&nHitBbc_s>=2){ hbbcq->Fill( (qBBC_n+qBBC_s)/100. );//divide by 100 to fit in 0-3000 range } hbbcqall->Fill( (qBBC_n+qBBC_s)/100. ); } hbbcqeff->Divide(hbbcq,hbbcqall); efficiency = hbbcq->Integral()/hbbcqall->Integral(); cout << "efficiency : " << efficiency << endl; //hbin contains the integrated fraction starting from 0 bbc charge, including the BBC trigger efficiency TH1* hbin = new TH1D("hbin","hbin",hbbcq->GetNbinsX(),-0.5,2999.5); TH1* hbbcqscale = (TH1*)hbbcq->Clone("hbbcqscale"); hbbcqscale->Scale(1.0/hbbcq->Integral()); for(int i=1; i<=hbbcqscale->GetNbinsX(); i++){ hbin->SetBinContent(i,hbbcqscale->Integral(1,i)); } //Following two lines defines the array of cuts and average bbc charge //for centrality percentitle in 5%, 10% and 20% steps double bbcq5[21],bbcq10[11],bbcq20[6]; double abbcq5[20],abbcq10[10],abbcq20[5]; //calculate the various variables for 5% step GetCentrality(hbin,20,bbcq5,hbbcq,abbcq5); cout << endl << endl; //calculate the various variables for 10% step GetCentrality(hbin,10,bbcq10,hbbcq,abbcq10); cout << endl << endl; //calculate the various variables for 20% step GetCentrality(hbin,5,bbcq20,hbbcq,abbcq20); cout << endl << endl; cout << " Find cuts for all the centralities " << endl << endl; const int nval=9;//number of variables to fill char* centname[3] = {"5pStep","10pStep","20pStep"}; char* varname[nval] = {"npart","ncoll","b","standard_ecc","reactionplane_ecc","participant_ecc","R_Ollitraut","R_Geo", "R_arith"}; double vup[nval] = {499.5,2999.5,19.995,1,1,1,4,4,4}; double vlo[nval] = {-0.5,-0.5,-0.005,-1,-1,-1,0,0,0}; int vNb[nval] = {500,3000,2000,200,200,200,400,400,400}; //initialize the histograms which are used to fill the distribution of variables for each centrality TH1* hvar[3][nval][20]; for(int i=0; i<3; i++){ int NC = 0; if(i==0) NC = 20; else if(i==1) NC = 10; else if(i==2) NC = 5; for(int ivar=0; ivar<nval; ivar++){ for(int icen=0; icen<NC; icen++){ sprintf(name,"hvar_%s_%s_cent%d",centname[i],varname[ivar],icen); hvar[i][ivar][icen] = new TH1D(name,name,vNb[ivar],vlo[ivar],vup[ivar]); } } } double qbbcsum; for(int i=0; i<n; i++){ if(i%1000000==0) cout << i << endl; ch->GetEntry(i); if(!(nHitBbc_n>=2&&nHitBbc_s>=2)) continue;//BBC trigger condition qbbcsum = (qBBC_n+qBBC_s)/100.; int centbin5 = FindBin(20,bbcq5,qbbcsum); int centbin10 = FindBin(10,bbcq10,qbbcsum); int centbin20 = FindBin(5,bbcq20,qbbcsum); if(centbin5==-1) continue; if(centbin10==-1) continue; if(centbin20==-1) continue; //find the weight according to the corresponding average efficiency. double weight = hbbcqeff->GetBinContent(hbbcqeff->FindBin(qbbcsum)); //5 percent step // hvar[0][0][centbin5]->Fill(npart,weight); hvar[0][1][centbin5]->Fill(ncoll,weight); hvar[0][2][centbin5]->Fill(b,weight); hvar[0][3][centbin5]->Fill(ecc_std,weight); hvar[0][4][centbin5]->Fill(ecc_rp,weight); hvar[0][5][centbin5]->Fill(ecc_part,weight); hvar[0][6][centbin5]->Fill(r_oll,weight); hvar[0][7][centbin5]->Fill(r_geo,weight); hvar[0][8][centbin5]->Fill(r_arith,weight); //10 percent step // hvar[1][0][centbin10]->Fill(npart,weight); hvar[1][1][centbin10]->Fill(ncoll,weight); hvar[1][2][centbin10]->Fill(b,weight); hvar[1][3][centbin10]->Fill(ecc_std,weight); hvar[1][4][centbin10]->Fill(ecc_rp,weight); hvar[1][5][centbin10]->Fill(ecc_part,weight); hvar[1][6][centbin10]->Fill(r_oll,weight); hvar[1][7][centbin10]->Fill(r_geo,weight); hvar[1][8][centbin10]->Fill(r_arith,weight); //20 percent step // hvar[2][0][centbin20]->Fill(npart,weight); hvar[2][1][centbin20]->Fill(ncoll,weight); hvar[2][2][centbin20]->Fill(b,weight); hvar[2][3][centbin20]->Fill(ecc_std,weight); hvar[2][4][centbin20]->Fill(ecc_rp,weight); hvar[2][5][centbin20]->Fill(ecc_part,weight); hvar[2][6][centbin20]->Fill(r_oll,weight); hvar[2][7][centbin20]->Fill(r_geo,weight); hvar[2][8][centbin20]->Fill(r_arith,weight); } //get mean and RMS values for the variables float var[3][nval+1][20]; float rms[3][nval+1][20]; for(int i=0; i<3; i++){ int NC = 0; if(i==0) NC = 20; else if(i==1) NC = 10; else if(i==2) NC = 5; for(int icen=0; icen<NC; icen++){ for(int ivar=0; ivar<nval; ivar++){ var[i][ivar][icen] = hvar[i][ivar][icen]->GetMean(); rms[i][ivar][icen] = hvar[i][ivar][icen]->GetRMS(); } var[i][nval][icen] = var[i][1][icen]/sigmann; rms[i][nval][icen] = rms[i][1][icen]/sigmann; } } //save to file for(int ivar=0; ivar<4; ivar++){ for(int icen=0; icen<16; icen++){ cout<<var[0][ivar][icen]<<","; } cout<<var[2][ivar][4]<<","; cout<<endl; } cout.precision(4); sprintf(name,"5pstepresults/t%s.txt",xname); ofstream f5(name); cout << " Bin % & npart & ncoll & b & ecc_std & ecc_rp & ecc_part & r_ollitrau & T_{AB}\\\\\\hline" << endl; for(int icen=0; icen<19; icen++){ for(int ivar=0; ivar<7; ivar++){ f5 << var[0][ivar][icen] << " "; } f5 << var[0][nval][icen] << " "; f5 <<endl<< " ("; /* for(int ivar=0; ivar<7; ivar++){ f5 << rms[0][ivar][icen] << " "; } f5 << rms[0][nval][icen] << " "; f5 << ")"<< endl; */ cout << icen*5 << "-" << icen*5+5; for(int ivar=0; ivar<7; ivar++){ cout <<" & " <<var[0][ivar][icen] ; } cout <<" & " <<var[0][nval][icen] ; cout <<"\\\\"<<endl; for(int ivar=0; ivar<7; ivar++){ if(ivar==0)cout <<" & ("<<rms[0][ivar][icen]; else cout <<" & "<<rms[0][ivar][icen]; } cout <<" & "<<rms[0][nval][icen]; cout << ")\\\\\\hline" << endl; // printf(" & %3.1f & %4.1f & %2.2f & %1.3f & %1.3f & %1.3f & %1.3f \\\\\n", // var[0][0][icen],var[0][1][icen],var[0][2][icen],var[0][3][icen],var[0][4][icen],var[0][5][icen],var[0][6][icen]); //printf(" (& %3.1f & %4.1f & %2.2f & %1.3f & %1.3f & %1.3f & %1.3f) \\\\\\hline\n", // rms[0][0][icen],rms[0][1][icen],rms[0][2][icen],rms[0][3][icen],rms[0][4][icen],rms[0][5][icen],rms[0][6][icen]); } f5.close(); cout << endl << endl; sprintf(name,"10pstepresults/t%s.txt",xname); ofstream f10(name); cout <<endl<< " Bin % & npart & ncoll & b & ecc_std & ecc_rp & ecc_part & r_ollitrau & T_{AB}\\\\\\hline" << endl; for(int icen=0; icen<10; icen++){ for(int ivar=0; ivar<7; ivar++){ f10 << var[1][ivar][icen] << " "; } f10 << var[1][nval][icen] << " "; f10 <<endl<<" ("; /*for(int ivar=0; ivar<7; ivar++){ f10 << rms[1][ivar][icen] << " "; } f10 << rms[1][nval][icen] << " "; f10 << ")" << endl; */ cout << icen*10 << "-" << icen*10+10; for(int ivar=0; ivar<7; ivar++){ cout <<" & " <<var[1][ivar][icen] ; } cout <<" & " <<var[1][nval][icen] ; cout <<"\\\\"<<endl; for(int ivar=0; ivar<7; ivar++){ if(ivar==0)cout <<" & ("<<rms[1][ivar][icen]; else cout <<" & "<<rms[1][ivar][icen]; } cout <<" & "<<rms[1][nval][icen]; cout << ")\\\\\\hline" << endl; //printf(" & %3.1f & %4.1f & %2.2f & %1.3f & %1.3f & %1.3f & %1.3f \\\\\n", // var[1][0][icen],var[1][1][icen],var[1][2][icen],var[1][3][icen],var[1][4][icen],var[1][5][icen],var[1][6][icen]); //printf(" (& %3.1f & %4.1f & %2.2f & %1.3f & %1.3f & %1.3f & %1.3f) \\\\\\hline\n", // rms[1][0][icen],rms[1][1][icen],rms[1][2][icen],rms[1][3][icen],rms[1][4][icen],rms[1][5][icen],rms[1][6][icen]); } f10.close(); cout << endl << endl; sprintf(name,"20pstepresults/t%s.txt",xname); ofstream f20(name); cout <<endl<< " Bin % & npart & ncoll & b & ecc_std & ecc_rp & ecc_part & r_ollitrau & T_{AB}\\\\\\hline" << endl; for(int icen=0; icen<5; icen++){ for(int ivar=0; ivar<7; ivar++){ f20 << var[2][ivar][icen] << " "; } f20 << var[2][nval][icen] << " "; f20 << endl<< " ("; /*for(int ivar=0; ivar<7; ivar++){ f20 << rms[2][ivar][icen] << " "; } f20 << rms[2][nval][icen] << " "; f20 << ")"<< endl; */ cout << icen*20 << "-" << icen*20+20; for(int ivar=0; ivar<7; ivar++){ cout <<" & " <<var[2][ivar][icen] ; } cout <<" & " <<var[2][nval][icen] ; cout <<"\\\\"<<endl; for(int ivar=0; ivar<7; ivar++){ if(ivar==0)cout <<" & ("<<rms[2][ivar][icen]; else cout <<" & "<<rms[2][ivar][icen]; } cout <<" & "<<rms[2][nval][icen]; cout << ")\\\\\\hline" << endl; //printf(" & %3.1f & %4.1f & %2.2f & %1.3f & %1.3f & %1.3f & %1.3f \\\\\n", // var[2][0][icen],var[2][1][icen],var[2][2][icen],var[2][3][icen],var[2][4][icen],var[2][5][icen],var[2][6][icen]); //printf(" (& %3.1f & %4.1f & %2.2f & %1.3f & %1.3f & %1.3f & %1.3f) \\\\\\hline\n", // rms[2][0][icen],rms[2][1][icen],rms[2][2][icen],rms[2][3][icen],rms[2][4][icen],rms[2][5][icen],rms[2][6][icen]); } f20.close(); fout->Write(); fout->Close(); return; }
static inline void kcall(forth_context_type *fc) // arg1, arg2, arg3...argN, N, adr -- retval { size_t N; size_t adr; size_t args[KARGS]; size_t ret=0; int i; kall0 f0; kall1 f1; kall2 f2; kall3 f3; kall4 f4; kall5 f5; kall6 f6; kall7 f7; kall8 f8; kall9 f9; kall10 f10; kall11 f11; kall12 f12; kall13 f13; kall14 f14; kall15 f15; kall16 f16; adr=pop(fc); N=pop(fc); for(i=1;i<=N;i++) { args[N-i]=pop(fc); } switch(N) { case 0: f0=(kall0)adr; ret=f0(); break; case 1: f1=(kall1)adr; ret=f1(args[0]); break; case 2: f2=(kall2)adr; ret=f2(args[0],args[1]); break; case 3: f3=(kall3)adr; ret=f3(args[0],args[1],args[2]); break; case 4: f4=(kall4)adr; ret=f4(args[0],args[1],args[2],args[3]); break; case 5: f5=(kall5)adr; ret=f5(args[0],args[1],args[2],args[3],args[4]); break; case 6: f6=(kall6)adr; ret=f6(args[0],args[1],args[2],args[3],args[4],args[5]); break; case 7: f7=(kall7)adr; ret=f7(args[0],args[1],args[2],args[3],args[4],args[5],args[6]); break; case 8: f8=(kall8)adr; ret=f8(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7]); break; case 9: f9=(kall9)adr; ret=f9(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]); break; case 10: f10=(kall10)adr; ret=f10(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9]); break; case 11: f11=(kall11)adr; ret=f11(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10]); break; case 12: f12=(kall12)adr; ret=f12(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10],args[11]); break; case 13: f13=(kall13)adr; ret=f13(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10],args[11],args[12]); break; case 14: f14=(kall14)adr; ret=f14(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10],args[11],args[12],args[13]); break; case 15: f15=(kall15)adr; ret=f15(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10],args[11],args[12],args[13],args[14]); break; case 16: f16=(kall16)adr; ret=f16(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10],args[11],args[12],args[13],args[14],args[15]); break; } push(fc,ret); }
int main(void) { f0(); f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); f10(); f11(); f12(); f13(); f14(); f15(); f16(); f17(); f18(); f19(); f20(); f21(); f22(); f23(); f24(); f25(); f26(); f27(); f28(); f29(); f30(); f31(); f32(); f33(); f34(); f35(); f36(); f37(); f38(); f39(); f40(); f41(); f42(); f43(); f44(); f45(); f46(); f47(); f48(); f49(); f50(); f51(); f52(); f53(); f54(); f55(); f56(); f57(); f58(); f59(); f60(); f61(); f62(); f63(); f64(); f65(); f66(); f67(); f68(); f69(); f70(); f71(); f72(); f73(); f74(); f75(); f76(); f77(); f78(); f79(); f80(); f81(); f82(); f83(); f84(); f85(); f86(); f87(); f88(); f89(); f90(); f91(); f92(); f93(); f94(); f95(); f96(); f97(); f98(); f99(); f100(); f101(); f102(); f103(); f104(); f105(); f106(); f107(); f108(); f109(); f110(); f111(); f112(); f113(); f114(); f115(); f116(); f117(); f118(); f119(); f120(); f121(); f122(); f123(); return 0; }
int f9(){ totalSum += 9; return f10() + 9; }
// CHECK: declare void @f10(i32 inreg, i32 inreg, i32 inreg) void g10(void) { struct s6 x = {41, 42}; f10(x, 43); }
static void avx2_test (void) { int i; for (i = 0; i < N + 16; i++) { asm (""); vf1[i] = 17.0f + i; vd1[i] = 19.0 + i; } for (i = 0; i < N; i++) { asm (""); k[i] = (i * 731) & (N - 1); l[i] = (i * 657) & (N - 1); } f1 (); f2 (); for (i = 0; i < N; i++) if (vf2[i] != ((i * 731) & (N - 1)) + 17 || n[i] != ((i * 731) & (N - 1)) + 17) abort (); f3 (12); f4 (14); for (i = 0; i < N; i++) if (vf2[i] != ((i * 731) & (N - 1)) + 17 + 12 || n[i] != ((i * 731) & (N - 1)) + 17 + 14) abort (); f5 (); f6 (); for (i = 0; i < N; i++) if (vd2[i] != ((i * 731) & (N - 1)) + 19 || n[i] != ((i * 731) & (N - 1)) + 19) abort (); f7 (7); f8 (9); for (i = 0; i < N; i++) if (vd2[i] != ((i * 731) & (N - 1)) + 19 + 7 || n[i] != ((i * 731) & (N - 1)) + 19 + 9) abort (); f9 (); f10 (); for (i = 0; i < N; i++) if (vf2[i] != ((i * 657) & (N - 1)) + 17 || n[i] != ((i * 657) & (N - 1)) + 17) abort (); f11 (2); f12 (4); for (i = 0; i < N; i++) if (vf2[i] != ((i * 657) & (N - 1)) + 17 + 2 || n[i] != ((i * 657) & (N - 1)) + 17 + 4) abort (); f13 (); f14 (); for (i = 0; i < N; i++) if (vd2[i] != ((i * 657) & (N - 1)) + 19 || n[i] != ((i * 657) & (N - 1)) + 19) abort (); f15 (13); f16 (15); for (i = 0; i < N; i++) if (vd2[i] != ((i * 657) & (N - 1)) + 19 + 13 || n[i] != ((i * 657) & (N - 1)) + 19 + 15) abort (); }