int main() { int d6 = 144, d5=166; int flag; GeneralInteger n6 = f6(d6); GeneralInteger n5 = f5(d5); flag = (n6 == n5);//operator == overloadin while(flag) { if(d6 % 1000 == 0) { printf("d5= %d d6=%d\n", d5, d6); n5.print(); n6.print(); } if(flag > 0) { ++d5; n5 = f5(d5); } else { ++d6; n6 = f6(d6); } flag = ( n6 == n5); } n6.print(); return 0; }
int main (void) { struct S1 a1, a3; struct S2 a2, a4; f1 (7, 1L, 2L, 3L, 5L, 7L, 9L, 11L, 13L); if (x != 11L) abort (); f2 (6, 1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0); if (d != 32.0) abort (); f3 (2, 1L, 3L); if (bar_arg != 1L || x != 1L) abort (); f4 (2, 17.0, 19.0); if (bar_arg != 21 || d != 17.0) abort (); a1.i = 131; a1.j = 251; a1.d = 15.0; a1.e = 191.0; a3 = a1; a3.j = 254; a3.e = 178.0; f5 (2, a1, a3, a1); if (s1.i != 131 || s1.j != 254 || s1.d != 15.0 || s1.e != 178.0) abort (); f5 (3, a1, a3, a1); if (s1.i != 131 || s1.j != 251 || s1.d != 15.0 || s1.e != 191.0) abort (); a2.i = 138; a2.d = 16.0; a4.i = 257; a4.d = 176.0; f6 (2, a2, a4, a2); if (s2.i != 257 || s2.d != 176.0) abort (); f6 (3, a2, a4, a2); if (s2.i != 138 || s2.d != 16.0) abort (); f7 (2, a3, a1, a1); if (s1.i != 131 || s1.j != 254 || s1.d != 15.0 || s1.e != 178.0) abort (); if (bar_arg != 131) abort (); f8 (3, a4, a2, a2); if (s2.i != 257 || s2.d != 176.0) abort (); return 0; }
/************************************************************ * Function: * * Parameters: * * Returns: * * Description: * *************************************************************/ double OPT_Function_Routines (int fun_idx,int dim, double *para) { double result; switch (fun_idx) { case F6: result = f6(para); break; case SPHERE: result = sphere(dim,para); break; case ROSENBROCK: result = rosenbrock(dim,para); break; case RASTRIGRIN: result = rastrigrin(dim,para); break; case GRIEWANK: result = griewank(dim,para); break; default: break; } return(result); }
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){ 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; }
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() { while(scanf("%s",mem),mem[0]!='8'){ A = B = 0; ip = 0; while(get_instr(),instr!=8){ switch(instr){ case 0:f0(); break; case 1:f1(); break; case 2:f2(); break; case 3:f3(); break; case 4:f4(); break; case 5:f5(); break; case 6:f6(); break; case 7:f7(); break; } } printf("%s\n",mem); } 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 (); }
void cs() { int ch; int f1(); int f2(); int f3(); int f4(); int f5(); int f6(); int f7(); int f8(); int f9(); swindex2:printf("-------------------\n"); printf("--which function?--\n"); printf("-------------------\nf"); scanf_s("%d", &ch); system("CLS"); printf("-----------------------------------------------\n"); //ch = ch - 48; switch (ch) { case 1:f1(); break; case 2:f2(); break; case 3:f3(); break; case 4:f4(); break; case 5:f5(); break; case 6:f6(); break; case 7:f7(); break; case 8:f8(); break; case 9:f9(); break; default:system("CLS"); printf("error\n"); goto swindex2; } printf("-----------------------------------------------\nf%dÔËÐнáÊø\n1 for again,2 for exit\n", ch); }
int main () { int i; check_vect (); asm (""); for (i = 0; i < 8; i++) { asm (""); b[i] = i - 4; d[i] = i - 4; } f1 (); f2 (); for (i = 0; i < 8; i++) if (a[i] != b[i] / 8 || c[i] != d[i] / 3) abort (); f3 (); f4 (); for (i = 0; i < 8; i+= 2) if (a[i] != b[i] / 8 || a[i + 1] != b[i + 1] / 4 || c[i] != d[i] / 3 || c[i + 1] != d[i + 1] / 5) abort (); f5 (); f6 (); for (i = 0; i < 8; i+= 2) if (a[i] != b[i] / 14 || a[i + 1] != b[i + 1] / 15 || c[i] != d[i] / (i == 6 ? 13 : 6) || c[i + 1] != d[i + 1] / 5) abort (); return 0; }
int main(int argc, char** argv) { MyTemplated<std::string>* mt = new MyTemplated<std::string>(); std::string s = "blah"; mt->doIt(s); std::vector<Wrapper> list; Wrapper w; int* numPtr = &w.num.num; list.push_back(w); *numPtr = 5; std::cout << "stack1: " << w.num.num << std::endl; std::cout << "stack2: " << list[0].num.num << std::endl; Wrapper& wrap = list[0]; int& numRef = wrap.num.num; numRef = 8; std::cout << "stack3: " << w.num.num << std::endl; std::cout << "stack4: " << list[0].num.num << std::endl; list[0].num.num = 9; std::cout << "stack5: " << w.num.num << std::endl; std::cout << "stack6: " << list[0].num.num << std::endl; MyFunc f1 = &addA<7>; call(f1); addA<1>(2, 3); Addict t; addB<Addict>(t, 2); boost::function2<void, int, int> f2 = boost::bind(g, 1, _1, _2); f2(2, 3); boost::function3<void, X*, int, int> f3 = &X::foo; X x; boost::bind(f3, &x, 1, 2)(); f3(&x, 5, 6); boost::function2<void, X*, int> f4 = &X::foo1; f4(&x, 8); std::vector<boost::any> l1; l1.push_back(f4); boost::function2<void, X*, int> f5 = boost::any_cast<boost::function2<void, X*, int> >(l1[0]); f5(&x, 15); //std::cout << "list: " << f5(&x, 15) << std::endl; x.fooTemp<Addict>("blah"); boost::function2<void, X*, std::string> f6 = &X::fooTemp<Addict>; f6(&x, "hello"); l1.push_back(f6); boost::function2<void, X*, std::string> f6c = boost::any_cast<boost::function2<void, X*, std::string> >(l1[1]); f6c(&x, "hello again"); }
int main() { f1(x); f2(x); f3(x); f4(x); f5(x); f6(x); }
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 bar () { f3 (foo); f4 (foo); f5 (foo); f6 (foo); N::f7 (foo); f8 (foo); }
void test() { f0(0); // expected-warning{{'f0' is deprecated: first deprecated in iOS 2.1}} f1(0); f2(0); // expected-warning{{'f2' is deprecated: first deprecated in iOS 3.0}} f3(0); f4(0); // expected-error{{f4' is unavailable: obsoleted in iOS 3.0}} f5(0); // expected-warning{{'f5' is deprecated: first deprecated in iOS 3.0}} f6(0); // expected-warning{{'f6' is deprecated: first deprecated in iOS 3.0}} }
void g() { f1({1, 2, 3}); f2({1, 2, 3}); f3({1, 2, 3}); f4({1, 2, 3}); f5({1, 2, 3}); f6({1, 2, 3}); }
void test() { f0(0); f1(0); f2(0); // expected-warning{{'f2' is deprecated: first deprecated in OS X 10.5}} f3(0); f4(0); // expected-error{{f4' is unavailable: obsoleted in OS X 10.5}} f5(0); // expected-error{{'f5' is unavailable: not available on OS X}} f6(0); // expected-error{{'f6' is not introduced yet: introduced in OS X 10.6}} }
int main (void) { S ss = {{'a','b','c'}, 2}; if (f1 (&ss) != 0 || f2 () != 1 || f3 (&ss) != 0 || f4 () != 1 || f5 (&ss) != 0 || f6 () != 0 || f7 (&ss) != 0 || f8 () != 0) __builtin_abort (); 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); } }
void show_count( unsigned num ) { float wait; fputs( "\r\t\t\t\t\t\t\twait ", stdout ); printf( "%4.1f seconds \r ", (float)(num * 15.0) ); num *= 5; num %= 20; ++num; while( num-- ) { printf( "\r ^^^^ \r" ); for( wait = SIZE; wait > 0.0; wait = wait - 10 ) { f0(); f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); f0(); f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); f0(); f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); continue; } printf( "\r vvvv \r" ); } }
void do_test () { f1 (6, 0, 1, 2, 3, 4, 5, a); f2 (6, 0, 1, 2, 3, 4, 5, a, 7, 8); f3 (6, 0, 1, 2, 3, 4, 5, b, 7, 8); f4 (6, 0, 1, 2, 3, 4, 5, c, 7, 8); f5 (5, a); f6 (5, a, 7, 8); f7 (5, b, 7, 8); f8 (5, c, 7, 8); }
int assertTernary() { TF1 f6( "f6", "(x*[0])*((x<[1])?([2]*x):([3]+x))", 1, 10 ); f6.SetParameters( 1, 4, 2, 4 ); long eval = (long) f6.Eval(2); double x=2; long calc = x*1*((x<4)?(2*x):(4+x)); int result = 0; if (calc != eval) { fprintf(stderr,"TFormula does not properly evaluate ternary operator got %ld rather than %ld\n",eval,calc); ++result; } TF1 f1( "f1", "[0]*x", 1, 100 ); TF1 f2( "f2", "[0]+x" ,1, 100 ); TF1 f3( "f3", "(x<[0])?(f1):(f2)", 1, 100 ); double par_a = 1; TF1 f4a( "f4a", "[0]", 1, 100); double par_b = 0; TF1 f4b( "f4b", "x**[0]", 1, 100 ); TF1 f5a( "f5a", "(f3)*(f4a)", 1, 100 ); TF1 f5b( "f5b", "(f3)*(f4b)", 1, 100 ); f1.SetParameter( 0, 2 ); f2.SetParameter( 0, 40 ); f3.SetParameters( 40, 2, 40 ); f4a.SetParameter( 0, par_a ); f5a.SetParameters( 40, 2, 40, par_a ); f4b.SetParameter( 0, par_b ); f5b.SetParameters( 40, 2, 40, par_b ); const int Nx = 2; double xs[ Nx ] = { 39, 41 }; for( int ix=0; ix<Nx; ++ix ) { double x = xs[ ix ]; cout<< x << "\ta: " << f1.Eval(x) <<", "<<f2.Eval(x)<<", "<<f3.Eval(x)<<",\t"<<f4a.Eval(x)<<" -> "<<f3.Eval(x)*f4a.Eval(x)<<" =? "<<f5a.Eval(x)<<endl; long eval1 = f3.Eval(x)*f4a.Eval(x); long eval2 = f5a.Eval(x); if (eval1 != eval2) { fprintf(stderr,"TFormula does not properly evaluate ternary operator for f3.Eval(x)*f4a.Eval(x) got %ld and for f5a.Eval(x) got %ld\n",eval1,eval2); ++result; } cout<<"\tb:\t\t\t"<<f4b.Eval(x)<<" -> "<<f3.Eval(x)*f4b.Eval(x)<<" =? "<<f5b.Eval(x)<<endl; eval1 = f3.Eval(x)*f4b.Eval(x); eval2 = f5b.Eval(x); if (eval1 != eval2) { fprintf(stderr,"TFormula does not properly evaluate ternary operator for f3.Eval(x)*f4b.Eval(x) got %ld and for f5b.Eval(x) got %ld\n",eval1,eval2); ++result; } } return result; }
void testBug (void) { ASSERT (f0(&gl) == &good); ASSERT (f1(&gl) == &good); ASSERT (f2(&gl) == &good); ASSERT (f3(&gl) == &good); ASSERT (f4(&bl) == &bad); ASSERT (f5(&bl) == &bad); ASSERT (f6(&bl) == &bad); ASSERT (f7(&bl) == &bad); }
main () { long a = 0x89ABCDEF; if (f1(a)!=0x89000000L|| f2(a)!=0x00ABCDEFL|| f3(a)!=0x000000EFL|| f4(a)!=0x89ABCD00L|| f5(a)!=0x0000CDEFL|| f6(a)!=0x89AB0000L) abort(); exit(0); }
int main() { f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); return 0; }
int main(void) { f0(); f1(); f2(); f3(); f4(); f5(); f6(); f7(); return 0; }
int main(void) { f4(); f5(); f6(); // CHECK: call x86_fastcallcc void @f4() // CHECK: call x86_stdcallcc void @f5() // CHECK: call x86_thiscallcc void @f6() pf1(); pf2(); pf3(); pf4(); pf5(); pf6(); // CHECK: call x86_fastcallcc void %{{.*}}() // CHECK: call x86_stdcallcc void %{{.*}}() // CHECK: call x86_thiscallcc void %{{.*}}() // CHECK: call x86_fastcallcc void %{{.*}}() // CHECK: call x86_stdcallcc void %{{.*}}() // CHECK: call x86_thiscallcc void %{{.*}}() 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) { S ss = {{'a','b','c'}, 2}; char *s = "abcd"; if (f1 (&ss) != 0 || f2 (s) != 0) __builtin_abort (); if (f3 (&ss) <= 0 || f4 (s) <= 0) __builtin_abort (); if (f5 (&ss) != 0 || f6 (s) != 0) __builtin_abort (); return 0; }
int main(int argc, char **argv) { ATerm bos; long bp; ACCFunctor f3, f4, f5, f6, f7, f8, f9, f10; an2_at_init(argc,argv,&bos); CPL_init_malloc_protect(malloc); CPL_init_malloc(malloc); CPL_init_realloc_protect(realloc); CPL_init_realloc(realloc); choice_init(&bp); ACC_init_throws(); ACC_init_jitter(); p("hoi"); //f3 = ACC_jit_otherwise(f1,f2); //f3 = ACC_jit_and_exceptionally(f1,f2); //f4 = ACC_jit_exceptionally(f3,copy); //f3 = ACC_jit_exceptionally(do_raise, do_copy); //f3 = ACC_jit_exceptionally(f1, f2); //f4 = ACC_jit_otherwise(do_fail,do_copy); f3 = ACC_jit_and_exceptionally(do_raise, f1); f4 = ACC_jit_exceptionally(f3, do_copy); p("hoi"); /* Output should be: [3{[type,int]},1{[type,bool]}]{[type,tuple]} */ ATprintf("f4: %t\n", f4(an2_make_empty(), an2_make_empty())); f5 = ACC_jit_hence(do_copy, print); f6 = ACC_jit_exceptionally(f5, do_copy); ATprintf("f6: %t\n", f6(an2_make_int(5), an2_make_empty())); f7 = ACC_jit_and(do_copy, do_copy); ATprintf("f7: %t\n", f7(an2_make_int(5), an2_make_empty())); { ATerm t = an2_make_int(1209); f8 = ACC_jit_provide(t); ATprintf("f8: %t\n", f8(an2_make_int(5), an2_make_empty())); } return 0; }