-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More GMP work #1075
Merged
+884
−1,071
Merged
More GMP work #1075
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
1898ea7
gmpints: introduce fake_mpz_t
fingolfin 8c018e0
gmpints: merge GMPorINTOBJ_INT and ObjInt_Int
fingolfin e918054
gmpints: rewrite PrintInt using mpz_get_str
fingolfin 1c6d8ee
gmpints: rewrite HexStringInt and STRING_INT using fake_mpz_t
fingolfin b591686
gmpints: remove GMP_INTOBJ
fingolfin 9a3689f
gmpints: rewrite FuncIntHexString
fingolfin 99418d3
gmpints: replace TypLimb -> mp_limb_t, TypGMPSize -> mp_size_t
fingolfin b700ea4
gmpints: replace INTEGER_ALLOCATION_SIZE by INTEGER_UNIT_SIZE
fingolfin af567b1
gmpints: cleanup gmpints.h
fingolfin 6a5815f
gmpints: simplify ModInt
fingolfin b8a188c
gmpints: remove NEW_INTPOS
fingolfin 8454a6f
gmpints: add IS_INT, IS_POSITIVE, REQUIRE_INT_ARG
fingolfin 1c8ae24
gmpints: change REQUIRE_INT_ARG to use ErrorMayQuit
fingolfin cdba5d4
gmpints: use REQUIRE_INT_ARG in two more places
fingolfin 3e44492
gmpints: fix RemInt error handling
fingolfin 42c4845
gmpints: add JACOBI_INT and change Jacobi() to use it
fingolfin 0950124
gmpints: add POWERMODINT and INVMODINT
fingolfin 9561e9d
gmpints: add PVALUATION_INT
fingolfin fbf656a
tests: replace legal header in intarith.tst
fingolfin 9bc7f34
gmpints: explain the buffer in PrintInt
fingolfin cad52ab
gmpints: improve initial documentation comment
fingolfin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gmpints: add POWERMODINT and INVMODINT
This adds a GMP based implementation of PowerModInt. The new kernel function INVMODINT computes modular inverse, and is not currently exposed to the library in a documented function. As usual, we get a speedup. Old code: gap> for b in [-100..100] do for e in [1..100] do for m in [1..100] do > PowerModInt(b,e,m);od;od;od; time; 2270 gap> for b in [-100..100] do for e in [1..100] do for m in [1..100] do > PowerModInt(b,2^e,m);od;od;od; time; 11354 New code: gap> for b in [-100..100] do for e in [1..100] do for m in [1..100] do > PowerModInt(b,e,m);od;od;od; time; 625 gap> for b in [-100..100] do for e in [1..100] do for m in [1..100] do > PowerModInt(b,2^e,m);od;od;od; time; 1920
commit 09501242ed7189cdab9fdb2ec8cb4832e2465a01
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it obvious enough that ?
Negative values seem to work (now) if is invertible, so that should maybe be documented explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But e can (still) be 0. And negative values were supported before, just not documented.
Documenting this more explicitly is fine by me, but I'd prefer to not do this as part of this PR (which has been in the works for very long by now)...