Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Martin Perdacher
hilbertJoin
Commits
3b7367be
Commit
3b7367be
authored
May 18, 2019
by
Martin Perdacher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
dbfee073
Pipeline
#546
failed with stage
in 2 minutes and 32 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
745 deletions
+0
-745
hilbertjoin/hilloop.cpp
hilbertjoin/hilloop.cpp
+0
-132
hilbertjoin/hilloop.h
hilbertjoin/hilloop.h
+0
-613
No files found.
hilbertjoin/hilloop.cpp
View file @
3b7367be
...
...
@@ -29,138 +29,6 @@ const long long HILLOOP_programList[][4] = {
{
0x6bebb696b699e96LL
,
0x9ebee969e966b69LL
,
0xe9699ebe9ebb6beLL
,
0xb6966beb6bee9ebLL
}
// i x j = 4 x 4 ; [24]
};
const
unsigned
long
long
HILLOOP_mortonListI
[]
=
{
0ull
,
// 0 x 0: 0
0ull
,
// 0 x 1: 1
0ull
,
// 0 x 2: 2
0ull
,
// 0 x 3: 3
0ull
,
// 0 x 4: 4
0ull
,
// 1 x 0: 5
05ull
,
// 1 x 1: 6
055ull
,
// 1 x 2: 7
0555ull
,
// 1 x 3: 8
05555ull
,
// 1 x 4: 9
0ull
,
// 2 x 0: 10
056ull
,
// 2 x 1: 11
05565ull
,
// 2 x 2: 12
0564565ull
,
// 2 x 3: 13
055654565ull
,
// 2 x 4: 14
0ull
,
// 3 x 0: 15
0566ull
,
// 3 x 1: 16
0556565ull
,
// 3 x 2: 17
0555664565ull
,
// 3 x 3: 18
0556565356565ull
,
// 3 x 4: 19
0ull
,
// 4 x 0: 20
05666ull
,
// 4 x 1: 21
055656565ull
,
// 4 x 2: 22
0564565664565ull
,
// 4 x 3: 23
05565456565654565ull
// 4 x 4: 24
};
const
unsigned
long
long
HILLOOP_mortonListJ
[]
=
{
0ull
,
// 0 x 0: 0
0ull
,
// 0 x 1: 1
0ull
,
// 0 x 2: 2
0ull
,
// 0 x 3: 3
0ull
,
// 0 x 4: 4
0ull
,
// 1 x 0: 5
05ull
,
// 1 x 1: 6
056ull
,
// 1 x 2: 7
0566ull
,
// 1 x 3: 8
05666ull
,
// 1 x 4: 9
0ull
,
// 2 x 0: 10
055ull
,
// 2 x 1: 11
05646ull
,
// 2 x 2: 12
0556646ull
,
// 2 x 3: 13
056466646ull
,
// 2 x 4: 14
0ull
,
// 3 x 0: 15
0555ull
,
// 3 x 1: 16
0564646ull
,
// 3 x 2: 17
0566356646ull
,
// 3 x 3: 18
0564646664646ull
,
// 3 x 4: 19
0ull
,
// 3 x 0: 20
05555ull
,
// 4 x 1: 21
056464646ull
,
// 4 x 2: 22
0556646356646ull
,
// 4 x 3: 23
05646664626466646ull
// 4 x 4: 24
};
const
unsigned
long
long
HILLOOP_asuzListI
[][
4
]
=
{
{
0ull
,
0ull
,
0ull
,
0ull
},
// 0 x 0: 0
{
0ull
,
0ull
,
0ull
,
0ull
},
// 0 x 1: 1
{
0ull
,
0ull
,
0ull
,
0ull
},
// 0 x 2: 2
{
0ull
,
0ull
,
0ull
,
0ull
},
// 0 x 3: 3
{
0ull
,
0ull
,
0ull
,
0ull
},
// 0 x 4: 4
{
0ull
,
0ull
,
0ull
,
0ull
},
// 1 x 0: 5
{
05ull
,
05ull
,
05ull
,
05ull
},
// 1 x 1: 6
{
055ull
,
055ull
,
055ull
,
055ull
},
// 1 x 2: 7
{
0555ull
,
0555ull
,
0555ull
,
0555ull
},
// 1 x 3: 8
{
05555ull
,
05555ull
,
05555ull
,
05555ull
},
// 1 x 4: 9
{
0ull
,
0ull
,
0ull
,
0ull
},
// 2 x 0: 10
{
056ull
,
056ull
,
056ull
,
056ull
},
// 2 x 1: 11
{
05654ull
,
05545ull
,
05456ull
,
05565ull
},
// 2 x 2: 12
{
0564654ull
,
0555455ull
,
0546456ull
,
0555655ull
},
// 2 x 3: 13
{
056545654ull
,
055456545ull
,
054565456ull
,
055654565ull
},
// 2 x 4: 14
{
0ull
,
0ull
,
0ull
,
0ull
},
// 3 x 0: 15
{
0566ull
,
0566ull
,
0566ull
,
0566ull
},
// 3 x 1: 16
{
0566544ull
,
0554545ull
,
0544566ull
,
0556565ull
},
// 3 x 2: 17
{
0556565544ull
,
0555455455ull
,
0554545566ull
,
0555655655ull
},
// 3 x 3: 18
{
0566544566544ull
,
0544566554545ull
,
0544566544566ull
,
0566544556565ull
},
// 3 x 4: 19
{
0ull
,
0ull
,
0ull
,
0ull
},
// 4 x 0: 20
{
05666ull
,
05666ull
,
05666ull
,
05666ull
},
// 4 x 1: 21
{
056665444ull
,
055454545ull
,
054445666ull
,
055656565ull
},
// 4 x 2: 22
{
0556565655444ull
,
0555455455455ull
,
0554545455666ull
,
0555655655655ull
},
// 4 x 3: 23
{
05565665456544545ull
,
05456554545455654ull
,
05545445654566565ull
,
05654556565655456ull
}
// 4 x 4: 24
};
const
unsigned
long
long
HILLOOP_asuzListJ
[][
4
]
=
{
{
0ull
,
0ull
,
0ull
,
0ull
},
// 0 x 0: 0
{
0ull
,
0ull
,
0ull
,
0ull
},
// 0 x 1: 1
{
0ull
,
0ull
,
0ull
,
0ull
},
// 0 x 2: 2
{
0ull
,
0ull
,
0ull
,
0ull
},
// 0 x 3: 3
{
0ull
,
0ull
,
0ull
,
0ull
},
// 0 x 4: 4
{
0ull
,
0ull
,
0ull
,
0ull
},
// 1 x 0: 5
{
05ull
,
05ull
,
05ull
,
05ull
},
// 1 x 1: 6
{
056ull
,
056ull
,
056ull
,
056ull
},
// 1 x 2: 7
{
0566ull
,
0566ull
,
0566ull
,
0566ull
},
// 1 x 3: 8
{
05666ull
,
05666ull
,
05666ull
,
05666ull
},
// 1 x 4: 9
{
0ull
,
0ull
,
0ull
,
0ull
},
// 2 x 0: 10
{
055ull
,
055ull
,
055ull
,
055ull
},
// 2 x 1: 11
{
05565ull
,
05646ull
,
05565ull
,
05646ull
},
// 2 x 2: 12
{
0556565ull
,
0566366ull
,
0556565ull
,
0566366ull
},
// 2 x 3: 13
{
055656565ull
,
056466646ull
,
055656565ull
,
056466646ull
},
// 2 x 4: 14
{
0ull
,
0ull
,
0ull
,
0ull
},
// 3 x 0: 15
{
0555ull
,
0555ull
,
0555ull
,
0555ull
},
// 3 x 1: 16
{
0555655ull
,
0564646ull
,
0555655ull
,
0564646ull
},
// 3 x 2: 17
{
0564646655ull
,
0566366366ull
,
0564646655ull
,
0566366366ull
},
// 3 x 3: 18
{
0555655655655ull
,
0555655664646ull
,
0555655655655ull
,
0555655664646ull
},
// 3 x 4: 19
{
0ull
,
0ull
,
0ull
,
0ull
},
// 4 x 0: 20
{
05555ull
,
05555ull
,
05555ull
,
05555ull
},
// 4 x 1: 21
{
055556555ull
,
056464646ull
,
055556555ull
,
056464646ull
},
// 4 x 2: 22
{
0564646466555ull
,
0566366366366ull
,
0564646466555ull
,
0566366366366ull
},
// 4 x 3: 23
{
05646456565654646ull
,
05565664626466565ull
,
05646456565654646ull
,
05565664626466565ull
}
// 4 x 4: 24
};
// Action Table
// State Action Follow i j d0 XOR a1 d1 XOR a0 d1 AND a0
// 00 00 01 +1 +1 0 0
// 00 01 00 0 +1 0 1
// 00 10 00 0 0 1 0
// 00 11 11 +1 0 1 1
// 01 00 00 +1 +1 1 0
// 01 01 01 +1 0 1 1
// 01 10 01 0 0 0 0
// 01 11 10 0 +1 0 1
// 10 00 11 0 0 0 1
// 10 01 10 +1 0 0 0
// 10 10 10 +1 +1 1 1
// 10 11 01 0 +1 1 0
// 11 00 10 0 0 1 1
// 11 01 11 0 +1 1 0
// 11 10 11 +1 +1 0 1
// 11 11 00 +1 0 0 0
const
unsigned
long
long
HILLOOP_nanoprog
[
9
][
9
][
4
][
2
]
=
{
{
{
{
0x0ull
,
0x1ull
},
{
0x0ull
,
0x1ull
},
{
0x0ull
,
0x1ull
},
{
0x0ull
,
0x1ull
}
},
// 0 x 0
...
...
hilbertjoin/hilloop.h
View file @
3b7367be
...
...
@@ -4,559 +4,6 @@
extern
const
long
long
HILLOOP_programList
[][
4
];
#define HILLOOP_START(i, j, imin, imax, jmin, jmax)\
if
((
imin
)
<
(
imax
)
&&
(
jmin
)
<
(
jmax
))
{
\
int
HILLOOP_imin
=
(
imin
)
;
\
int
HILLOOP_imax
=
(
imax
)
;
\
int
HILLOOP_jmin
=
(
jmin
)
;
\
int
HILLOOP_jmax
=
(
jmax
)
;
\
(
i
)
=
HILLOOP_imin
;
\
(
j
)
=
HILLOOP_jmin
;
\
int
HILLOOP_c
;
\
unsigned
long
long
HILLOOP_hilbert
=
0
;
\
register
union
{
\
double
HILLOOP_hflo
;
\
unsigned
long
long
HILLOOP_hint
;
\
};
\
unsigned
long
long
HILLOOP_twopot
,
HILLOOP_tt
;
\
int
HILLOOP_in
,
HILLOOP_ix
,
HILLOOP_jn
,
HILLOOP_jx
,
HILLOOP_creset
;
\
long
long
HILLOOP_program
;
\
if
(
HILLOOP_imax
-
HILLOOP_imin
<
HILLOOP_jmax
-
HILLOOP_jmin
)
{
\
if
(
HILLOOP_imax
-
HILLOOP_imin
==
1
)
{
\
HILLOOP_tt
=
2
;
\
HILLOOP_twopot
=
1
;
\
HILLOOP_creset
=
HILLOOP_c
=
2
;
\
}
else
{
\
HILLOOP_hflo
=
HILLOOP_imax
-
HILLOOP_imin
;
\
HILLOOP_hint
=
(
HILLOOP_hint
>>
52
)
-
1023
;
\
HILLOOP_tt
=
1
<<
HILLOOP_hint
;
\
HILLOOP_twopot
=
HILLOOP_tt
/
2
;
\
HILLOOP_creset
=
HILLOOP_c
=
3
-
(
HILLOOP_hint
&
1
);
\
}
\
HILLOOP_jn
=
HILLOOP_tt
+
(
HILLOOP_jmax
-
HILLOOP_jmin
)
%
HILLOOP_tt
<
HILLOOP_jmax
-
HILLOOP_jmin
?
HILLOOP_tt
+
(
HILLOOP_jmax
-
HILLOOP_jmin
)
%
HILLOOP_tt
:
HILLOOP_jmax
-
HILLOOP_jmin
;
\
HILLOOP_ix
=
HILLOOP_imax
;
\
HILLOOP_in
=
HILLOOP_ix
-
HILLOOP_imin
;
\
HILLOOP_jx
=
HILLOOP_jn
+
HILLOOP_jmin
;
\
}
else
{
\
if
(
HILLOOP_jmax
-
HILLOOP_jmin
==
1
)
{
\
HILLOOP_tt
=
2
;
\
HILLOOP_twopot
=
1
;
\
HILLOOP_creset
=
HILLOOP_c
=
3
;
\
}
else
{
\
HILLOOP_hflo
=
HILLOOP_jmax
-
HILLOOP_jmin
;
\
HILLOOP_hint
=
(
HILLOOP_hint
>>
52
)
-
1023
;
\
HILLOOP_tt
=
1
<<
HILLOOP_hint
;
\
HILLOOP_twopot
=
HILLOOP_tt
/
2
;
\
HILLOOP_creset
=
HILLOOP_c
=
2
+
(
HILLOOP_hint
&
1
);
\
}
\
HILLOOP_in
=
HILLOOP_tt
+
(
HILLOOP_imax
-
HILLOOP_imin
)
%
HILLOOP_tt
<
HILLOOP_imax
-
HILLOOP_imin
?
HILLOOP_tt
+
(
HILLOOP_imax
-
HILLOOP_imin
)
%
HILLOOP_tt
:
HILLOOP_imax
-
HILLOOP_imin
;
\
HILLOOP_jx
=
HILLOOP_jmax
;
\
HILLOOP_jn
=
HILLOOP_jx
-
HILLOOP_jmin
;
\
HILLOOP_ix
=
HILLOOP_in
+
HILLOOP_imin
;
\
}
\
HILLOOP_program
=
HILLOOP_programList
[((
HILLOOP_in
+
HILLOOP_twopot
-
1
)
/
HILLOOP_twopot
)
*
5
+
((
HILLOOP_jn
+
HILLOOP_twopot
-
1
)
/
HILLOOP_twopot
)][
HILLOOP_c
];
\
while
(
1
)
{
#define HILLOOP_END(i,j)\
if
(
HILLOOP_program
)
{
\
(
i
)
+=
(
HILLOOP_program
&
3
)
-
2
;
\
HILLOOP_program
>>=
2
;
\
(
j
)
+=
(
HILLOOP_program
&
3
)
-
2
;
\
HILLOOP_program
>>=
2
;
\
}
else
{
\
HILLOOP_hilbert
++
;
\
HILLOOP_hflo
=
HILLOOP_hilbert
&
-
HILLOOP_hilbert
;
\
int
HILLOOP_test
=
(
HILLOOP_hint
-
4607182418800017408LL
)
>>
53
;
\
int
HILLOOP_action
=
(
HILLOOP_hilbert
>>
(
2
*
HILLOOP_test
))
&
3
;
\
HILLOOP_test
&=
1
;
\
HILLOOP_c
^=
3
*
(
HILLOOP_test
!=
(
HILLOOP_action
==
3
));
\
(
j
)
+=
(
HILLOOP_c
-
1
)
%
2
;
\
(
i
)
-=
(
2
-
HILLOOP_c
)
%
2
;
\
HILLOOP_c
^=
(
HILLOOP_test
!=
(
HILLOOP_action
==
1
));
\
if
((
i
)
==
HILLOOP_ix
)
{
\
if
((
i
)
>=
HILLOOP_imax
)
\
break
;
\
HILLOOP_in
=
HILLOOP_tt
;
\
HILLOOP_ix
+=
HILLOOP_tt
;
\
HILLOOP_hilbert
=
0
;
\
HILLOOP_c
=
HILLOOP_creset
;
\
}
\
if
((
j
)
==
HILLOOP_jx
)
{
\
if
((
j
)
>=
HILLOOP_jmax
)
\
break
;
\
HILLOOP_jn
=
HILLOOP_tt
;
\
HILLOOP_jx
+=
HILLOOP_tt
;
\
HILLOOP_hilbert
=
0
;
\
HILLOOP_c
=
HILLOOP_creset
;
\
}
\
HILLOOP_program
=
HILLOOP_programList
[
5
*
((((((
i
)
-
HILLOOP_imin
)
*
HILLOOP_twopot
/
HILLOOP_in
)
+
1
)
*
HILLOOP_in
+
HILLOOP_twopot
-
1
)
/
HILLOOP_twopot
-
((((
i
)
-
HILLOOP_imin
)
*
HILLOOP_twopot
/
HILLOOP_in
)
*
HILLOOP_in
+
HILLOOP_twopot
-
1
)
/
HILLOOP_twopot
)
\
+
((((((
j
)
-
HILLOOP_jmin
)
*
HILLOOP_twopot
/
HILLOOP_jn
)
+
1
)
*
HILLOOP_jn
+
HILLOOP_twopot
-
1
)
/
HILLOOP_twopot
-
((((
j
)
-
HILLOOP_jmin
)
*
HILLOOP_twopot
/
HILLOOP_jn
)
*
HILLOOP_jn
+
HILLOOP_twopot
-
1
)
/
HILLOOP_twopot
)][
HILLOOP_c
];
\
}
\
}
\
}
#define CANOLOOP_START(i, j, imin, imax, jmin, jmax) {\
for
((
i
)
=
(
imin
)
;
(
i
)
<
(
imax
)
;
(
i
)
++
)
\
for
((
j
)
=
(
jmin
)
;
(
j
)
<
(
jmax
)
;
(
j
)
++
)
{
#define CANOLOOP_END(i,j) } }
#define CANO2LOOP_START(i, j, imin, imax, jmin, jmax) {\
for
((
j
)
=
(
jmin
)
;
(
j
)
<
(
jmax
)
;
(
j
)
++
)
\
for
((
i
)
=
(
imin
)
;
(
i
)
<
(
imax
)
;
(
i
)
++
){
#define CANO2LOOP_END(i,j) } }
#define CCILOOP_START(i,j,imin,imax,jmin,jmax,istep) {\
for
(
int
HILLOOP_I
=
(
imin
)
;
HILLOOP_I
<
(
imax
)
;
HILLOOP_I
+=
(
istep
))
\
for
((
j
)
=
(
jmin
)
;
(
j
)
<
(
jmax
)
;
(
j
)
++
)
\
for
((
i
)
=
HILLOOP_I
;
(
i
)
<
HILLOOP_I
+
(
istep
)
&&
(
i
)
<
(
imax
)
;
(
i
)
++
)
{
#define CCILOOP_END(i,j) } }
#define CCJLOOP_START(i,j,imin,imax,jmin,jmax,jstep) {\
for
(
int
HILLOOP_J
=
(
jmin
)
;
HILLOOP_J
<
(
jmax
)
;
HILLOOP_J
+=
(
jstep
))
\
for
((
i
)
=
(
imin
)
;
(
i
)
<
(
imax
)
;
(
i
)
++
)
\
for
((
j
)
=
HILLOOP_J
;
(
j
)
<
HILLOOP_J
+
(
jstep
)
&&
(
j
)
<
(
jmax
)
;
(
j
)
++
)
{
#define CCJLOOP_END(i,j) } }
#define CCIJLOOP_START(i,j,imin,imax,jmin,jmax,istep,jstep) {\
for
(
int
HILLOOP_I
=
(
imin
)
;
HILLOOP_I
<
(
imax
)
;
HILLOOP_I
+=
(
istep
))
\
for
(
int
HILLOOP_J
=
(
jmin
)
;
HILLOOP_J
<
(
jmax
)
;
HILLOOP_J
+=
(
jstep
))
\
for
((
i
)
=
HILLOOP_I
;
(
i
)
<
HILLOOP_I
+
(
istep
)
&&
(
i
)
<
(
imax
)
;
(
i
)
++
)
\
for
((
j
)
=
HILLOOP_J
;
(
j
)
<
HILLOOP_J
+
(
jstep
)
&&
(
j
)
<
(
jmax
)
;
(
j
)
++
)
{
#define CCIJLOOP_END(i,j) } }
extern
const
unsigned
long
long
HILLOOP_mortonListI
[];
extern
const
unsigned
long
long
HILLOOP_mortonListJ
[];
#define ZORDLOOP_START(i, j, imin, imax, jmin, jmax) {\
int
HILLOOP_imin
=
(
imin
)
;
\
int
HILLOOP_jmin
=
(
jmin
)
;
\
int
HILLOOP_idiff
=
(
imax
)
-
HILLOOP_imin
;
\
int
HILLOOP_jdiff
=
(
jmax
)
-
HILLOOP_jmin
;
\
if
(
HILLOOP_idiff
>
0
&&
HILLOOP_jdiff
>
0
)
{
\
union
{
\
double
HILLOOP_ddd
;
\
long
long
HILLOOP_lll
;
\
};
\
HILLOOP_ddd
=
HILLOOP_idiff
<
HILLOOP_jdiff
?
HILLOOP_idiff
:
HILLOOP_jdiff
;
\
unsigned
long
long
HILLOOP_t
=
(
HILLOOP_lll
>>
52
)
-
1023
;
\
if
(
HILLOOP_t
)
HILLOOP_t
--
;
\
unsigned
long
long
HILLOOP_tt
=
1
<<
HILLOOP_t
;
\
unsigned
long
long
HILLOOP_tti
=
(
HILLOOP_idiff
/
HILLOOP_tt
/
2
)
*
HILLOOP_tt
;
\
unsigned
long
long
HILLOOP_ttj
=
(
HILLOOP_jdiff
/
HILLOOP_tt
/
2
)
*
HILLOOP_tt
;
\
HILLOOP_tti
=
HILLOOP_tti
<
1
?
1
:
HILLOOP_tti
;
\
HILLOOP_ttj
=
HILLOOP_ttj
<
1
?
1
:
HILLOOP_ttj
;
\
unsigned
long
long
HILLOOP_I
=
0
;
\
unsigned
long
long
HILLOOP_J
=
0
;
\
for
(
int
HILLOOP_outer
=
0
;
HILLOOP_outer
<
(
HILLOOP_tti
>
HILLOOP_ttj
?
HILLOOP_tti
:
HILLOOP_ttj
)
;
HILLOOP_outer
+=
HILLOOP_tt
)
{
\
if
(
HILLOOP_idiff
<
HILLOOP_jdiff
)
{
\
HILLOOP_I
=
0
;
\
HILLOOP_J
=
HILLOOP_outer
;
\
}
else
{
\
HILLOOP_J
=
0
;
\
HILLOOP_I
=
HILLOOP_outer
;
\
}
\
unsigned
long
long
HILLOOP_Z
=
0
;
\
while
(
HILLOOP_Z
<
HILLOOP_tt
*
HILLOOP_tt
)
{
\
(
i
)
=
HILLOOP_I
*
HILLOOP_idiff
/
HILLOOP_tti
;
\
(
j
)
=
HILLOOP_J
*
HILLOOP_jdiff
/
HILLOOP_ttj
;
\
int
HILLOOP_Idiff
=
(
HILLOOP_I
+
1
)
*
HILLOOP_idiff
/
HILLOOP_tti
-
(
i
);
\
int
HILLOOP_Jdiff
=
(
HILLOOP_J
+
1
)
*
HILLOOP_jdiff
/
HILLOOP_ttj
-
(
j
);
\
(
i
)
+=
HILLOOP_imin
;
\
(
j
)
+=
HILLOOP_jmin
;
\
unsigned
long
long
HILLOOP_programI
=
HILLOOP_mortonListI
[
5
*
HILLOOP_Idiff
+
HILLOOP_Jdiff
];
\
unsigned
long
long
HILLOOP_programJ
=
HILLOOP_mortonListJ
[
5
*
HILLOOP_Idiff
+
HILLOOP_Jdiff
];
\
do
{
#define ZORDLOOP_END(i,j)\
(
i
)
=
(
i
)
+
(
HILLOOP_programI
&
7
)
-
5
;
\
(
j
)
=
(
j
)
+
(
HILLOOP_programJ
&
7
)
-
5
;
\
HILLOOP_programI
>>=
3
;
\
HILLOOP_programJ
>>=
3
;
\
}
while
(
HILLOOP_programI
);
\
HILLOOP_Z
++
;
\
HILLOOP_ddd
=
HILLOOP_Z
&
-
HILLOOP_Z
;
\
int
HILLOOP_action
=
(
HILLOOP_lll
>>
52
)
-
1023
;
\
if
(
HILLOOP_action
&
1
)
{
\
HILLOOP_J
&=
(
-
1
<<
((
HILLOOP_action
+
1
)
/
2
));
\
HILLOOP_I
++
;
\
}
else
{
\
HILLOOP_I
&=
(
-
1
<<
(
HILLOOP_action
/
2
));
\
HILLOOP_J
++
;
\
}
\
}
\
}
\
}
\
}
extern
const
unsigned
long
long
HILLOOP_asuzListI
[][
4
];
extern
const
unsigned
long
long
HILLOOP_asuzListJ
[][
4
];
#define ASUZLOOP_START(i, j, imin, imax, jmin, jmax) {\
int
HILLOOP_imin
=
(
imin
)
;
\
int
HILLOOP_jmin
=
(
jmin
)
;
\
int
HILLOOP_idiff
=
(
imax
)
-
HILLOOP_imin
;
\
int
HILLOOP_jdiff
=
(
jmax
)
-
HILLOOP_jmin
;
\
if
(
HILLOOP_idiff
>
0
&&
HILLOOP_jdiff
>
0
)
{
\
union
{
\
double
HILLOOP_ddd
;
\
long
long
HILLOOP_lll
;
\
};
\
HILLOOP_ddd
=
HILLOOP_idiff
<
HILLOOP_jdiff
?
HILLOOP_idiff
:
HILLOOP_jdiff
;
\
unsigned
long
long
HILLOOP_t
=
(
HILLOOP_lll
>>
52
)
-
1023
;
\
if
(
HILLOOP_t
)
HILLOOP_t
--
;
\
int
HILLOOP_creset
=
2
+
((
HILLOOP_t
&
1
)
==
(
HILLOOP_idiff
<
HILLOOP_jdiff
));
\
unsigned
long
long
HILLOOP_tt
=
1
<<
HILLOOP_t
;
\
unsigned
long
long
HILLOOP_tti
=
(
HILLOOP_idiff
/
HILLOOP_tt
/
2
)
*
HILLOOP_tt
;
\
unsigned
long
long
HILLOOP_ttj
=
(
HILLOOP_jdiff
/
HILLOOP_tt
/
2
)
*
HILLOOP_tt
;
\
HILLOOP_tti
=
HILLOOP_tti
<
1
?
1
:
HILLOOP_tti
;
\
HILLOOP_ttj
=
HILLOOP_ttj
<
1
?
1
:
HILLOOP_ttj
;
\
unsigned
long
long
HILLOOP_I
=
0
;
\
unsigned
long
long
HILLOOP_J
=
0
;
\
(
i
)
=
HILLOOP_imin
;
\
for
(
int
HILLOOP_outer
=
0
;
HILLOOP_outer
<
(
HILLOOP_tti
>
HILLOOP_ttj
?
HILLOOP_tti
:
HILLOOP_ttj
)
;
HILLOOP_outer
+=
HILLOOP_tt
)
{
\
if
(
HILLOOP_idiff
<
HILLOOP_jdiff
)
{
\
HILLOOP_I
=
0
;
\
HILLOOP_J
=
HILLOOP_outer
;
\
}
else
{
\
HILLOOP_J
=
0
;
\
HILLOOP_I
=
HILLOOP_outer
;
\
}
\
int
HILLOOP_c
=
HILLOOP_creset
;
\
unsigned
long
long
HILLOOP_Z
=
0
;
\
while
(
HILLOOP_Z
<
HILLOOP_tt
*
HILLOOP_tt
)
{
\
int
HILLOOP_Idiff
=
(
HILLOOP_I
+
1
)
*
HILLOOP_idiff
/
HILLOOP_tti
-
HILLOOP_I
*
HILLOOP_idiff
/
HILLOOP_tti
;
\
int
HILLOOP_Jdiff
=
(
HILLOOP_J
+
1
)
*
HILLOOP_jdiff
/
HILLOOP_ttj
-
HILLOOP_J
*
HILLOOP_jdiff
/
HILLOOP_ttj
;
\
(
j
)
=
HILLOOP_J
*
HILLOOP_jdiff
/
HILLOOP_ttj
+
HILLOOP_jmin
;
\
unsigned
long
long
HILLOOP_programI
=
HILLOOP_asuzListI
[
5
*
HILLOOP_Idiff
+
HILLOOP_Jdiff
][
HILLOOP_c
];
\
unsigned
long
long
HILLOOP_programJ
=
HILLOOP_asuzListJ
[
5
*
HILLOOP_Idiff
+
HILLOOP_Jdiff
][
HILLOOP_c
];
\
do
{
#define ASUZLOOP_END(i,j)\
(
i
)
=
(
i
)
+
(
HILLOOP_programI
&
7
)
-
5
;
\
(
j
)
=
(
j
)
+
(
HILLOOP_programJ
&
7
)
-
5
;
\
HILLOOP_programI
>>=
3
;
\
HILLOOP_programJ
>>=
3
;
\
}
while
(
HILLOOP_programI
);
\
HILLOOP_Z
++
;
\
HILLOOP_ddd
=
HILLOOP_Z
&
-
HILLOOP_Z
;
\
int
HILLOOP_test
=
(
HILLOOP_lll
-
4607182418800017408LL
)
>>
53
;
\
int
HILLOOP_action
=
(
HILLOOP_Z
>>
(
2
*
HILLOOP_test
))
&
3
;
\
HILLOOP_c
^=
3
*
((
HILLOOP_test
&
1
)
!=
(
HILLOOP_action
==
3
));
\
if
(
HILLOOP_action
==
2
)
{
if
(
HILLOOP_c
&
1
)
HILLOOP_J
&=
-
2
<<
HILLOOP_test
;
else
HILLOOP_J
++
;}
\
else
{
if
(
HILLOOP_c
&
1
)
HILLOOP_J
&=
-
1
<<
HILLOOP_test
;
else
HILLOOP_J
++
;}
\
HILLOOP_I
-=
(
2
-
HILLOOP_c
)
%
2
;
\
(
i
)
-=
(
2
-
HILLOOP_c
)
%
2
;
\
HILLOOP_c
^=
((
HILLOOP_test
&
1
)
!=
(
HILLOOP_action
==
1
));
\
}
\
}
\
}
\
}
// Action Table
// State Action Follow i j d0 XOR a1 d1 XOR a0 d1 AND a0
// 00 00 01 +1 +1 0 0
// 00 01 00 0 +1 0 1
// 00 10 00 0 0 1 0
// 00 11 11 +1 0 1 1
// 01 00 00 +1 +1 1 0
// 01 01 01 +1 0 1 1
// 01 10 01 0 0 0 0
// 01 11 10 0 +1 0 1
// 10 00 11 0 0 0 1
// 10 01 10 +1 0 0 0
// 10 10 10 +1 +1 1 1
// 10 11 01 0 +1 1 0
// 11 00 10 0 0 1 1
// 11 01 11 0 +1 1 0
// 11 10 11 +1 +1 0 1
// 11 11 00 +1 0 0 0
#define BIGHLOOP_START(i, j, imin, imax, jmin, jmax) {\
register
union
{
\
double
HILLOOP_hflo
;
\
unsigned
long
long
HILLOOP_hint
;
\
};
\
HILLOOP_hflo
=
((
imax
)
-
(
imin
)
>
(
jmax
)
-
(
jmin
)
?
(
imax
)
-
(
imin
)
:
(
jmax
)
-
(
jmin
))
-
1
;
\
HILLOOP_hint
=
((
HILLOOP_hint
>>
52
)
-
1022
)
*
2
;
\
unsigned
long
long
HILLOOP_hmax
=
1
<<
HILLOOP_hint
;
\
for
(
unsigned
long
long
HILLOOP_hilbert
=
0
;
HILLOOP_hilbert
<
HILLOOP_hmax
;
HILLOOP_hilbert
++
)
{
\
(
i
)
=
0
;
\
(
j
)
=
0
;
\
int
HILLOOP_d
=
3
;
\
for
(
int
HILLOOP_kk
=
HILLOOP_hint
-
2
;
HILLOOP_kk
>=
0
;
HILLOOP_kk
-=
2
)
{
\
int
HILLOOP_action
=
(
HILLOOP_hilbert
>>
HILLOOP_kk
)
&
3
;
\
(
i
)
=
2
*
(
i
)
+
(((
HILLOOP_d
|
~
HILLOOP_action
)
&
1
)
^
((
HILLOOP_d
^
HILLOOP_action
)
>>
1
))
;
\
(
j
)
=
2
*
(
j
)
+
((
1
&
~
(
HILLOOP_d
&
HILLOOP_action
))
^
((
HILLOOP_d
^
HILLOOP_action
)
>>
1
))
;
\
HILLOOP_d
^=
(
HILLOOP_action
==
0
);
\
HILLOOP_d
^=
3
*
(
HILLOOP_action
==
3
)
;
\
}
\
(
i
)
+=
(
imin
)
;
\
(
j
)
+=
(
jmin
)
;
\
if
((
i
)
<
(
imax
)
&&
(
j
)
<
(
jmax
))
{
\
#define BIGHLOOP_END(i,j)\
}
\
}
\
}
\
//int HILLOOP_peano_i[][9] = {{0,1,2,2,1,0,0,1,2},{0,1,2,2,1,0,0,1,2},{2,1,0,0,1,2,2,1,0},{2,1,0,0,1,2,2,1,0}} ;
//int HILLOOP_peano_j[][9] = {{0,0,0,1,1,1,2,2,2},{2,2,2,1,1,1,0,0,0},{0,0,0,1,1,1,2,2,2},{2,2,2,1,1,1,0,0,0}} ;
//int HILLOOP_peano_d[][9] = {{0,1,0,2,3,2,0,1,0},{1,0,1,3,2,3,1,0,1},{2,3,2,0,1,0,2,3,2},{3,2,3,1,0,1,3,2,3}} ;
//
//#define PEANOLOOP_START(i, j, imin, imax, jmin, jmax) {\
// unsigned long long HILLOOP_pow = 1;\
// while (HILLOOP_pow<imax-imin || HILLOOP_pow<jmax-jmin) HILLOOP_pow *= 3;\
// HILLOOP_pow *= HILLOOP_pow;\
// for (unsigned long long HILLOOP_hilbert=0 ; HILLOOP_hilbert<HILLOOP_pow ; HILLOOP_hilbert++) {\
// (i) = 0;\
// (j) = 0;\
// int HILLOOP_d = 0 ;\
// for (int HILLOOP_kk = HILLOOP_pow/9 ; HILLOOP_kk ; HILLOOP_kk/=9){\
// int HILLOOP_a = (HILLOOP_hilbert/HILLOOP_kk) % 9 ;\
// (i) = 3 * (i) + HILLOOP_peano_i[HILLOOP_d][HILLOOP_a] ;\
// (j) = 3 * (j) + HILLOOP_peano_j[HILLOOP_d][HILLOOP_a] ;\
// HILLOOP_d = HILLOOP_peano_d[HILLOOP_d][HILLOOP_a] ;\
// }\
// (i) += (imin) ;\
// (j) += (jmin) ;\
// if ((i)<(imax) && (j)<(jmax)) {\
//
//# define PEANOLOOP_END(i,j)\
// }\
// }\
//}\
#define PEANOLOOP_START(i, j, imin, imax, jmin, jmax) {\
unsigned
long
long
HILLOOP_pow
=
1
;
\
while
(
HILLOOP_pow
<
imax
-
imin
||
HILLOOP_pow
<
jmax
-
jmin
)
HILLOOP_pow
*=
3
;
\
HILLOOP_pow
*=
HILLOOP_pow
;
\
(
i
)
=
(
imin
);
\
(
j
)
=
(
jmin
);
\
int
HILLOOP_lr
=
1
;
int
HILLOOP_ud
=
1
;
\
for
(
unsigned
long
long
HILLOOP_hilbert
=
1
;
HILLOOP_hilbert
<=
HILLOOP_pow
;
HILLOOP_hilbert
++
)
{
\
if
((
i
)
<
(
imax
)
&&
(
j
)
<
(
jmax
))
{
#define PEANOLOOP_END(i,j)\
}
\
int
HILLOOP_a
=
HILLOOP_hilbert
;
\
while
(
HILLOOP_a
%
9
==
0
)
{
\
HILLOOP_a
/=
9
;
\
}
\
if
(
HILLOOP_a
%
3
){
\
(
j
)
+=
HILLOOP_lr
;
\
HILLOOP_ud
=
(
-
HILLOOP_ud
);
\
}
else
{
\
(
i
)
+=
HILLOOP_ud
;
\
HILLOOP_lr
=
(
-
HILLOOP_lr
);
\
}
\
}
\
}
#define BIGZLOOP_START(i,j,imin,imax,jmin,jmax) {\
register
union
{
\
double
HILLOOP_hflo
;
\
unsigned
long
long
HILLOOP_hint
;
\
};
\
HILLOOP_hflo
=
((
imax
)
-
(
imin
)
>
(
jmax
)
-
(
jmin
)
?
(
imax
)
-
(
imin
)
:
(
jmax
)
-
(
jmin
))
-
1
;
\
HILLOOP_hint
=
((
HILLOOP_hint
>>
52
)
-
1022
)
*
2
;
\
unsigned
long
long
HILLOOP_hmax
=
1
<<
HILLOOP_hint
;
\
for
(
unsigned
long
long
HILLOOP_hilbert
=
0
;
HILLOOP_hilbert
<
HILLOOP_hmax
;
HILLOOP_hilbert
++
)
{
\
(
i
)
=
0
;
\
(
j
)
=
0
;
\
for
(
int
HILLOOP_kk
=
HILLOOP_hint
-
1
;
HILLOOP_kk
>=
0
;
HILLOOP_kk
--
)
{
\
(
i
)
=
2
*
(
i
)
+
((
HILLOOP_hilbert
>>
HILLOOP_kk
)
&
1
)
;
\
HILLOOP_kk
--
;
\
(
j
)
=
2
*
(
j
)
+
((
HILLOOP_hilbert
>>
HILLOOP_kk
)
&
1
)
;
\
}
\
(
i
)
+=
(
imin
)
;
\
(
j
)
+=
(
jmin
)
;
\
if
((
i
)
<
(
imax
)
&&
(
j
)
<
(
jmax
))
{
\
#define BIGZLOOP_END(i,j)\
}
\
}
\
}
\
extern
const
unsigned
long
long
HILLOOP_nanoprog
[
9
][
9
][
4
][
2
];
extern
const
unsigned
long
long
HILLOOP_fgfnano
[
4
][
2
];
#define FUR_HILBERT_START(i,j,imin,imax,jmin,jmax) {\
int
HILLOOP_imin
=
(
imin
);
\
int
HILLOOP_imax
=
(
imax
);
\
int
HILLOOP_jmin
=
(
jmin
);
\
int
HILLOOP_jmax
=
(
jmax
);
\
(
i
)
=
HILLOOP_imin
;
\
(
j
)
=
HILLOOP_jmin
;
\
int
HILLOOP_idiff
=
HILLOOP_imax
-
HILLOOP_imin
;
\
int
HILLOOP_jdiff
=
HILLOOP_jmax
-
HILLOOP_jmin
;
\
if
(
HILLOOP_idiff
>
0
&&
HILLOOP_jdiff
>
0
)
{
\
int
HILLOOP_iceil
=
HILLOOP_idiff
-
1
;
\
HILLOOP_iceil
|=
HILLOOP_iceil
>>
1
;
\
HILLOOP_iceil
|=
HILLOOP_iceil
>>
2
;
\
HILLOOP_iceil
|=
HILLOOP_iceil
>>
4
;
\
HILLOOP_iceil
|=
HILLOOP_iceil
>>
8
;
\
HILLOOP_iceil
|=
HILLOOP_iceil
>>
16
;
\
HILLOOP_iceil
++
;
\
if
(
HILLOOP_iceil
<
8
)
\
HILLOOP_iceil
=
8
;
\
int
HILLOOP_jceil
=
HILLOOP_jdiff
-
1
;
\
HILLOOP_jceil
|=
HILLOOP_jceil
>>
1
;
\
HILLOOP_jceil
|=
HILLOOP_jceil
>>
2
;
\
HILLOOP_jceil
|=
HILLOOP_jceil
>>
4
;
\
HILLOOP_jceil
|=
HILLOOP_jceil
>>
8
;
\
HILLOOP_jceil
|=
HILLOOP_jceil
>>
16
;
\
HILLOOP_jceil
++
;
\
if
(
HILLOOP_jceil
<
8
)
\
HILLOOP_jceil
=
8
;
\
while
((
i
)
<
HILLOOP_imax
&&
(
j
)
<
HILLOOP_jmax
)
{
\
int
HILLOOP_icur
,
HILLOOP_jcur
,
HILLOOP_c
,
HILLOOP_base
,
HILLOOP_icase
,
HILLOOP_jcase
;
\
unsigned
long
long
HILLOOP_stop
,
HILLOOP_hilbert
=
0ull
;
\
if
(
HILLOOP_idiff
>
HILLOOP_jdiff
)
{
\
HILLOOP_jcur
=
HILLOOP_jdiff
;
\
HILLOOP_icur
=
HILLOOP_imax
-
(
i
);
\
HILLOOP_base
=
HILLOOP_jceil
/
8
;
\
HILLOOP_stop
=
(
unsigned
long
long
)
HILLOOP_base
*
(
unsigned
long
long
)
HILLOOP_base
;
\
if
(
HILLOOP_icur
>=
2
*
HILLOOP_jceil
)
{
\
HILLOOP_icur
=
HILLOOP_jceil
;
\
HILLOOP_c
=
3
;
\
HILLOOP_icase
=
0
;
\
HILLOOP_jcase
=
HILLOOP_jcur
&
1
;
\
}
else
if
(
HILLOOP_icur
>
HILLOOP_jceil
)
{
\
HILLOOP_icur
=
(
HILLOOP_icur
+
3
)
/
4
*
2
;
\
HILLOOP_c
=
3
;
\
HILLOOP_icase
=
0
;
\
HILLOOP_jcase
=
HILLOOP_jcur
&
1
;
\
}
else
{
\
HILLOOP_jcase
=
HILLOOP_jcur
&
1
;
\
HILLOOP_icase
=
HILLOOP_icur
&
1
;
\
HILLOOP_c
=
3
-
(
HILLOOP_icase
&
~
HILLOOP_jcase
);
\
HILLOOP_icase
+=
HILLOOP_icase
&
HILLOOP_jcase
;
\
}
\
}
else
{
\
HILLOOP_icur
=
HILLOOP_idiff
;
\
HILLOOP_jcur
=
HILLOOP_jmax
-
(
j
);
\
HILLOOP_base
=
HILLOOP_iceil
/
8
;
\
HILLOOP_stop
=
(
unsigned
long
long
)
HILLOOP_base
*
(
unsigned
long
long
)
HILLOOP_base
;
\
if
(
HILLOOP_jcur
>=
2
*
HILLOOP_iceil
)
{
\
HILLOOP_jcur
=
HILLOOP_iceil
;
\
HILLOOP_c
=
2
;
\
HILLOOP_jcase
=
0
;
\
HILLOOP_icase
=
HILLOOP_icur
&
1
;
\