diff --git a/Project.toml b/Project.toml index 2cb2686b..50baa5ad 100644 --- a/Project.toml +++ b/Project.toml @@ -3,11 +3,11 @@ uuid = "774a0091-654f-5c65-bbdc-ad5b67b45832" version = "0.2.0" [deps] -Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" Expokit = "a1e7a1ef-7a5d-5822-a38c-be74e1bb89f4" HybridSystems = "2207ec0c-686c-5054-b4d2-543502888820" IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253" LazySets = "b4f0291d-fe17-52bc-9479-3d1a343d9043" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MathematicalSystems = "d14a8603-c872-5ed3-9ece-53e0e82e39da" Memento = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9" Optim = "429524aa-4258-5aef-a3af-852621145aeb" @@ -23,7 +23,6 @@ TaylorSeries = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea" [compat] julia = "≥ 1.0.0" -Compat = "≥ 2.1.0" Expokit = "≥ 0.2.0" HybridSystems = "≥ 0.3.0" IntervalArithmetic = "≥ 0.15.2" diff --git a/src/ReachSets/ContinuousPost/BFFPS19/reach_blocks.jl b/src/ReachSets/ContinuousPost/BFFPS19/reach_blocks.jl index 7f0059f4..d5649251 100644 --- a/src/ReachSets/ContinuousPost/BFFPS19/reach_blocks.jl +++ b/src/ReachSets/ContinuousPost/BFFPS19/reach_blocks.jl @@ -273,10 +273,10 @@ function reach_blocks!(ϕ::AbstractMatrix{NUM}, end end - _A_mul_B!(ϕpowerk_cache, ϕpowerk, ϕ) + mul!(ϕpowerk_cache, ϕpowerk, ϕ) copyto!(ϕpowerk, ϕpowerk_cache) - k += 1 + k += 1 end return k, skip diff --git a/src/ReachSets/ContinuousPost/BFFPSV18/check_blocks.jl b/src/ReachSets/ContinuousPost/BFFPSV18/check_blocks.jl index c4e85dd7..062a6fbc 100644 --- a/src/ReachSets/ContinuousPost/BFFPSV18/check_blocks.jl +++ b/src/ReachSets/ContinuousPost/BFFPSV18/check_blocks.jl @@ -174,7 +174,7 @@ function check_blocks(ϕ::AbstractMatrix{NUM}, end end - _A_mul_B!(ϕpowerk_cache, ϕpowerk, ϕ) + mul!(ϕpowerk_cache, ϕpowerk, ϕ) copyto!(ϕpowerk, ϕpowerk_cache) k += 1 end diff --git a/src/ReachSets/ContinuousPost/BFFPSV18/reach_blocks.jl b/src/ReachSets/ContinuousPost/BFFPSV18/reach_blocks.jl index c1d1c4da..3cd08e5d 100644 --- a/src/ReachSets/ContinuousPost/BFFPSV18/reach_blocks.jl +++ b/src/ReachSets/ContinuousPost/BFFPSV18/reach_blocks.jl @@ -210,7 +210,7 @@ function reach_blocks!(ϕ::AbstractMatrix{NUM}, end end - _A_mul_B!(ϕpowerk_cache, ϕpowerk, ϕ) + mul!(ϕpowerk_cache, ϕpowerk, ϕ) copyto!(ϕpowerk, ϕpowerk_cache) k += 1 diff --git a/src/ReachSets/ContinuousPost/GLGM06/reach.jl b/src/ReachSets/ContinuousPost/GLGM06/reach.jl index c8421475..2b4d718a 100644 --- a/src/ReachSets/ContinuousPost/GLGM06/reach.jl +++ b/src/ReachSets/ContinuousPost/GLGM06/reach.jl @@ -57,7 +57,7 @@ function reach_inhomog!(X::Vector{ReachSet{Zonotope{Float64}}}, Wk₊ = reduce_order(Wk₊, max_order) - _A_mul_B!(Φ_power_k_cache, Φ_power_k, Φ) + mul!(Φ_power_k_cache, Φ_power_k, Φ) copyto!(Φ_power_k, Φ_power_k_cache) k += 1 end diff --git a/src/ReachSets/ReachSets.jl b/src/ReachSets/ReachSets.jl index 8a504a27..62a9b27f 100644 --- a/src/ReachSets/ReachSets.jl +++ b/src/ReachSets/ReachSets.jl @@ -6,20 +6,13 @@ module ReachSets using ..Utils, ..Properties using LazySets, MathematicalSystems, HybridSystems, Expokit, Optim, - ProgressMeter + LinearAlgebra, SparseArrays, ProgressMeter # fix namespace conflicts with MathematicalSystems -using LazySets: LinearMap +using LazySets: LinearMap, AffineMap, ResetMap using Reachability: info, warn -include("../compat.jl") - -using LazySets.Approximations: symmetric_interval_hull, - decompose, - overapproximate, - box_approximation, - AbstractDirections - +using LazySets.Approximations: AbstractDirections import LazySets.Approximations: project using Reachability: @timing, diff --git a/src/ReachSets/discretize.jl b/src/ReachSets/discretize.jl index ff4a99ad..85948f61 100644 --- a/src/ReachSets/discretize.jl +++ b/src/ReachSets/discretize.jl @@ -138,7 +138,7 @@ A matrix. """ function exp_Aδ(A::AbstractMatrix{Float64}, δ::Float64; exp_method="base") if exp_method == "base" - return expmat(Matrix(A*δ)) + return exp(Matrix(A*δ)) elseif exp_method == "lazy" return SparseMatrixExp(A*δ) elseif exp_method == "pade" @@ -210,7 +210,7 @@ Heidelberg, 2011. function Φ₁(A, δ; exp_method="base") n = size(A, 1) if exp_method == "base" - P = expmat(Matrix(Pmatrix(A, δ, n))) + P = exp(Matrix(Pmatrix(A, δ, n))) Φ₁_Aδ = P[1:n, (n+1):2*n] elseif exp_method == "lazy" @@ -285,7 +285,7 @@ Heidelberg, 2011. function Φ₂(A, δ; exp_method="base") n = size(A, 1) if exp_method == "base" - P = expmat(Matrix(Pmatrix(A, δ, n))) + P = exp(Matrix(Pmatrix(A, δ, n))) Φ₂_Aδ = P[1:n, (2*n+1):3*n] elseif exp_method == "lazy" diff --git a/src/Reachability.jl b/src/Reachability.jl index ebdeec59..e7186af3 100644 --- a/src/Reachability.jl +++ b/src/Reachability.jl @@ -5,13 +5,12 @@ This is the main module and provides interfaces for specifying and solving reach module Reachability using Reexport, RecipesBase, Memento, MathematicalSystems, HybridSystems, - Compat, Suppressor + LinearAlgebra, Suppressor, SparseArrays, Printf + @reexport using LazySets -using LazySets.Approximations: overapproximate +import LazySets: use_precise_ρ +using LazySets: LinearMap, AffineMap, ResetMap -import LazySets.use_precise_ρ -import LazySets: LinearMap, AffineMap, ResetMap - include("logging.jl") include("Options/dictionary.jl") include("Options/validation.jl") diff --git a/src/Utils/Utils.jl b/src/Utils/Utils.jl index b8eea655..73ee95e2 100644 --- a/src/Utils/Utils.jl +++ b/src/Utils/Utils.jl @@ -4,9 +4,12 @@ decompositions and visualization. """ module Utils -using LazySets, MathematicalSystems, HybridSystems +using LazySets, MathematicalSystems, HybridSystems, Printf -include("../compat.jl") +# fix namespace conflicts with MathematicalSystems +using LazySets: LinearMap, AffineMap, ResetMap + +import LinearAlgebra: normalize using Reachability: Options diff --git a/src/compat.jl b/src/compat.jl deleted file mode 100644 index e2379e8f..00000000 --- a/src/compat.jl +++ /dev/null @@ -1,19 +0,0 @@ -#= -This file defines internal functions for compatibility across -different Julia versions. -=# - -using Compat -using Compat: copyto!, axes, argmax -import Compat.String -using Compat.LinearAlgebra -import Compat.LinearAlgebra: norm, checksquare, LAPACKException, - SingularException, × -import Compat.InteractiveUtils.subtypes - -using SparseArrays, Printf -@inline _At_mul_B(A, B) = transpose(A) * B -@inline _A_mul_B!(C, A, B) = mul!(C, A, B) -expmat = exp -export eye - diff --git a/test/runtests.jl b/test/runtests.jl index 3086ec3d..fb1e02a9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,22 +1,8 @@ -#!/usr/bin/env julia -using LazySets, Reachability, MathematicalSystems, - LinearAlgebra, SparseArrays +using Test, LazySets, Reachability, MathematicalSystems, LinearAlgebra, + SparseArrays # fix namespace conflicts with MathematicalSystems -using LazySets: LinearMap - -# common aliases -const CLCCS = ConstrainedLinearControlContinuousSystem -const CLCDS = ConstrainedLinearControlDiscreteSystem -const LCS = LinearContinuousSystem -const LDS = LinearDiscreteSystem - -# compatibility between Julia versions -include("../src/compat.jl") -using Compat.Test - -# Note: CDDLib is only required for v0.6; for v0.7 or later the default Polyhedra -# library is used and CDDLib can be removed from REQUIRE +using LazySets: LinearMap, AffineMap, ResetMap include("Systems/alltests.jl") include("ReachSets/alltests.jl")