All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
isCheckPerf.cc
Go to the documentation of this file.
1 
8 #include "osl/record/csaString.h"
9 #include "osl/misc/perfmon.h"
10 #include <iostream>
11 #include <cstdio>
12 using namespace osl;
13 
14 int main(int argc,char **argv)
15 {
16  // extern char *optarg;
17 
18  char c;
19  while ((c = getopt(argc, argv, "vh")) != EOF)
20  {
21  switch(c)
22  {
23  default:
24  std::cerr << "unknown option\n";
25  return 1;
26  }
27  }
28 
29  NumEffectState state((CsaString(
30  "P1-KY * * * -KY * -FU-KE * \n"
31  "P2 * * * * -OU * * * * \n"
32  "P3 * * * -FU-FU+RY * * -KY\n"
33  "P4-FU * * -GI * * * * * \n"
34  "P5 * * * * * * * * * \n"
35  "P6+FU * * +RY * * +FU * * \n"
36  "P7 * +FU * +FU+FU+FU * * * \n"
37  "P8 * * +OU * -TO * * * * \n"
38  "P9+KY * * * * * * +KE * \n"
39  "P+00KI00GI00GI00GI00KE00KE00FU00FU00FU00KI\n"
40  "P-00KA00KA00KI00FU00FU00FU00FU00KI\n"
41  "-\n").getInitialState()));
42 
43  MoveVector moves;
44  GenerateAllMoves::generate(state.turn(),state,moves);
45 
46  int count = 0;
47  misc::PerfMon clock;
48  for (size_t i=0; i<moves.size(); ++i)
49  {
51  (state, moves[i].ptype(), moves[i].from(), moves[i].to()))
52  ++count;
53  }
54  clock.stop("total", moves.size());
55  std::cerr << "checks " << count << " / " << moves.size() << "\n";
56 }
57 // ;;; Local Variables:
58 // ;;; mode:c++
59 // ;;; c-basic-offset:2
60 // ;;; End: