这篇教程C++ t5函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中t5函数的典型用法代码示例。如果您正苦于以下问题:C++ t5函数的具体用法?C++ t5怎么用?C++ t5使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了t5函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: t1void tst_QSizeF::scale() { QSizeF t1(10.4, 12.8); t1.scale(60.6, 60.6, Qt::IgnoreAspectRatio); QCOMPARE(t1, QSizeF(60.6, 60.6)); QSizeF t2(10.4, 12.8); t2.scale(43.52, 43.52, Qt::KeepAspectRatio); QCOMPARE(t2, QSizeF(35.36, 43.52)); QSizeF t3(9.6, 12.48); t3.scale(31.68, 31.68, Qt::KeepAspectRatioByExpanding); QCOMPARE(t3, QSizeF(31.68, 41.184)); QSizeF t4(12.8, 10.4); t4.scale(43.52, 43.52, Qt::KeepAspectRatio); QCOMPARE(t4, QSizeF(43.52, 35.36)); QSizeF t5(12.48, 9.6); t5.scale(31.68, 31.68, Qt::KeepAspectRatioByExpanding); QCOMPARE(t5, QSizeF(41.184, 31.68)); QSizeF t6(0.0, 0.0); t6.scale(200, 240, Qt::IgnoreAspectRatio); QCOMPARE(t6, QSizeF(200, 240)); QSizeF t7(0.0, 0.0); t7.scale(200, 240, Qt::KeepAspectRatio); QCOMPARE(t7, QSizeF(200, 240)); QSizeF t8(0.0, 0.0); t8.scale(200, 240, Qt::KeepAspectRatioByExpanding); QCOMPARE(t8, QSizeF(200, 240));}
开发者ID:MarianMMX,项目名称:MarianMMX,代码行数:33,
示例2: test_relationalvoidtest_relational(){ cout << "test_relational" << endl; sc_time t1; sc_time t2( 1, SC_FS ); sc_time t3( 1.2345, SC_NS ); sc_time t4( 1.2341, SC_NS ); sc_time t5( -1.5432, SC_NS ); cout << ( t1 == t2 ) << endl; cout << ( t1 != t2 ) << endl; cout << ( t1 < t2 ) << endl; cout << ( t1 <= t2 ) << endl; cout << ( t1 > t2 ) << endl; cout << ( t1 >= t2 ) << endl; cout << ( t3 == t4 ) << endl; cout << ( t3 != t4 ) << endl; cout << ( t3 < t4 ) << endl; cout << ( t3 <= t4 ) << endl; cout << ( t3 > t4 ) << endl; cout << ( t3 >= t4 ) << endl; cout << ( t1 == t5 ) << endl; cout << ( t1 != t5 ) << endl; cout << ( t1 < t5 ) << endl; cout << ( t1 <= t5 ) << endl; cout << ( t1 > t5 ) << endl; cout << ( t1 >= t5 ) << endl;}
开发者ID:een5afr-public,项目名称:gem5,代码行数:32,
示例3: mainint main(int argc, const char *argv[]){ int accu = 0; for (size_t bite = 0; bite < 64; ++bite) { pong p; moost::Thread t1(p); moost::Thread t2(p); moost::Thread t3(p); moost::Thread t4(p); moost::Thread t5(p); moost::Thread t0(&ping); moost::Thread t01(&ping); moost::Thread t02(&ping); moost::Thread t03(&ping); moost::Thread t04(&ping); t0.join(); t01.join(); t02.join(); t03.join(); t04.join(); t1.join(); t2.join(); t3.join(); t4.join(); t5.join(); accu = i; } if (accu == 0) std::cout << "OK" << std::endl; else std::cout << "KO" << std::endl; return (0);}
开发者ID:chipot,项目名称:moost,代码行数:35,
示例4: testmainvoid testmain() { print("struct"); t1(); t2(); t3(); t4(); t5(); t6(); t7(); t8(); t9(); t10(); t11(); t12(); t13(); t14(); unnamed(); assign(); arrow(); incomplete(); bitfield_basic(); bitfield_mix(); bitfield_union(); bitfield_unnamed(); bitfield_initializer(); test_offsetof(); flexible_member(); empty_struct();}
开发者ID:4ker,项目名称:8cc,代码行数:29,
示例5: test_printvoidtest_print(){ cout << "test_print" << endl; sc_time t1; cout << t1 << endl; uint64 v = 1230; sc_time t2( v, false ); cout << t2 << endl; v *= 10000; sc_time t3( v, false ); cout << t3 << endl; v *= 100; sc_time t4( v, false ); cout << t4 << endl; v *= 10000; sc_time t5( v, false ); cout << t5 << endl; v *= 100; sc_time t6( v, false ); cout << t6 << endl; v *= 10000; sc_time t7( v, false ); cout << t7 << endl;}
开发者ID:fluency03,项目名称:SystemC,代码行数:32,
示例6: mainint main(int argc, char* argv[]){ auto master_thread_id = std::this_thread::get_id(); auto lambda_f = [=]() { auto thread_id = std::this_thread::get_id(); if (thread_id == master_thread_id) { std::lock_guard<std::mutex> l(cout_mutex); std::cout << "Master thread. ID=" << thread_id << std::endl; } else { std::lock_guard<std::mutex> l(cout_mutex); std::cout << "Child thread. ID=" << thread_id << std::endl; } }; ScopedThread t1(lambda_f); ScopedThread t2(lambda_f); ScopedThread t3(lambda_f); ScopedThread t4(lambda_f); ScopedThread t5(lambda_f); lambda_f();}
开发者ID:PureAbstract,项目名称:CppSandbox,代码行数:27,
示例7: testSerializevoid testSerialize (){ BTree<int> empty; BTree<int> t90 (90,empty,empty), t12 (12,t90,empty), t30 (30,empty,t12), t50 (50,empty,empty), t5 (5,t50, empty), t7 (7,t30,t5); std::ofstream f ("tree.txt"); f << t7; f.close (); BTree<int> newTree; std::ifstream fin ("tree.txt"); newTree.read (fin); //assert (t7==newTree); std::cout << std::endl << newTree;}
开发者ID:triffon,项目名称:lecture-notes,代码行数:26,
示例8: test_typesvoidtest_types(){ std::cout << "--- types ---/n"; Void_type t1; std::cout << t1 << '/n'; // void Boolean_type t2; std::cout << t2 << '/n'; // bool Integer_type t3; std::cout << t3 << '/n'; // int Float_type t4; std::cout << t4 << '/n'; // double Function_type t5({&t2, &t3}, t2); std::cout << t5 << '/n'; // (bool, int32) -> bool Pointer_type t6(t2); std::cout << t6 << '/n'; // bool*; Reference_type t7(t5); std::cout << t7 << '/n'; // ((bool, int32) -> bool)&; Function_type t8({}, t1); std::cout << t8 << '/n'; // () -> void Sequence_type t9(*new Pointer_type(t8)); std::cout << t9 << '/n'; // (() -> void)*[]}
开发者ID:vinodpagadala,项目名称:banjo,代码行数:31,
示例9: mainint main(){ float* A = (float*) memalign(16, LEN5*sizeof(float)); float* B = (float*) memalign(16, LEN5*sizeof(float)); float* C = (float*) memalign(16, LEN5*sizeof(float)); float* D = (float*) memalign(16, LEN5*sizeof(float)); float* E = (float*) memalign(16, LEN5*sizeof(float)); for (int i = 0; i < LEN5; i++){ A[i] = (float)(i)/(float)LEN5; B[i] = (float)(i+1)/(float)LEN5; C[i] = (float)(i+2)/(float)LEN5; D[i] = (float)(i+3)/(float)LEN5; E[i] = (float)(i+4)/(float)LEN5; } unsigned long long start_c, end_c, diff_c; start_c = _rdtsc(); t5(A,B,C,D,E); end_c=_rdtsc(); diff_c = end_c - start_c; float giga_cycle = diff_c / 1000000000.0; float ttt = (float)0.; #pragma novector for (int i = 0; i < LEN5; i++) ttt += A[i]; printf("t5 took/t %.2f and the result is %f/n", giga_cycle, ttt);}
开发者ID:AdonisSaveYourLife,项目名称:CS398,代码行数:33,
示例10: op_plus_equalstatic const char*op_plus_equal (){ std::cout << __func__ << std::endl; ioa::time t1 (1, 500500); ioa::time t2 (-2, -300300); ioa::time t3 (t1); t3 += t1; mu_assert (t3.sec () == 3); mu_assert (t3.usec () == 1000); ioa::time t4 (t1); t4 += t2; mu_assert (t4.sec () == 0); mu_assert (t4.usec () == -799800); ioa::time t5 (t2); t5 += t1; mu_assert (t5.sec () == 0); mu_assert (t5.usec () == -799800); ioa::time t6 (t2); t6 += t2; mu_assert (t6.sec () == -4); mu_assert (t6.usec () == -600600); return 0;}
开发者ID:jrwilson,项目名称:ioa,代码行数:31,
示例11: testPrintWithStackvoid testPrintWithStack (){ BTree<int> empty; BTree<int> t90 (90,empty,empty), t12 (12,t90,empty), t30 (30,empty,t12), t50 (50,empty,empty), t5 (5,t50, empty), t7 (7,t30,t5); t7.printWithStack(std::cout); std::stringstream str; t7.printWithStack(str); int x, y, z; str >> x >> y >> z; assert (x == 30); assert (y == 90); assert (z == 12); //или assert (str.str() == "30 90 12 7 50 5 ");}
开发者ID:triffon,项目名称:lecture-notes,代码行数:26,
示例12: test11 int test11() { context ctx(MAGIC_VALUE11); { exc_test t1(ctx, MAGIC_VALUE11_2); try { exc_test t2(ctx, MAGIC_VALUE11_2); throw exc_test(ctx, MAGIC_VALUE11); // this magic value is expected to be catched in ff_throw() and captured in context::state } catch (exc_test&) { exc_test t3(ctx, MAGIC_VALUE11_2); try { exc_test t4(ctx, MAGIC_VALUE11_2); ff_throw(ctx); } catch (exc_test&) { exc_test t5(ctx, MAGIC_VALUE11_2); ctx.state = UNEXPECTED_CATCH1; } } } return ctx.balance(); }
开发者ID:133a,项目名称:project_ntke_cpprtl,代码行数:27,
示例13: mainint main(void){ wheel::EventMapping events; wheel::Timer t5("timer", 5000000, true); wheel::Timer t2("timer2", 2000000, true); printf("created timer at %08x, with 5000 C++ tError函数代码示例 C++ t4vf_wr_mbox函数代码示例
|