Skip to content

Commit

Permalink
Fix collect(::MonomialVector)
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Jan 29, 2020
1 parent 7926df5 commit e2e0ed3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DynamicPolynomials"
uuid = "7c1d4256-1411-5781-91ec-d7bc3513ac07"
repo = "https://github.com/JuliaAlgebra/DynamicPolynomials.jl.git"
version = "0.3.7"
version = "0.3.8"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand Down
5 changes: 3 additions & 2 deletions src/monovec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ end
# `mutable_copy` recursively copies the vector or vector of integers.
MA.mutable_copy(m::MV) where {MV<:MonomialVector} = MV(copy(m.vars), MA.mutable_copy(m.Z))
Base.copy(m::MonomialVector) = MA.mutable_copy(m)
function Base.getindex(x::MV, I) where {MV<:MonomialVector}
MV(x.vars, x.Z[sort(I)])
function Base.getindex(x::MonomialVector, I)
return typeof(x)(x.vars, x.Z[sort(I)])
end
Base.getindex(x::MonomialVector, i::Integer) = Monomial(x.vars, x.Z[i])
Base.getindex(x::MonomialVector, i::CartesianIndex{1}) = x[i.I[1]]

Base.firstindex(x::MonomialVector) = firstindex(x.Z)
Base.lastindex(x::MonomialVector) = lastindex(x.Z)
Expand Down

2 comments on commit e2e0ed3

@blegat
Copy link
Member Author

@blegat blegat commented on e2e0ed3 Jan 29, 2020

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/8614

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.8 -m "<description of version>" e2e0ed3e5925a4869efcd02da7dd13e8a492a55d
git push origin v0.3.8

Please sign in to comment.