-
Notifications
You must be signed in to change notification settings - Fork 162
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
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 JACOBI_INT and change Jacobi() to use it
Use GMP's mpz_kronecker to compute the Kronecker-Jacobi symbol J(n,m). We retain the old GAP implementation for reference, and also to facilitate testing (we want to make sure that old and new code return identical results). Note that the new implementation accepts some more inputs, namely it allows negative values for m. This is because GMP allows this, and it seems pointless to restrict this again. The new implementation is considerably faster. Old code: gap> for a in [1..1000] do for b in [1..1000] do Jacob(a,b);od;od;time; 1979 New code: gap> for a in [1..1000] do for b in [1..1000] do Jacob(a,b);od;od;time; 85
- Loading branch information
commit 42c4845af6a163e41f8986ce0ca9263790190b44
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.
While its great to be able to do all these in GMP, I would quite like to keep GAP functions around as an alternative. The reason is that while implementing GAP in alternative runtimes, the more code one does not have to write in the runtime the better.
I don't know how to do this cleanly right now though.
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.
That is exactly how I did it before @ChrisJefferson asked me to remove the GAP implementation sigh. It is still around in the .tst files, by the way.
I can add it back here again, but I don't want to rewrite the code a third time, so I'll wait until at least @ChrisJefferson signs off on it, too.
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.
Caveat: the new Jacobi accepts more inputs than the old (n negative).
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.
As discussed in the chat, I am happy with moving the function to tests, and I will attempt to make a structured attempt at detecting which functions are delegated to C code (and collect/provide GAP implementations where appropriate).