예제 #1
0
TEST(TestTimer, Construct) {
    Timer timer;
    timer.Start("a");
    EXPECT_ANY_THROW(timer.End("b"));
    timer.End("a");
    timer.Display();
}
예제 #2
0
void App_Run()
{
	while (!g_quit)
	{
		App_ProcessEvents();
		App_UpdateTimer();
		App_UpdateFPS();

		Timer updateTimer;
		App_Update();
		updateTimer.End();

		Timer renderTimer;
		App_Draw();
		renderTimer.End();

		if (!(g_frameIndex & 15))
		{
			g_updateTime = updateTimer.ToSeconds();
			g_renderTime = renderTimer.ToSeconds();
		}

		if (g_enableOnScreenDebugInfo)
			App_DrawDebugInfo();

		App_EndDrawFrame();

		g_frameIndex++;
	}

	Postprocessing::EnableBloom(false);
	Postprocessing::EnableOldTV(false);
	Postprocessing::EnableRainyGlass(false);
	Postprocessing_ShutdownQuake();
}
예제 #3
0
TEST(Time, MatrixAccess) {
  int n(1000);
  MatrixXcd a(n, n);
  dcomplex *b = new dcomplex[n*n];
  
  
  Timer timer;

  timer.Start("Eigen");
  for(int i = 0; i < n; i++)
    for(int j = 0; j < n; j++)
      a(i, j) = 1.2;
  for(int i = 0; i < n; i++)
    for(int j = 0; j < n; j++)
      a(i, j);
  timer.End("Eigen");

  timer.Start("Array");
  for(int i = 0; i < n; i++)
    for(int j = 0; j < n; j++)
      b[i+n*j] = 1.2;
  dcomplex cumsum(0);
  for(int i = 0; i < n; i++)
    for(int j = 0; j < n; j++)
      cumsum += b[i+n*j];
  timer.End("Array");

  timer.Start("Array2");
  for(int i = 0; i < n; i++)
    for(int j = 0; j < n; j++)
      b[j+n*i] = 1.2;
  cumsum = 0;
  for(int i = 0; i < n; i++)
    for(int j = 0; j < n; j++)
      cumsum += b[j+n*i];
  timer.End("Array2");
  timer.Display();

  Timer timer1;
  MatrixXcd xyz(3, 2);
  timer1.Start("MatrixXyz");
  for(int i = 0; i < n; i++)
    for(int j = 0; j < n; j++) {
      xyz(0, 0) = 1.0;
      xyz(0, 1) = 1.2;
    }
  for(int i = 0; i < n; i++)
    for(int j = 0; j < n; j++) {
      dcomplex x= xyz(0, 0);
      x =  xyz(0, 1);
    }
  timer1.End("MatrixXyz");

  dcomplex xs[2];
  timer1.Start("ArrayXyz");
  for(int i = 0; i < n; i++)
    for(int j = 0; j < n; j++) {
      xs[0]= 1.0*i*j;
      xs[1] = 1.2*i*j;
    }
  for(int i = 0; i < n; i++)
    for(int j = 0; j < n; j++) {
      dcomplex x= xs[0];
      x =  xs[1];
    }
  timer1.End("ArrayXyz");

  vector<dcomplex> cs(2);
  timer1.Start("VectorXyz");
  for(int i = 0; i < n; i++)
    for(int j = 0; j < n; j++) {
      cs[0]= 1.0*i*j;
      cs[1] = 1.2*i*j;
    }
  for(int i = 0; i < n; i++)
    for(int j = 0; j < n; j++) {
      dcomplex x= cs[0];
      x =  cs[1];
    }
  timer1.End("VectorXyz");  
  
  timer1.Display();

}
예제 #4
0
TEST(SymGTOs, method_time) {

  Timer timer;
  pSymmetryGroup sym = SymmetryGroup::D2h();

  SymGTOs gtos(new _SymGTOs);
  gtos->SetSym(sym);

  Vector3cd xyz0(0.0, 0.0, 0.0);

  // ---- s orbital ----
  SubSymGTOs sub_s;
  sub_s.AddXyz(Vector3cd(0, 0, 0));
  sub_s.AddNs( Vector3i( 0, 0, 0));

  int num_z(10);
  VectorXcd zs(num_z); zs << 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0;

  sub_s.AddZeta(zs);
  sub_s.AddRds(Reduction(sym->irrep_s, MatrixXcd::Ones(1, 1)));
  gtos->AddSub(sub_s);

  // ---- p orbital ----
  SubSymGTOs sub_p;
  sub_p.AddXyz(Vector3cd(0, 0, 0));
  sub_p.AddNs( Vector3i( 1, 0, 0));
  sub_p.AddNs( Vector3i( 0, 1, 0));
  sub_p.AddNs( Vector3i( 0, 0, 1));
  int num_z_p(8);
  VectorXcd zs_p(num_z_p); zs_p << 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8;
  sub_p.AddZeta(zs_p);
  MatrixXcd c1(1, 3); c1 << 1.0, 0.0, 0.0; sub_p.AddRds(Reduction(sym->irrep_x, c1));
  MatrixXcd c2(1, 3); c2 << 0.0, 1.0, 0.0; sub_p.AddRds(Reduction(sym->irrep_y, c2));
  MatrixXcd c3(1, 3); c3 << 0.0, 0.0, 1.0; sub_p.AddRds(Reduction(sym->irrep_z, c3));
  gtos->AddSub(sub_p);

  // -- potential --
  MatrixXcd xyzq(4, 1); xyzq << 0.0, 0.0, 0.0, 1.0;
  gtos->SetAtoms(xyzq);
  gtos->SetUp();

  BMatSet mat = CalcMat_Complex(gtos, true);

  ERIMethod m00; 
  ERIMethod m01; m01.symmetry = 1;
  ERIMethod m10; m10.coef_R_memo = 1;
  ERIMethod m11; m11.coef_R_memo = 1; m11.symmetry = 1;
  B2EInt eri00, eri01, eri10, eri11;

  timer.Start("method00"); eri00 = CalcERI_Complex(gtos, m00); timer.End("method00");
  timer.Start("method01"); eri01 = CalcERI_Complex(gtos, m01); timer.End("method01");
  timer.Start("method10"); eri10 = CalcERI_Complex(gtos, m10); timer.End("method10");
  timer.Start("method11"); eri11 = CalcERI_Complex(gtos, m11); timer.End("method11");
    
  EXPECT_C_EQ(eri00->At(0, 0, 0, 0, 2, 1, 5, 0),
	      eri01->At(0, 0, 0, 0, 2, 1, 5, 0));
  EXPECT_C_EQ(eri00->At(0, 0, 0, 0, 2, 1, 5, 0),
	      eri11->At(0, 0, 0, 0, 2, 1, 5, 0));
  EXPECT_C_EQ(eri00->At(0, 0, 0, 0, 2, 1, 5, 0),
	      eri10->At(0, 0, 0, 0, 2, 1, 5, 0));

  timer.Display();
  cout << "size(eri00): " << eri00->size() << endl;
  cout << "size(eri10): " << eri10->size() << endl;
  cout << "size(eri01): " << eri01->size() << endl;
  cout << "size(eri11): " << eri11->size() << endl;

}