-
Notifications
You must be signed in to change notification settings - Fork 126
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
feat: adjust for upcoming indexing changes #3276
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #3276 +/- ##
=======================================
Coverage 81.62% 81.63%
=======================================
Files 546 546
Lines 73282 73296 +14
=======================================
+ Hits 59820 59833 +13
- Misses 13462 13463 +1
|
@@ -259,7 +259,7 @@ function _construct_literature_model_over_concrete_base(model_dict::Dict{String, | |||
|
|||
# Find divisor classes of the internal model sections | |||
auxiliary_base_grading = matrix(ZZ, transpose(hcat([[eval_poly(weight, ZZ) for weight in vec] for vec in model_dict["model_data"]["auxiliary_base_grading"]]...))) | |||
auxiliary_base_grading = vcat([[Int(k) for k in auxiliary_base_grading[i,:]] for i in 1:nrows(auxiliary_base_grading)]...) | |||
auxiliary_base_grading = vcat([[Int(k) for k in auxiliary_base_grading[i:i,:]] for i in 1:nrows(auxiliary_base_grading)]...) |
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.
Not an objection, just trying to understand: presumably the old and new code will behave differently in the future? What will the difference be?
For Julia matrices, the difference is whether a vector or a matrix is returned. But we don't have dedicated vector objects, have we? Or is the plan to add them? (Ah, perhaps for a sparse matrix we'd be returning SRow
versus SMat
?)
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.
Yes. It will just be a Vector
(see the Linear algebra roadmap), so that the dimension of the indices now correspond to the dimension to the output (as for julia arrays).
- Nowadays we have more support for
Matrix * Vector
andsolve(::Matrix, ::Vector)
and things like that, which we did not have 5 years ago. So back then we avoidedVector
at all costs. - At the moment, it is cumbersome to get rows/columns as
Vector
. With the "new" indexing, it is easy: Just do[i, :]
. To get it as a matrix, just do[[i], :]
or[i:i, :]
.
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.
I noticed one place that probably needs to get adjusted as well. Apart from that, fine with me
src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/standard_constructions.jl
Outdated
Show resolved
Hide resolved
…dard_constructions.jl Co-authored-by: Lars Göttgens <lars.goettgens@rwth-aachen.de>
No functional changes here, but it will allow us to eventually clean up some of the indexing for matrices.