Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Karsa Zoltán István
/
politopok
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e070e5ea
authored
Feb 04, 2023
by
Zoltan Karsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
to file 2
parent
40ef6193
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
9 deletions
+36
-9
tetrarun.py
+1
-1
utils.py
+35
-8
No files found.
tetrarun.py
View file @
e070e5ea
...
...
@@ -2,7 +2,7 @@ import sys, getopt
from
genax
import
gen_angels_to_pick
,
angles_alap
,
angles_ratet
from
gpu
import
start_kernel
from
utils
import
convert
,
printresults
,
search
,
exact_one
,
exact_one_gpu
,
filter_gpu
,
writetofile
from
utils
import
convert
,
printresults
,
search
,
exact_one
,
exact_one_gpu
,
filter_gpu
,
writetofile
,
writetofile2
def
main
(
argv
):
outputfile
=
None
...
...
utils.py
View file @
e070e5ea
...
...
@@ -71,18 +71,45 @@ def writetofile(filename, Cx, Cy, Dx, Dy, Dz, egyensulyi_mtx):
size_C
=
Cx
.
size
size_D
=
Dx
.
size
for
i
in
range
(
0
,
pos
):
parok
=
np
.
empty
([
0
],
dtype
=
np
.
int8
)
for
S
in
range
(
0
,
4
):
for
U
in
range
(
0
,
4
):
if
mtx_cpu
[
i
][
S
][
U
]
==
1
:
parok
=
np
.
append
(
parok
,
S
+
1
)
parok
=
np
.
append
(
parok
,
U
+
1
)
N
=
parok
.
size
#
parok = np.empty([0], dtype=np.int8)
#
for S in range(0, 4):
#
for U in range(0, 4):
#
if mtx_cpu[i][S][U] == 1:
#
parok = np.append(parok, S+1)
#
parok = np.append(parok, U+1)
#
N = parok.size
f
.
write
(
f
"{Cx_cpu[i
%
size_C]}, {Cy_cpu[i
%
size_C]}, {Dx_cpu[(i + int(i / lcm))
%
size_D]}, {Dy_cpu[(i + int(i / lcm))
%
size_D]}, {Dz_cpu[(i + int(i / lcm))
%
size_D]}
\n
"
)
f
.
write
(
np
.
array2string
(
np
.
resize
(
parok
,
(
int
(
N
/
2
),
2
))))
#f.write(np.array2string(np.resize(parok, (int(N/2), 2))))
f
.
write
(
np
.
array2string
(
mtx_cpu
[
i
]))
f
.
write
(
"
\n
"
)
f
.
close
()
def
writetofile2
(
filename
,
Cx
,
Cy
,
Dx
,
Dy
,
Dz
,
egyensulyi_mtx
):
lcm
=
compute_lcm
(
Cx
.
size
,
Dx
.
size
)
Cx_cpu
=
Cx
.
get
()
Cy_cpu
=
Cy
.
get
()
Dx_cpu
=
Dx
.
get
()
Dy_cpu
=
Dy
.
get
()
Dz_cpu
=
Dz
.
get
()
mtx_cpu
=
egyensulyi_mtx
.
get
()
pos
=
Cx
.
size
*
Dx
.
size
f
=
open
(
filename
,
"w"
)
size_C
=
Cx
.
size
size_D
=
Dx
.
size
for
i
in
range
(
0
,
pos
):
s
=
0
for
S
in
range
(
0
,
4
):
for
U
in
range
(
0
,
4
):
s
*=
2
s
+=
mtx_cpu
[
i
][
S
][
U
]
f
.
write
(
f
"{i
%
size_C}, {i
%
size_C}, {(i + int(i / lcm))
%
size_D}, {(i + int(i / lcm))
%
size_D}, {(i + int(i / lcm))
%
size_D}, {s}
\n
"
)
f
.
close
()
def
search
(
egyensulyi_mtx
,
S
,
U
):
for
i
in
egyensulyi_mtx
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment