Skip to content

Commit

Permalink
remove Compat
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed May 26, 2019
1 parent 11f9e4f commit 52f1aca
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 72 deletions.
6 changes: 2 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ uuid = "b4f0291d-fe17-52bc-9479-3d1a343d9043"
version = "1.12.0"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73"
Expand All @@ -18,7 +18,6 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
julia = "≥ 1.0.0"
Compat = "≥ 1.0.0"
Expokit = "≥ 0.1.0"
GLPKMathProgInterface = "≥ 0.4.0"
IntervalArithmetic = "≥ 0.14.0"
Expand All @@ -29,7 +28,6 @@ RecipesBase = "≥ 0.3.0"
Requires = "≥ 0.4.0"

[extras]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Expokit = "a1e7a1ef-7a5d-5822-a38c-be74e1bb89f4"
GLPKMathProgInterface = "3c7084bd-78ad-589a-b5bb-dbd673274bea"
Expand All @@ -44,4 +42,4 @@ RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"

[targets]
test = ["Expokit", "Pkg", "IntervalArithmetic", "GLPKMathProgInterface", "Compat", "RecipesBase", "MathProgBase", "Requires", "Optim", "Polyhedra", "Documenter", "Plots", "GR"]
test = ["Expokit", "Pkg", "IntervalArithmetic", "GLPKMathProgInterface", "RecipesBase", "MathProgBase", "Requires", "Optim", "Polyhedra", "Documenter", "Plots", "GR"]
2 changes: 0 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
CDDLib = "3391f64e-dcde-5f30-b752-e11513730f60"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Expokit = "a1e7a1ef-7a5d-5822-a38c-be74e1bb89f4"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
Expand All @@ -15,7 +14,6 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
[compat]
BenchmarkTools = "≥ 0.4.2"
CDDLib = "≥ 0.5.2"
Compat = "≥ 1.0.0"
Documenter = "≥ 0.22.3"
Expokit = "≥ 0.1.0"
GR = "≥ 0.39.1"
Expand Down
3 changes: 1 addition & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
DocTestFilters = [r"[0-9\.]+ seconds \(.*\)"]
CurrentModule = LazySets
DocTestSetup = quote
using LazySets
using Compat.SparseArrays, Compat.LinearAlgebra
using LazySets, SparseArrays, LinearAlgebra
end
```

Expand Down
2 changes: 1 addition & 1 deletion docs/src/lib/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Depth = 4
CurrentModule = LazySets
DocTestSetup = quote
using LazySets
using Compat.InteractiveUtils: subtypes
using InteractiveUtils: subtypes
end
```

Expand Down
2 changes: 1 addition & 1 deletion docs/src/lib/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Depth = 3
CurrentModule = LazySets
DocTestSetup = quote
using LazySets
using Compat.SparseArrays, Compat.LinearAlgebra
using SparseArrays, LinearAlgebra
end
```

Expand Down
2 changes: 1 addition & 1 deletion docs/src/lib/representations.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Depth = 3
CurrentModule = LazySets
DocTestSetup = quote
using LazySets
using Compat.SparseArrays, Compat.LinearAlgebra
using SparseArrays, LinearAlgebra
end
```

Expand Down
4 changes: 2 additions & 2 deletions docs/src/man/concrete_polyhedra.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Depth = 3

```@meta
DocTestSetup = quote
using Plots, LazySets, LazySets.Approximations, Polyhedra, Compat.LinearAlgebra
using Plots, LazySets, LazySets.Approximations, Polyhedra, LinearAlgebra
end
```

Expand All @@ -42,7 +42,7 @@ To use the `Polyhedra.jl` interface, you need to load the package with `using Po
Let's create an H-representation object:

```@example concrete_polyhedra
using Plots, LazySets, Polyhedra, Compat.LinearAlgebra
using Plots, LazySets, Polyhedra, LinearAlgebra
A = [1. 1;1 -1;-1 0]
b = [1.,0,0]
Expand Down
4 changes: 2 additions & 2 deletions docs/src/man/interval_hulls.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Depth = 3

```@meta
DocTestSetup = quote
using Plots, LazySets, LazySets.Approximations, Compat.SparseArrays
using Plots, LazySets, LazySets.Approximations, SparseArrays
end
```

Expand Down Expand Up @@ -126,7 +126,7 @@ It is defined in the `Approximations` module as well.

```@example example_ih
import LazySets.Approximations.symmetric_interval_hull
using Compat.SparseArrays
using SparseArrays
plot(X, 1e-3, aspectratio=1)
plot!(Y, 1e-3)
Expand Down
9 changes: 4 additions & 5 deletions docs/src/man/reach_zonotopes.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,17 @@ overapproximates the states reachable by any trajectory of this IVP.
## Algorithm

```@example example_reach_zonotopes
using Plots, LazySets, Compat.LinearAlgebra, Compat.SparseArrays
import LazySets.expmat
using Plots, LazySets, LinearAlgebra, SparseArrays
function Algorithm1(A, X0, δ, μ, T)
# bloating factors
Anorm = norm(A, Inf)
α = (expmat(δ * Anorm) - 1 - δ * Anorm) / norm(X0, Inf)
β = (expmat(δ * Anorm) - 1) * μ / Anorm
α = (exp(δ * Anorm) - 1 - δ * Anorm) / norm(X0, Inf)
β = (exp(δ * Anorm) - 1) * μ / Anorm
# discretized system
n = size(A, 1)
ϕ = expmat(δ * A)
ϕ = exp(δ * A)
N = floor(Int, T / δ)
# preallocate arrays
Expand Down
9 changes: 4 additions & 5 deletions docs/src/man/reach_zonotopes_hybrid.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ Depending on the transition semantics, we add the discrete successors to the
queue and continue with the next iteration until the queue is empty.

```@example example_reach_zonotopes_hybrid
using Plots, LazySets, Compat.LinearAlgebra
import LazySets.expmat
using Plots, LazySets, LinearAlgebra
function reach_hybrid(As, Ts, init, δ, μ, T, max_order, instant_transitions)
# initialize queue with initial mode and states at time t=0
Expand Down Expand Up @@ -83,12 +82,12 @@ concrete operations on zonotopes.
function reach_continuous(A, X0, δ, μ, T, max_order)
# bloating factors
Anorm = norm(A, Inf)
α = (expmat(δ*Anorm) - 1 - δ*Anorm)/norm(X0, Inf)
β = (expmat(δ*Anorm) - 1)*μ/Anorm
α = (exp(δ*Anorm) - 1 - δ*Anorm)/norm(X0, Inf)
β = (exp(δ*Anorm) - 1)*μ/Anorm
# discretized system
n = size(A, 1)
ϕ = expmat(δ*A)
ϕ = exp(δ*A)
N = floor(Int, T/δ)
# preallocate array
Expand Down
4 changes: 1 addition & 3 deletions src/Approximations/Approximations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ support vectors.
"""
module Approximations

using LazySets, Requires
using LazySets, Requires, LinearAlgebra, SparseArrays

export approximate,
ballinf_approximation,
Expand All @@ -23,8 +23,6 @@ export approximate,
PolarDirections,
SphericalDirections

include("../compat.jl")

const TOL(N::Type{Float64}) = eps(N)
const TOL(N::Type{Float32}) = eps(N)
const TOL(N::Type{Rational{INNER}}) where {INNER} = zero(N)
Expand Down
2 changes: 1 addition & 1 deletion src/Approximations/overapproximate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ hybrid systems using a combination of zonotopes and polytopes. Nonlinear analysi
hybrid systems, 4(2), 233-249.*
"""
function overapproximate(Z::Zonotope, ::Type{<:Hyperrectangle})::Hyperrectangle
r = Compat.sum(abs.(Z.generators), dims=2)[:]
r = sum(abs.(Z.generators), dims=2)[:]
return Hyperrectangle(Z.center, r)
end

Expand Down
2 changes: 1 addition & 1 deletion src/LazySet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ false
"""
function ==(X::LazySet, Y::LazySet)
# if the common supertype of X and Y is abstract, they cannot be compared
if Compat.isabstracttype(promote_type(typeof(X), typeof(Y)))
if isabstracttype(promote_type(typeof(X), typeof(Y)))
return false
end

Expand Down
9 changes: 6 additions & 3 deletions src/LazySets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ __precompile__(true)
# main module for `LazySets.jl`
module LazySets

include("compat.jl")

using Requires
using Requires, SparseArrays, LinearAlgebra
using LinearAlgebra: checksquare
import LinearAlgebra: norm, ×
import Random
using Random: AbstractRNG, GLOBAL_RNG, SamplerType, shuffle
import InteractiveUtils: subtypes

export Approximations

Expand Down
2 changes: 1 addition & 1 deletion src/Zonotope.jl
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ function reduce_order(Z::Zonotope{N}, r)::Zonotope{N} where {N<:Real}
rg = G[:, ind[1:m]] # reduced generators

# interval hull computation of reduced generators
Gbox = Diagonal(Compat.sum(abs.(rg), dims=2)[:])
Gbox = Diagonal(sum(abs.(rg), dims=2)[:])
if m < p
Gnotred = G[:, ind[m+1:end]]
Gred = [Gnotred Gbox]
Expand Down
30 changes: 0 additions & 30 deletions src/compat.jl

This file was deleted.

6 changes: 6 additions & 0 deletions src/helper_functions.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
export _At_mul_B

# default tolerance for matrix condition number (see 'isinvertible')
const DEFAULT_COND_TOL = 1e6

# matrix-matrix multiplication and division
@inline _At_mul_B(A, B) = transpose(A) * B
@inline _At_ldiv_B(A, B) = transpose(A) \ B

"""
dot_zero(x::AbstractVector{N}, y::AbstractVector{N}) where{N<:Real}
Expand Down
7 changes: 1 addition & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
using LazySets, LazySets.Approximations

using LazySets, LazySets.Approximations, Test, LinearAlgebra, SparseArrays
import IntervalArithmetic, Expokit, Optim
using IntervalArithmetic: IntervalBox

# compatibility between Julia versions
include("../src/compat.jl")
using Compat.Test

# conversion between numeric types
include("to_N.jl")

Expand Down
4 changes: 2 additions & 2 deletions test/unit_ExponentialMap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ for N in [Float64, Float32]
σ(sparsevec(d), emap)

# check consistency with respect to explicit computation of the matrix exponential
svec_explicit = σ(d, expmat(Matrix(m)) * b)
svec_explicit = σ(d, exp(Matrix(m)) * b)
if N == Float64
# precision with Float32 is not sufficient
@test svec svec_explicit
Expand Down Expand Up @@ -126,7 +126,7 @@ for N in [Float64, Float32]
σ(sparsevec(d), projmap)

# check consistency with respect to explicit computation of the matrix exponential
P = L * expmat(Matrix(m)) * R
P = L * exp(Matrix(m)) * R
svec_explicit = σ(d, P*b)
@test svec svec_explicit

Expand Down

0 comments on commit 52f1aca

Please sign in to comment.