-
Notifications
You must be signed in to change notification settings - Fork 58
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
Added arg checks (nrows/ncols) for constructors of ZZMatrix & QQMatrix #1711
Conversation
Hm, these are internal and not meant for the user. We usually don't add argument checks for those. Because this also means checking things twice. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1711 +/- ##
==========================================
- Coverage 84.93% 84.76% -0.18%
==========================================
Files 95 94 -1
Lines 37235 37247 +12
==========================================
- Hits 31627 31571 -56
- Misses 5608 5676 +68 ☔ View full report in Codecov by Sentry. |
I noticed that most of the constructors did not check the dimensions. The checks do need to be made at least for |
Do you remember which |
Sorry for the delay in responding. I'm fairly it was just |
The problem is that one can create the matrix space without problems, but only gets an error when the first actual matrix is created. See julia> M = matrix_space(ZZ, -1,-1)
Matrix space of -1 rows and -1 columns
over integer ring
julia> zero(M)
Exception (flint). Overflow creating size -1 x -1 object.
ERROR: Problem in the Flint-Subsystem |
Thanks @lgoettgens for the explicit example; now I see it, I recall that that was indeed the problem I originally encountered. |
Presumably creating a
|
I have the impression that the checks should then be put in the user facing |
Yes, exactly. |
My preference is to leave the checks in the constructors:
Well, the code is not mine, so my preferences perhaps count for little... |
Forbids negative matrix dimensions