File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ p + q # ERROR: Polynomials must have same variable.
5959immutable Poly{T}
6060 a:: Vector{T}
6161 var:: Symbol
62- @compat function (:: Type{Poly} ){T<: Number }(a:: Vector {T} , var:: SymbolLike = :x )
62+ @compat function (:: Type{Poly} ){T<: Number }(a:: AbstractVector {T} , var:: SymbolLike = :x )
6363 # if a == [] we replace it with a = [0]
6464 if length (a) == 0
6565 return new {T} (zeros (T,1 ), @compat Symbol (var))
@@ -72,7 +72,7 @@ immutable Poly{T}
7272end
7373
7474Poly (n:: Number , var:: SymbolLike = :x ) = Poly ([n], var)
75- @compat (:: Type{Poly{T}} ){T,S}(x:: Vector {S} , var:: SymbolLike = :x ) =
75+ @compat (:: Type{Poly{T}} ){T,S}(x:: AbstractVector {S} , var:: SymbolLike = :x ) =
7676 Poly (convert (Vector{T}, x), var)
7777
7878# create a Poly object from its roots
Original file line number Diff line number Diff line change @@ -324,3 +324,4 @@ for term in p1
324324end
325325
326326@test eltype (typeof (p1)) == typeof (p1)
327+ @test length (collect (p1)) == degree (p1)+ 1
You can’t perform that action at this time.
0 commit comments