コード例 #1
0
ファイル: pause_menu.cpp プロジェクト: jopek/zapper
void pause_menu::update()
{
	if (input::pressed(KEY_ACCEPT)) {
		select->play(0,1);
		switch(hot) {
			case PM_RETURN:
				fsm->enemies->unpause();
				fsm->change(GS_TAPPER);
			break;

			case PM_OPTIONS:
				fsm->change(GS_OPTIONS);
			break;

			case PM_QUIT:
				fsm->change(GS_MAIN_MENU);
			break;

			default: break;
		}
		return;
	}

	if (input::pressed(KEY_UP)) {
		set_hot(hot-1);
		move->play(0,1);
		return;
	}

	if (input::pressed(KEY_DOWN)) {
		set_hot(hot+1);
		move->play(0,1);
		return;
	}
}
コード例 #2
0
ファイル: benchmark.cpp プロジェクト: duuucccan23/fermiqcd
void test_staggered() {
  mdp << "START TESTING STAGGERED ACTIONS\n";

  int box[]={64,6,6,6}, nc=3;
  generic_lattice lattice(4,box,default_partitioning<0>,
			  torus_topology, 0, 3);
  gauge_field U(lattice,nc);
  gauge_field V(lattice,nc);
  staggered_field psi(lattice, nc);
  staggered_field chi1(lattice, nc);
  staggered_field chi2(lattice, nc);
  coefficients coeff;
  coeff["mass"]=1.0;
  double t0, t1;
  inversion_stats stats;
  set_hot(U);
  set_random(psi);

  mdp << "ATTENTION: need to adjust asqtad coefficnets\n";

  default_staggered_action=StaggeredAsqtadActionFast::mul_Q;

  default_staggered_inverter=MinimumResidueInverter<staggered_field,gauge_field>;
  t0=mpi.time();
  stats=mul_invQ(chi2,psi,U,coeff);
  t1=(mpi.time()-t0)/lattice.nvol_gl/stats.steps;
  cout << "Staggered Min Res TIME=" << t1 << endl;

  default_staggered_inverter=BiConjugateGradientStabilizedInverter<staggered_field,gauge_field>;
  t0=mpi.time();
  stats=mul_invQ(chi2,psi,U,coeff);
  t1=(mpi.time()-t0)/lattice.nvol_gl/stats.steps;
  cout << "Staggered BiCGStab TIME=" << t1 << endl;

  default_staggered_inverter=StaggeredBiCGUML::inverter;
  t0=mpi.time();
  stats=mul_invQ(chi2,psi,U,coeff);
  t1=(mpi.time()-t0)/lattice.nvol_gl/stats.steps;
  cout << "Staggered SSE BiCGStabUML TIME=" << t1 << endl;

  default_staggered_action=StaggeredAsqtadActionSSE2::mul_Q;

  default_staggered_inverter=MinimumResidueInverter<staggered_field,gauge_field>;
  t0=mpi.time();
  stats=mul_invQ(chi2,psi,U,coeff);
  t1=(mpi.time()-t0)/lattice.nvol_gl/stats.steps;
  cout << "Staggered SSE Min Res TIME=" << t1 << endl;

  default_staggered_inverter=BiConjugateGradientStabilizedInverter<staggered_field,gauge_field>;
  t0=mpi.time();
  stats=mul_invQ(chi2,psi,U,coeff);
  t1=(mpi.time()-t0)/lattice.nvol_gl/stats.steps;
  cout << "Staggered SSE BiCGStab TIME=" << t1 << endl;

  default_staggered_inverter=StaggeredBiCGUML::inverter;
  t0=mpi.time();
  stats=mul_invQ(chi2,psi,U,coeff);
  t1=(mpi.time()-t0)/lattice.nvol_gl/stats.steps;
  cout << "Staggered SSE BiCGStabUML TIME=" << t1 << endl;
}
コード例 #3
0
ファイル: pause_menu.cpp プロジェクト: jopek/zapper
void pause_menu::enter()
{
	set_hot(0);
	input::clear();
	audio::stopSfx();
	fsm->enemies->pause();
}
コード例 #4
0
ファイル: benchmark.cpp プロジェクト: duuucccan23/fermiqcd
void test_clover() {
  mdp << "START TESTING CLOVER ACTIONS\n";

  int box[]={64,6,6,6}, nc=3;
  generic_lattice lattice(4,box);
  gauge_field U(lattice,nc);
  fermi_field psi(lattice, nc);
  fermi_field chi2(lattice, nc);
  coefficients coeff;

  coeff["kappa_s"]=0.1;
  coeff["kappa_t"]=0.1;
  coeff["c_{sw}"]=1.00;

  set_hot(U);
  compute_em_field(U);
  set_random(psi);
  double t0,t1;
  inversion_stats stats;

  default_fermi_action=FermiCloverActionFast::mul_Q;

  default_fermi_inverter=MinimumResidueInverter<fermi_field,gauge_field>;
  t0=mpi.time();
  stats=mul_invQ(chi2,psi,U,coeff);
  t1=(mpi.time()-t0)/lattice.nvol_gl/stats.steps;
  cout << "Clover Min Res TIME=" << t1 << endl;

  default_fermi_inverter=BiConjugateGradientStabilizedInverter<fermi_field,gauge_field>;
  t0=mpi.time();
  stats=mul_invQ(chi2,psi,U,coeff);
  t1=(mpi.time()-t0)/lattice.nvol_gl/stats.steps;
  cout << "Clover BiCGStab TIME=" << t1 << endl;

  default_fermi_action=FermiCloverActionSSE2::mul_Q;

  default_fermi_inverter=MinimumResidueInverter<fermi_field,gauge_field>;
  t0=mpi.time();
  stats=mul_invQ(chi2,psi,U,coeff);
  t1=(mpi.time()-t0)/lattice.nvol_gl/stats.steps;
  cout << "Clover SSE Min Res TIME=" << t1 << endl;

  default_fermi_inverter=BiConjugateGradientStabilizedInverter<fermi_field,gauge_field>;
  t0=mpi.time();
  stats=mul_invQ(chi2,psi,U,coeff);
  t1=(mpi.time()-t0)/lattice.nvol_gl/stats.steps;
  cout << "Clover SSE BiCGStab TIME=" << t1 << endl;

}
コード例 #5
0
ファイル: pause_menu.cpp プロジェクト: jopek/zapper
pause_menu::pause_menu(game * g)
{
	fsm = g;
	background = gfx::loadImage("./data/gfx/paper.png");
	opt = gfx::loadFont("./data/fonts/mono.ttf", 20);
	title = gfx::loadFont("./data/fonts/bit.ttf", 44);
	select = audio::loadSfx("./data/sfx/select.wav");
	move = audio::loadSfx("./data/sfx/move.wav");


	options.push_back("Return to Game");
	options.push_back("Options");
	options.push_back("Quit to Main Menu");
	set_hot(0);

}