Skip to content

Commit

Permalink
use old implementation when available
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Jan 4, 2025
1 parent b82cbf9 commit 36cf5b8
Show file tree
Hide file tree
Showing 18 changed files with 56 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/src/lib/sets/DensePolynomialZonotope.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Undocumented implementations:
* [`center`](@ref center(::LazySet))
* [`isoperationtype`](@ref isoperationtype(::Type{LazySet}))
* [`linear_map`](@ref linear_map(::AbstractMatrix, ::LazySet))
* [`scale`](@ref scale(::Real, ::LazySet))
* [`scale!`](@ref scale!(::Real, ::LazySet))

```@meta
Expand Down Expand Up @@ -67,7 +68,6 @@ Inherited from [`LazySet`](@ref):
* [`is_interior_point`](@ref is_interior_point(::AbstractVector, ::LazySet))
* [`project`](@ref project(::LazySet, ::AbstractVector{Int}))
* [`sample`](@ref sample(::LazySet, ::Int=1))
* [`scale`](@ref scale(::Real, ::LazySet))
* [`ρ`](@ref ρ(::AbstractVector, ::LazySet))
* [`translate`](@ref translate(::LazySet, ::AbstractVector))
* [`cartesian_product`](@ref cartesian_product(::LazySet, ::LazySet))
Expand Down
2 changes: 1 addition & 1 deletion docs/src/lib/sets/Hyperrectangle.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ CurrentModule = LazySets.API
```
* [`isoperationtype`](@ref isoperationtype(::Type{LazySet}))
* [`permute`](@ref permute(::LazySet, ::AbstractVector{Int}))
* [`scale`](@ref scale(::Real, ::LazySet))
* [`scale!`](@ref scale!(::Real, ::LazySet))
* [`ρ`](@ref ρ(::AbstractVector, ::LazySet))
* [`σ`](@ref σ(::AbstractVector, ::LazySet))
Expand Down Expand Up @@ -92,7 +93,6 @@ Inherited from [`LazySet`](@ref):
* [`exponential_map`](@ref exponential_map(::AbstractMatrix, ::LazySet))
* [`is_interior_point`](@ref is_interior_point(::AbstractVector, ::LazySet))
* [`sample`](@ref sample(::LazySet, ::Int=1))
* [`scale`](@ref scale(::Real, ::LazySet))
* [`convex_hull`](@ref convex_hull(::LazySet, ::LazySet))
* [`exact_sum`](@ref exact_sum(::LazySet, ::LazySet))
* [``](@ref ≈(::LazySet, ::LazySet))
Expand Down
3 changes: 2 additions & 1 deletion docs/src/lib/sets/LineSegment.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ Undocumented implementations:
* [`dim`](@ref dim(::LazySet))
* [`isoperationtype`](@ref isoperationtype(::Type{LazySet}))
* [`vertices_list`](@ref vertices_list(::LazySet))
* [`scale`](@ref scale(::Real, ::LazySet))
* [`scale!`](@ref scale!(::Real, ::LazySet))
* [`ρ`](@ref ρ(::AbstractVector, ::LazySet))

```@meta
Expand Down Expand Up @@ -136,7 +138,6 @@ Inherited from [`LazySet`](@ref):
* [`exponential_map`](@ref exponential_map(::AbstractMatrix, ::LazySet))
* [`is_interior_point`](@ref is_interior_point(::AbstractVector, ::LazySet))
* [`sample`](@ref sample(::LazySet, ::Int))
* [`scale`](@ref scale(::Real, ::LazySet))
* [``](@ref ≈(::LazySet, ::LazySet))
* [`==`](@ref ==(::LazySet, ::LazySet))
* [`isequivalent`](@ref isequivalent(::LazySet, ::LazySet))
Expand Down
2 changes: 1 addition & 1 deletion docs/src/lib/sets/Singleton.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Undocumented implementations:
* [`linear_map`](@ref linear_map(::AbstractMatrix, ::LazySet))
* [`permute`](@ref permute(::LazySet, ::AbstractVector{Int}))
* [`project`](@ref project(::LazySet, ::AbstractVector{Int}))
* [`scale`](@ref scale(::Real, ::LazySet))
* [`scale!`](@ref scale!(::Real, ::LazySet))

```@meta
Expand All @@ -84,7 +85,6 @@ Inherited from [`LazySet`](@ref):
* [`exponential_map`](@ref exponential_map(::AbstractMatrix, ::LazySet))
* [`is_interior_point`](@ref is_interior_point(::AbstractVector, ::LazySet))
* [`sample`](@ref sample(::LazySet))
* [`scale`](@ref scale(::Real, ::LazySet))
* [`translate`](@ref translate(::LazySet, ::AbstractVector))
* [``](@ref ≈(::LazySet, ::LazySet))
* [`==`](@ref ==(::LazySet, ::LazySet))
Expand Down
2 changes: 1 addition & 1 deletion docs/src/lib/sets/VPolytope.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ Undocumented implementations:
* [`permute`](@ref permute(::LazySet, ::AbstractVector{Int}))
* [`project`](@ref project(::LazySet, ::AbstractVector{Int}))
* [`reflect`](@ref reflect(::LazySet))
* [`scale`](@ref scale(::Real, ::LazySet))
* [`scale!`](@ref scale!(::Real, ::LazySet))
* [`ρ`](@ref ρ(::AbstractVector, ::LazySet))
* [`translate`](@ref translate(::LazySet, ::AbstractVector))
Expand Down Expand Up @@ -173,7 +174,6 @@ Inherited from [`LazySet`](@ref):
* [`exponential_map`](@ref exponential_map(::AbstractMatrix, ::LazySet))
* [`is_interior_point`](@ref is_interior_point(::AbstractVector, ::LazySet))
* [`sample`](@ref sample(::LazySet, ::Int=1))
* [`scale`](@ref scale(::Real, ::LazySet))
* [`exact_sum`](@ref exact_sum(::LazySet, ::LazySet))
* [``](@ref ≈(::LazySet, ::LazySet))
* [`==`](@ref ==(::LazySet, ::LazySet))
Expand Down
8 changes: 7 additions & 1 deletion docs/src/lib/sets/Zonotope.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ CurrentModule = LazySets.API
CurrentModule = LazySets
```
* [`reduce_order`](@ref reduce_order(::AbstractZonotope, ::Real, ::AbstractReductionMethod=GIR05()))
```@meta
CurrentModule = LazySets.API
```
* [`scale`](@ref scale(::Real, ::LazySet))
```@meta
CurrentModule = LazySets
```
* [`split`](@ref split(::AbstractZonotope, ::Int))
* [`split`](@ref split(::AbstractZonotope, ::AbstractVector{Int}, ::AbstractVector{Int}))
```@meta
Expand Down Expand Up @@ -123,7 +130,6 @@ Inherited from [`LazySet`](@ref):
* [`exponential_map`](@ref exponential_map(::AbstractMatrix, ::LazySet))
* [`is_interior_point`](@ref is_interior_point(::AbstractVector, ::LazySet))
* [`sample`](@ref sample(::LazySet, ::Int=1))
* [`scale`](@ref scale(::Real, ::LazySet))
* [`translate`](@ref translate(::LazySet, ::AbstractVector))
* [`convex_hull`](@ref convex_hull(::LazySet, ::LazySet))
* [`exact_sum`](@ref exact_sum(::LazySet, ::LazySet))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module DensePolynomialZonotopeModule

using Reexport

using ..LazySets: AbstractPolynomialZonotope
using ..LazySets: AbstractPolynomialZonotope, _scale_copy_inplace

@reexport import ..API: center, isoperationtype, linear_map, scale!
@reexport import ..API: center, isoperationtype, linear_map, scale, scale!
@reexport import ..LazySets: ngens_dep, ngens_indep, polynomial_order
@reexport using ..API

Expand Down
4 changes: 4 additions & 0 deletions src/Sets/DensePolynomialZonotope/scale.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
function scale::Real, P::DensePolynomialZonotope)
return _scale_copy_inplace(α, P)
end

function scale!::Real, P::DensePolynomialZonotope)
P.c .*= α
P.E .*= α
Expand Down
8 changes: 4 additions & 4 deletions src/Sets/Hyperrectangle/HyperrectangleModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ module HyperrectangleModule

using Reexport, Requires

using ..LazySets: AbstractHyperrectangle, _ρ_sev_hyperrectangle,
_σ_sev_hyperrectangle
using ..LazySets: AbstractHyperrectangle, _scale_copy_inplace,
_ρ_sev_hyperrectangle, _σ_sev_hyperrectangle
using Random: AbstractRNG, GLOBAL_RNG
using ReachabilityBase.Arrays: SingleEntryVector
using ReachabilityBase.Comparison: isapproxzero
using ReachabilityBase.Distribution: reseed!
using SparseArrays: SparseVector, findnz, sparse

@reexport import ..API: center, isoperationtype, rand, permute, scale!, ρ, σ,
translate, translate!
@reexport import ..API: center, isoperationtype, rand, permute, scale, scale!,
ρ, σ, translate, translate!
@reexport import ..LazySets: genmat, radius_hyperrectangle, □
import ..LazySets: _genmat_static
import Base: convert
Expand Down
4 changes: 4 additions & 0 deletions src/Sets/Hyperrectangle/scale.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
function scale::Real, H::Hyperrectangle)
return _scale_copy_inplace(α, H)
end

function scale!::Real, H::Hyperrectangle)
H.center .*= α
H.radius .*= abs(α)
Expand Down
7 changes: 4 additions & 3 deletions src/Sets/LineSegment/LineSegmentModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ module LineSegmentModule

using Reexport, Requires

using ..LazySets: AbstractZonotope, right_turn, _witness_result_empty
using ..LazySets: AbstractZonotope, right_turn, _scale_copy_inplace,
_witness_result_empty
using LinearAlgebra: dot
using Random: AbstractRNG, GLOBAL_RNG
using ReachabilityBase.Comparison: _isapprox, isapproxzero, _leq
Expand All @@ -11,8 +12,8 @@ using ReachabilityBase.Iteration: EmptyIterator, SingletonIterator
using ReachabilityBase.Require: require

@reexport import ..API: an_element, center, constraints_list, dim,
isoperationtype, rand, vertices_list, , scale!, ρ, σ,
translate, intersection, isdisjoint
isoperationtype, rand, vertices_list, , scale, scale!,
ρ, σ, translate, intersection, isdisjoint
@reexport import ..LazySets: generators, genmat, ngens, halfspace_left,
halfspace_right
@reexport using ..API
Expand Down
4 changes: 4 additions & 0 deletions src/Sets/LineSegment/scale.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
function scale::Real, L::LineSegment)
return _scale_copy_inplace(α, L)
end

function scale!::Real, L::LineSegment)
L.p .*= α
L.q .*= α
Expand Down
4 changes: 2 additions & 2 deletions src/Sets/Singleton/SingletonModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ module SingletonModule

using Reexport

using ..LazySets: AbstractSingleton
using ..LazySets: AbstractSingleton, _scale_copy_inplace
using Random: AbstractRNG, GLOBAL_RNG
using ReachabilityBase.Distribution: reseed!

@reexport import ..API: isoperationtype, rand, rectify, linear_map, permute,
project, scale!, translate!
project, scale, scale!, translate!
@reexport import ..LazySets: element, singleton_list
@reexport using ..API

Expand Down
4 changes: 4 additions & 0 deletions src/Sets/Singleton/scale.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
function scale::Real, S::Singleton)
return _scale_copy_inplace(α, S)
end

function scale!::Real, S::Singleton)
S.element .*= α
return S
Expand Down
8 changes: 5 additions & 3 deletions src/Sets/VPolytope/VPolytopeModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ using Reexport, Requires
using ..LazySets: AbstractPolytope, LazySet, LinearMapVRep, default_lp_solver,
default_lp_solver_polyhedra, default_polyhedra_backend,
is_lp_infeasible, is_lp_optimal, linprog, _extrema_vlist,
_high_vlist, _low_vlist, _minkowski_sum_vrep_nd
_high_vlist, _low_vlist, _minkowski_sum_vrep_nd,
_scale_copy_inplace
using LinearAlgebra: dot
using Random: AbstractRNG, GLOBAL_RNG
using ReachabilityBase.Arrays: projection_matrix
Expand All @@ -15,8 +16,9 @@ using ReachabilityBase.Require: require

@reexport import ..API: constraints_list, dim, extrema, high, isoperationtype,
low, rand, reflect, vertices_list, , linear_map,
permute, project, scale!, ρ, σ, translate, translate!,
cartesian_product, convex_hull, minkowski_sum
permute, project, scale, scale!, ρ, σ, translate,
translate!, cartesian_product, convex_hull,
minkowski_sum
@reexport import ..LazySets: remove_redundant_vertices, tohrep, tovrep
import ..LazySets: _linear_map_vrep
import Base: convert
Expand Down
4 changes: 4 additions & 0 deletions src/Sets/VPolytope/scale.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
function scale::Real, P::VPolytope)
return _scale_copy_inplace(α, P)
end

function scale!::Real, P::VPolytope)
P.vertices .*= α
return P
Expand Down
4 changes: 2 additions & 2 deletions src/Sets/Zonotope/ZonotopeModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module ZonotopeModule

using Reexport, Requires

using ..LazySets: AbstractZonotope, generators_fallback
using ..LazySets: AbstractZonotope, generators_fallback, _scale_copy_inplace
using LinearAlgebra: mul!
using Random: AbstractRNG, GLOBAL_RNG
using ReachabilityBase.Arrays: ismultiple, remove_zero_columns, to_matrix,
Expand All @@ -11,7 +11,7 @@ using ReachabilityBase.Distribution: reseed!
using ReachabilityBase.Require: require

@reexport import ..API: center, high, isoperationtype, low, rand,
permute, scale!, translate!
permute, scale, scale!, translate!
@reexport import ..LazySets: generators, genmat, ngens, reduce_order,
remove_redundant_generators, togrep
import Base: convert
Expand Down
4 changes: 4 additions & 0 deletions src/Sets/Zonotope/scale.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
function scale::Real, Z::Zonotope)
return _scale_copy_inplace(α, Z)
end

"""
# Extended help
Expand Down

0 comments on commit 36cf5b8

Please sign in to comment.