Skip to content
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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Add CatVector #577

wants to merge 8 commits into from

Conversation

tkoolen
Copy link
Collaborator

@tkoolen tkoolen commented Dec 31, 2019

Will be needed for upcoming changes related to simultaneous simulation of multiple mechanisms (#572, which might still take a while).

TODO:

  • basic documentation
  • adjust to incoming changes
  • benchmark operations needed for ODE integration

i += 1
end
end
error()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BoundsError

i += 1
end
end
error()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BoundsError

end

@inline Base.size(vec::CatVector) = (mapreduce(length, +, vec.vecs; init=0),)
Base.eltype(vec::CatVector) = eltype(eltype(vec.vecs))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Necessary?

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"))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outline throw?

@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"))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outline throw?

@codecov-io
Copy link

codecov-io commented Dec 31, 2019

Codecov Report

Merging #577 into master will decrease coverage by 0.18%.
The diff coverage is 80.3%.

Impacted file tree graph

@@           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
Impacted Files Coverage Δ
src/custom_collections/custom_collections.jl 100% <ø> (ø) ⬆️
src/custom_collections/CatVector.jl 80.3% <80.3%> (ø)
src/custom_collections/SegmentedVector.jl 85.71% <0%> (-0.78%) ⬇️
src/contact.jl 76.62% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dba2fb4...a7d3567. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants