Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
M
modgalrep
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Peter Bruin
modgalrep
Commits
d45ae478
Commit
d45ae478
authored
Jul 31, 2020
by
Peter Bruin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid infinite loop in random_torsion_point
parent
8abfafa9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
modcurve/torsion-subscheme.c
modcurve/torsion-subscheme.c
+4
-4
No files found.
modcurve/torsion-subscheme.c
View file @
d45ae478
...
...
@@ -121,7 +121,7 @@ find_extension(GEN group, unsigned long l, unsigned long p,
/* Naïve algorithm for finding a random l-torsion point. */
static
GEN
random_torsion_point
(
GEN
J
,
unsigned
long
l
)
{
random_torsion_point
(
GEN
J
,
unsigned
long
l
,
int
*
tries
)
{
GEN
n
,
m
;
long
v
;
GEN
P
,
Q
;
...
...
@@ -132,7 +132,7 @@ random_torsion_point(GEN J, unsigned long l) {
if
(
v
==
0
)
pari_err
(
e_MISC
,
"no point of order %li"
,
l
);
m
=
gdiv
(
n
,
powuu
(
l
,
v
));
while
(
1
)
{
while
(
(
*
tries
)
--
>
0
)
{
err_printf
(
"finding random point
\n
"
);
P
=
jacobian_random_point
(
J
);
err_printf
(
"multiplying by %Ps
\n
"
,
m
);
...
...
@@ -186,8 +186,8 @@ find_bases(GEN J, unsigned long l, GEN f, GEN proj, int tries,
*
matrices
=
cgetg
(
n
+
1
,
t_VEC
);
for
(
i
=
1
;
i
<=
n
;
i
++
)
gel
(
*
bases
,
i
)
=
cgetg
(
1
,
t_VEC
);
while
(
tries
--
>
0
&&
found
<
2
*
n
)
{
P
=
random_torsion_point
(
J
,
l
);
while
(
tries
>
0
&&
found
<
2
*
n
)
{
P
=
random_torsion_point
(
J
,
l
,
&
tries
);
for
(
i
=
1
;
i
<=
n
;
i
++
)
{
j
=
lg
(
gel
(
*
bases
,
i
))
-
1
;
if
(
j
==
2
)
...
...
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