Combinatorics.jl icon indicating copy to clipboard operation
Combinatorics.jl copied to clipboard

added `Base.eltype()` method for `MultiExponents`

Open jbshannon opened this issue 2 years ago • 1 comments

collect called on MultiExponents is type-unstable because MultiExponents has no defined eltype. This PR adds a method for Base.eltype() so that collect returns a Vector{Vector{Int64}} rather than a Vector{Any}.

Before:

julia> collect(multiexponents(3, 2))
6-element Array{Any,1}:
 [2, 0, 0]
 [1, 1, 0]
 [1, 0, 1]
 [0, 2, 0]
 [0, 1, 1]
 [0, 0, 2]

After:

julia> collect(multiexponents(3, 2))
6-element Vector{Vector{Int64}}:
 [2, 0, 0]
 [1, 1, 0]
 [1, 0, 1]
 [0, 2, 0]
 [0, 1, 1]
 [0, 0, 2]

jbshannon avatar Mar 29 '23 14:03 jbshannon

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (ac70c46) 96.97% compared to head (2ddfe36) 96.98%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #136   +/-   ##
=======================================
  Coverage   96.97%   96.98%           
=======================================
  Files           7        7           
  Lines         728      729    +1     
=======================================
+ Hits          706      707    +1     
  Misses         22       22           
Impacted Files Coverage Δ
src/multinomials.jl 92.85% <100.00%> (+0.54%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Mar 29 '23 14:03 codecov[bot]