Skip to content

Commit d709c2a

Browse files
committed
Fix v0.6 warnings and drop v0.5
1 parent 83297a5 commit d709c2a

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

REQUIRE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
julia 0.5
2-
Compat 0.17
1+
julia 0.6-

src/MultivariatePolynomials.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ __precompile__()
22

33
module MultivariatePolynomials
44

5-
using Compat
6-
75
import Base: show, length, getindex, vect, isless, isempty, start, done, next, convert, dot, copy, eltype, zero, one
86

9-
@compat abstract type PolyType{C} end
7+
abstract type PolyType{C} end
108
export iscomm
119
iscomm{C}(::PolyType{C}) = C
1210
zero{C}(::Type{PolyType{C}}) = zero(Polynomial{C, Int})

src/algebraicset.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export AbstractSemialgebraicSet, AbstractBasicSemialgebraicSet, AbstractAlgebraicSet
22
export FullSpace, AlgebraicSet, BasicSemialgebraicSet, addequality!, addinequality!
33
# Semialgebraic set described by polynomials with coefficients in T
4-
@compat abstract type AbstractSemialgebraicSet end
4+
abstract type AbstractSemialgebraicSet end
55

6-
@compat abstract type AbstractBasicSemialgebraicSet <: AbstractSemialgebraicSet end
7-
@compat abstract type AbstractAlgebraicSet <: AbstractBasicSemialgebraicSet end
6+
abstract type AbstractBasicSemialgebraicSet <: AbstractSemialgebraicSet end
7+
abstract type AbstractAlgebraicSet <: AbstractBasicSemialgebraicSet end
88

99
addinequality!(S::AbstractAlgebraicSet, p) = throw(ArgumentError("Cannot add inequality to an algebraic set"))
1010

src/mono.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030
immutable PolyVar{C} <: PolyType{C}
3131
id::Int
3232
name::AbstractString
33-
function PolyVar{C}(name::AbstractString) where {C}
33+
function PolyVar{C}(name::AbstractString) where C
3434
# gensym returns something like Symbol("##42")
3535
# we first remove "##" and then parse it into an Int
3636
id = parse(Int, string(gensym())[3:end])
@@ -150,7 +150,7 @@ type MonomialVector{C} <: PolyType{C}
150150
vars::Vector{PolyVar{C}}
151151
Z::Vector{Vector{Int}}
152152

153-
function MonomialVector{C}(vars::Vector{PolyVar{C}}, Z::Vector{Vector{Int}}) where {C}
153+
function MonomialVector{C}(vars::Vector{PolyVar{C}}, Z::Vector{Vector{Int}}) where C
154154
for z in Z
155155
if length(vars) != length(z)
156156
throw(ArgumentError("There should be as many vars than exponents"))
@@ -313,7 +313,7 @@ function sortmonovec{C, T<:Union{PolyType,Int}}(::Type{PolyVar{C}}, X::Vector{T}
313313
σ, MonomialVector{C}(allvars, Z[σ])
314314
end
315315
end
316-
VectorOfPolyType{C} = Union{PolyType{C},Int}
316+
const VectorOfPolyType{C} = Union{PolyType{C},Int}
317317
sortmonovec{T<:VectorOfPolyType{false}}(x::Vector{T}) = sortmonovec(PolyVar{false}, x)
318318
sortmonovec{T<:VectorOfPolyType{true}}(x::Vector{T}) = sortmonovec(PolyVar{true}, x)
319319
function (::Type{MonomialVector{C}}){C}(X::Vector)

src/poly.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ export monomial, monomials, removeleadingterm, removemonomials
33
export leadingcoef, leadingmonomial, leadingterm
44
export getmat, divides
55

6-
@compat abstract type TermType{C, T} <: PolyType{C} end
6+
abstract type TermType{C, T} <: PolyType{C} end
77
eltype{C, T}(::Type{TermType{C, T}}) = T
88
eltype{C, T}(p::TermType{C, T}) = T
99
zero{C, T}(t::TermType{C, T}) = Polynomial(T[], MonomialVector{C}(vars(t), Vector{Vector{Int}}()))
1010
#zero{T<:TermType}(::Type{T}) = Polynomial(eltype(T)[], MonomialVector{iscomm(T)}())
1111
one{C, T}(t::TermType{C, T}) = Polynomial([one(T)], MonomialVector{C}(vars(t), [zeros(Int, length(vars(t)))]))
1212
#one{T<:TermType}(::Type{T}) = Polynomial([one(eltype(T))], MonomialVector{iscomm(T)}(PolyVar[], [Int[]]))
1313

14-
@compat abstract type TermContainer{C, T} <: TermType{C, T} end
14+
abstract type TermContainer{C, T} <: TermType{C, T} end
1515
eltype{C, T}(::Type{TermContainer{C, T}}) = T
1616
zero{C, T}(::Type{TermContainer{C, T}}) = zero(Polynomial{C, T})
1717
one{C, T}(::Type{TermContainer{C, T}}) = one(Polynomial{C, T})
@@ -80,7 +80,8 @@ type Polynomial{C, T} <: TermContainer{C, T}
8080
x::MonomialVector{C}
8181

8282
function Polynomial{C, T}(a::Vector{T}, x::MonomialVector{C}) where {C, T}
83-
if length(a) != length(x) throw(ArgumentError("There should be as many coefficient than monomials"))
83+
if length(a) != length(x)
84+
throw(ArgumentError("There should be as many coefficient than monomials"))
8485
end
8586
zeroidx = Int[]
8687
for (i,α) in enumerate(a)

0 commit comments

Comments
 (0)