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.
59
59
immutable Poly{T}
60
60
a:: Vector{T}
61
61
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 )
63
63
# if a == [] we replace it with a = [0]
64
64
if length (a) == 0
65
65
return new {T} (zeros (T,1 ), @compat Symbol (var))
@@ -72,7 +72,7 @@ immutable Poly{T}
72
72
end
73
73
74
74
Poly (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 ) =
76
76
Poly (convert (Vector{T}, x), var)
77
77
78
78
# 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
324
324
end
325
325
326
326
@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