-
-
Notifications
You must be signed in to change notification settings - Fork 555
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
Matrix construction over prime field fails for some types of inputs #36104
Labels
Comments
5 tasks
5 tasks
vbraun
pushed a commit
to vbraun/sage
that referenced
this issue
Feb 11, 2025
sagemathgh-39488: Fix issue on matrix construction over integer mod ring for large coefficients Fix Issue sagemath#36104. In previous versions of Python, `int` size was limited and therefore could be cast to `long`. With Python 3 this limit does not exists and the code breaks with large integers. We modify the construction of `Matrix_modn_dense_template` from Python integers, directly using some existing cast from Sage. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. URL: sagemath#39488 Reported by: Hugo Passe Reviewer(s): Vincent Neiger
vbraun
pushed a commit
to vbraun/sage
that referenced
this issue
Feb 18, 2025
sagemathgh-39488: Fix issue on matrix construction over integer mod ring for large coefficients Fixes sagemath#36104. In previous versions of Python, `int` size was limited and therefore could be cast to `long`. With Python 3 this limit does not exists and the code breaks with large integers. We modify the construction of `Matrix_modn_dense_template` from Python integers, directly using some existing cast from Sage. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. URL: sagemath#39488 Reported by: Hugo Passe Reviewer(s): Vincent Neiger
vbraun
pushed a commit
to vbraun/sage
that referenced
this issue
Feb 21, 2025
sagemathgh-39488: Fix issue on matrix construction over integer mod ring for large coefficients Fixes sagemath#36104. In previous versions of Python, `int` size was limited and therefore could be cast to `long`. With Python 3 this limit does not exists and the code breaks with large integers. We modify the construction of `Matrix_modn_dense_template` from Python integers, directly using some existing cast from Sage. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. URL: sagemath#39488 Reported by: Hugo Passe Reviewer(s): Vincent Neiger
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps To Reproduce
The constructor for matrices of type
matrix_modn_dense
is supposed to accept a matrix of Python integersint
. Yet it will fail with overflow if given integers that exceed the maximum value for along
.Try the following example:
Expected Behavior
We expect that mat is constructed as an
1 x 1
matrix with single entry the elementGF(9001)(x)
(represented by7633
in sage).Actual Behavior
Additional Information
We see in the error message that there is an attempt to convert
x
into along
, hence the overflow error.Environment
Checklist
The text was updated successfully, but these errors were encountered: