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
b6a9ae36
authored
Jan 27, 2023
by
Zoltan Karsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
435dd35f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
17 deletions
+41
-17
epgpu.cu
+12
-12
genax.py
+28
-5
tetrarun.py
+1
-0
No files found.
epgpu.cu
View file @
b6a9ae36
...
@@ -190,13 +190,13 @@ __device__ void ABC_oldal(int v, int w, const vec3& C, const vec3& D, char* egys
...
@@ -190,13 +190,13 @@ __device__ void ABC_oldal(int v, int w, const vec3& C, const vec3& D, char* egys
vec3 AB(1.0/v, 0.0, 0.0);
vec3 AB(1.0/v, 0.0, 0.0);
vec3 AC = C/v;
vec3 AC = C/v;
for (double i =
1.0
; i < v; i++)
for (double i =
0.0001
; i < v; i++)
{
{
for (double j =
1.0
; j < v; j++)
for (double j =
0.0001
; j < v; j++)
{
{
vec3 K = i*AB + j * AC;
vec3 K = i*AB + j * AC;
vec3 L = (D - K)/w;
vec3 L = (D - K)/w;
for (double k =
1.0
; k < w; k++)
for (double k =
0.0001
; k < w; k++)
{
{
vec3 Sv = K + L*k;
vec3 Sv = K + L*k;
int S = stabil_ep(Sv, C, D);
int S = stabil_ep(Sv, C, D);
...
@@ -217,13 +217,13 @@ __device__ void BCD_oldal(int v, int w, const vec3& C, const vec3& D, char* egys
...
@@ -217,13 +217,13 @@ __device__ void BCD_oldal(int v, int w, const vec3& C, const vec3& D, char* egys
vec3 BC = (C - B) / v;
vec3 BC = (C - B) / v;
vec3 BD = (D - B) / v;
vec3 BD = (D - B) / v;
for (double i =
1.0
; i < v; i++)
for (double i =
0.0001
; i < v; i++)
{
{
for (double j =
1.0
; j < v; j++)
for (double j =
0.0001
; j < v; j++)
{
{
vec3 K = B + i * BC + j * BD;
vec3 K = B + i * BC + j * BD;
vec3 L = (A - K)/w;
vec3 L = (A - K)/w;
for (double k =
1.0
; k < w; k++)
for (double k =
0.0001
; k < w; k++)
{
{
vec3 Sv = K + L*k;
vec3 Sv = K + L*k;
int S = stabil_ep(Sv, C, D);
int S = stabil_ep(Sv, C, D);
...
@@ -244,13 +244,13 @@ __device__ void CDA_oldal(int v, int w, const vec3& C, const vec3& D, char* egys
...
@@ -244,13 +244,13 @@ __device__ void CDA_oldal(int v, int w, const vec3& C, const vec3& D, char* egys
vec3 CA = (A - C) / v;
vec3 CA = (A - C) / v;
vec3 CD = (D - C) / v;
vec3 CD = (D - C) / v;
for (double i =
1.0
; i < v; i++)
for (double i =
0.0001
; i < v; i++)
{
{
for (double j =
1.0
; j < v; j++)
for (double j =
0.0001
; j < v; j++)
{
{
vec3 K = C + i * CA + j * CD;
vec3 K = C + i * CA + j * CD;
vec3 L = (B - K)/w;
vec3 L = (B - K)/w;
for (double k =
1.0
; k < w; k++)
for (double k =
0.0001
; k < w; k++)
{
{
vec3 Sv = K + L*k;
vec3 Sv = K + L*k;
int S = stabil_ep(Sv, C, D);
int S = stabil_ep(Sv, C, D);
...
@@ -271,13 +271,13 @@ __device__ void DAB_oldal(int v, int w, const vec3& C, const vec3& D, char* egys
...
@@ -271,13 +271,13 @@ __device__ void DAB_oldal(int v, int w, const vec3& C, const vec3& D, char* egys
vec3 DA = (A - D) / v;
vec3 DA = (A - D) / v;
vec3 DB = (B - D) / v;
vec3 DB = (B - D) / v;
for (double i =
1.0
; i < v; i++)
for (double i =
0.0001
; i < v; i++)
{
{
for (double j =
1.0
; j < v; j++)
for (double j =
0.0001
; j < v; j++)
{
{
vec3 K = D + i * DA + j * DB;
vec3 K = D + i * DA + j * DB;
vec3 L = (C - K)/w;
vec3 L = (C - K)/w;
for (double k =
1.0
; k < w; k++)
for (double k =
0.0001
; k < w; k++)
{
{
vec3 Sv = K + L*k;
vec3 Sv = K + L*k;
int S = stabil_ep(Sv, C, D);
int S = stabil_ep(Sv, C, D);
...
...
genax.py
View file @
b6a9ae36
...
@@ -28,11 +28,11 @@ void parosit(const double* x1, const double* x2, double* a, double* b, const int
...
@@ -28,11 +28,11 @@ void parosit(const double* x1, const double* x2, double* a, double* b, const int
int tid = blockDim.x * blockIdx.x + threadIdx.x;
int tid = blockDim.x * blockIdx.x + threadIdx.x;
if (m <= tid || m*m <= tid*m+m-1)
if (m <= tid || m*m <= tid*m+m-1)
return;
return;
float
alpha = x1[tid];
double
alpha = x1[tid];
if (m*m <= tid*m+m-1)
if (m*m <= tid*m+m-1)
return;
return;
for (int i = 0; i < m; i++) {
for (int i = 0; i < m; i++) {
float
betha = x2[i];
double
betha = x2[i];
if ((alpha + betha) < PI && betha >= alpha && alpha > 0.0) {
if ((alpha + betha) < PI && betha >= alpha && alpha > 0.0) {
a[tid*m+i] = alpha;
a[tid*m+i] = alpha;
b[tid*m+i] = betha;
b[tid*m+i] = betha;
...
@@ -51,9 +51,11 @@ void parosit2(const double* x1, const double* x2, double* a, double* b, const in
...
@@ -51,9 +51,11 @@ void parosit2(const double* x1, const double* x2, double* a, double* b, const in
int tid = blockDim.x * blockIdx.x + threadIdx.x;
int tid = blockDim.x * blockIdx.x + threadIdx.x;
if (m <= tid || m*m <= tid*m+m-1)
if (m <= tid || m*m <= tid*m+m-1)
return;
return;
float alpha = x1[tid];
double alpha = x1[tid];
if (m*m <= tid*m+m-1)
return;
for (int i = 0; i < m; i++) {
for (int i = 0; i < m; i++) {
float
betha = x2[i];
double
betha = x2[i];
if ((alpha + betha) < PI && alpha > 0.0) {
if ((alpha + betha) < PI && alpha > 0.0) {
a[tid*m+i] = alpha;
a[tid*m+i] = alpha;
b[tid*m+i] = betha;
b[tid*m+i] = betha;
...
@@ -95,8 +97,16 @@ def angles_alap(anglestopick, plot = False):
...
@@ -95,8 +97,16 @@ def angles_alap(anglestopick, plot = False):
tCy
=
tgtA
/
mtgt
tCy
=
tgtA
/
mtgt
tCx
=
tCy
/
tgtA
tCx
=
tCy
/
tgtA
Cy
=
cp
.
concatenate
((
hCy
,
tCy
),
axis
=
None
)
Cx
=
cp
.
concatenate
((
hCx
,
tCx
),
axis
=
None
)
Cx
=
cp
.
concatenate
((
hCx
,
tCx
),
axis
=
None
)
if
Cx
.
size
==
0
:
Cx
=
cp
.
array
([
0.5
],
dtype
=
cp
.
float64
)
else
:
Cx
=
cp
.
append
(
Cx
,
[
0.5
],
axis
=
False
)
Cy
=
cp
.
concatenate
((
hCy
,
tCy
),
axis
=
None
)
if
Cy
.
size
==
0
:
Cy
=
cp
.
array
(
cp
.
sqrt
(
3.0
)
/
2.0
,
dtype
=
cp
.
float64
)
else
:
Cy
=
cp
.
append
(
Cy
,
[
cp
.
sqrt
(
3.0
)
/
2.0
],
axis
=
False
)
return
Cx
,
Cy
return
Cx
,
Cy
...
@@ -138,7 +148,19 @@ def angles_ratet(anglestopick, plot = False):
...
@@ -138,7 +148,19 @@ def angles_ratet(anglestopick, plot = False):
sin
=
cp
.
sin
(
anglestopick
)
sin
=
cp
.
sin
(
anglestopick
)
Dx
=
cp
.
outer
(
cp
.
full
(
anglestopick
.
size
,
1.0
,
dtype
=
cp
.
float64
),
Ex
)
.
flatten
()
Dx
=
cp
.
outer
(
cp
.
full
(
anglestopick
.
size
,
1.0
,
dtype
=
cp
.
float64
),
Ex
)
.
flatten
()
if
Dx
.
size
==
0
:
Dx
=
cp
.
array
([
0.5
],
dtype
=
cp
.
float64
)
else
:
Dx
=
cp
.
append
(
Dx
,
[
0.5
],
axis
=
False
)
Dy
=
cp
.
outer
(
cos
,
Ey
)
.
flatten
()
Dy
=
cp
.
outer
(
cos
,
Ey
)
.
flatten
()
if
Dy
.
size
==
0
:
Dy
=
cp
.
array
(
cp
.
sqrt
(
3.0
)
/
6.0
,
dtype
=
cp
.
float64
)
else
:
Dy
=
cp
.
append
(
Dy
,
[
cp
.
sqrt
(
3.0
)
/
6.0
],
axis
=
False
)
Dz
=
cp
.
outer
(
sin
,
Ey
)
.
flatten
()
Dz
=
cp
.
outer
(
sin
,
Ey
)
.
flatten
()
if
Dz
.
size
==
0
:
Dz
=
cp
.
array
(
cp
.
sqrt
(
2.0
/
3.0
),
dtype
=
cp
.
float64
)
else
:
Dz
=
cp
.
append
(
Dz
,
[
cp
.
sqrt
(
2.0
/
3.0
)],
axis
=
False
)
return
Dx
,
Dy
,
Dz
return
Dx
,
Dy
,
Dz
\ No newline at end of file
tetrarun.py
View file @
b6a9ae36
...
@@ -35,6 +35,7 @@ def main(argv):
...
@@ -35,6 +35,7 @@ def main(argv):
PLOT
=
True
PLOT
=
True
space
=
gen_angels_to_pick
(
n
,
PLOT
)
space
=
gen_angels_to_pick
(
n
,
PLOT
)
Cx
,
Cy
=
angles_alap
(
space
,
PLOT
)
Cx
,
Cy
=
angles_alap
(
space
,
PLOT
)
Dx
,
Dy
,
Dz
=
angles_ratet
(
space
)
Dx
,
Dy
,
Dz
=
angles_ratet
(
space
)
...
...
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