-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add CatVector #577
base: master
Are you sure you want to change the base?
Add CatVector #577
Conversation
src/custom_collections/CatVector.jl
Outdated
i += 1 | ||
end | ||
end | ||
error() |
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.
BoundsError
src/custom_collections/CatVector.jl
Outdated
i += 1 | ||
end | ||
end | ||
error() |
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.
BoundsError
src/custom_collections/CatVector.jl
Outdated
end | ||
|
||
@inline Base.size(vec::CatVector) = (mapreduce(length, +, vec.vecs; init=0),) | ||
Base.eltype(vec::CatVector) = eltype(eltype(vec.vecs)) |
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.
Necessary?
src/custom_collections/CatVector.jl
Outdated
Base.similar(vec::CatVector, ::Type{T}) where {T} = CatVector(map(x -> similar(x, T), vec.vecs)) | ||
|
||
@inline function check_cat_vectors_line_up(x::CatVector, y::CatVector) | ||
length(x.vecs) == length(y.vecs) || throw(ArgumentError("Subvectors must line up")) |
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.
Outline throw?
src/custom_collections/CatVector.jl
Outdated
@inline function check_cat_vectors_line_up(x::CatVector, y::CatVector) | ||
length(x.vecs) == length(y.vecs) || throw(ArgumentError("Subvectors must line up")) | ||
for i in eachindex(x.vecs) | ||
length(x.vecs[i]) == length(y.vecs[i]) || throw(ArgumentError("Subvectors must line up")) |
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.
Outline throw?
Codecov Report
@@ Coverage Diff @@
## master #577 +/- ##
========================================
- Coverage 89.19% 89% -0.19%
========================================
Files 51 52 +1
Lines 3148 3212 +64
========================================
+ Hits 2808 2859 +51
- Misses 340 353 +13
Continue to review full report at Codecov.
|
Will be needed for upcoming changes related to simultaneous simulation of multiple mechanisms (#572, which might still take a while).
TODO: