Skip to content

Commit cb1a766

Browse files
committed
Added support for ranges in getindex
1 parent a6202ff commit cb1a766

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Polynomials.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ norm(q::Poly, args...) = norm(coeffs(q), args...)
192192
193193
"""
194194
getindex{T}(p::Poly{T}, i) = (i+1 > length(p.a) ? zero(T) : p.a[i+1])
195+
getindex{T}(p::Poly{T}, idx::AbstractArray) = map(i->p[i], idx)
195196
function setindex!(p::Poly, v, i)
196197
n = length(p.a)
197198
if n < i+1

0 commit comments

Comments
 (0)