MCPcopy Create free account
hub / github.com/MeigenChou/DCTimer-Android / init

Method init

app/src/main/java/cs/min2phase/Tools.java:22–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20 protected Tools() {}
21
22 public static void init() {
23 if (Search.inited) {
24 return;
25 }
26 try {
27 InputStream in = new BufferedInputStream(new FileInputStream(APP.dataPath + "twophase.dat"));
28 read(CubieCube.FlipS2R, in);
29 read(CubieCube.TwistS2R, in);
30 read(CubieCube.EPermS2R, in);
31 read(CubieCube.MtoEPerm, in);
32 in.read(CubieCube.Perm2Comb);
33 //in.readFully(CubieCube.Perm2Comb);
34 read(CoordCube.TwistMove, in);
35 read(CoordCube.FlipMove, in);
36 read(CoordCube.UDSliceMove, in);
37 read(CoordCube.UDSliceConj, in);
38 read(CoordCube.CPermMove, in);
39 read(CoordCube.EPermMove, in);
40 read(CoordCube.MPermMove, in);
41 read(CoordCube.MPermConj, in);
42 read(CoordCube.CCombMove, in);
43 read(CoordCube.CCombConj, in);
44 read(CoordCube.MCPermPrun, in);
45 read(CoordCube.MEPermPrun, in);
46 read(CoordCube.EPermCCombPrun, in);
47 if (Search.USE_FULL_PRUN) {
48 read(CubieCube.UDSliceFlipS2R, in);
49 read(CubieCube.TwistS2RF, in);
50 read(CoordCube.TwistConj, in);
51 read(CubieCube.FlipSlice2UDSliceFlip, in);
52 read(CoordCube.UDSliceFlipTwistPrun, in);
53 } else {
54 read(CoordCube.UDSliceTwistPrun, in);
55 read(CoordCube.UDSliceFlipPrun, in);
56 if (Search.USE_TWIST_FLIP_PRUN) {
57 read(CubieCube.FlipS2RF, in);
58 read(CoordCube.TwistFlipPrun, in);
59 }
60 }
61 in.close();
62 //CubieCube.initMove();
63 CubieCube.initSym();
64 } catch (Exception e) {
65 Search.init();
66 try {
67 OutputStream out = new BufferedOutputStream(new FileOutputStream(APP.dataPath + "twophase.dat"));
68 write(CubieCube.FlipS2R, out); // 672
69 write(CubieCube.TwistS2R, out); // + 648
70 write(CubieCube.EPermS2R, out); // + 5,536
71 write(CubieCube.MtoEPerm, out); // + 80,640
72 out.write(CubieCube.Perm2Comb); // + 2,768
73 write(CoordCube.TwistMove, out); // + 11,664
74 write(CoordCube.FlipMove, out); // + 12,096
75 write(CoordCube.UDSliceMove, out); // + 17,820
76 write(CoordCube.UDSliceConj, out); // + 7,920
77 write(CoordCube.CPermMove, out); // + 99,648
78 write(CoordCube.EPermMove, out); // + 55,360
79 write(CoordCube.MPermMove, out); // + 480

Callers 1

solutionMethod · 0.95

Calls 5

initSymMethod · 0.95
initMethod · 0.95
readMethod · 0.80
writeMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected