Skip to content

Commit 36cf5b8

Browse files
committed
use old implementation when available
1 parent b82cbf9 commit 36cf5b8

18 files changed

+56
-22
lines changed

docs/src/lib/sets/DensePolynomialZonotope.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Undocumented implementations:
2424
* [`center`](@ref center(::LazySet))
2525
* [`isoperationtype`](@ref isoperationtype(::Type{LazySet}))
2626
* [`linear_map`](@ref linear_map(::AbstractMatrix, ::LazySet))
27+
* [`scale`](@ref scale(::Real, ::LazySet))
2728
* [`scale!`](@ref scale!(::Real, ::LazySet))
2829

2930
```@meta
@@ -67,7 +68,6 @@ Inherited from [`LazySet`](@ref):
6768
* [`is_interior_point`](@ref is_interior_point(::AbstractVector, ::LazySet))
6869
* [`project`](@ref project(::LazySet, ::AbstractVector{Int}))
6970
* [`sample`](@ref sample(::LazySet, ::Int=1))
70-
* [`scale`](@ref scale(::Real, ::LazySet))
7171
* [`ρ`](@ref ρ(::AbstractVector, ::LazySet))
7272
* [`translate`](@ref translate(::LazySet, ::AbstractVector))
7373
* [`cartesian_product`](@ref cartesian_product(::LazySet, ::LazySet))

docs/src/lib/sets/Hyperrectangle.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ CurrentModule = LazySets.API
6363
```
6464
* [`isoperationtype`](@ref isoperationtype(::Type{LazySet}))
6565
* [`permute`](@ref permute(::LazySet, ::AbstractVector{Int}))
66+
* [`scale`](@ref scale(::Real, ::LazySet))
6667
* [`scale!`](@ref scale!(::Real, ::LazySet))
6768
* [`ρ`](@ref ρ(::AbstractVector, ::LazySet))
6869
* [`σ`](@ref σ(::AbstractVector, ::LazySet))
@@ -92,7 +93,6 @@ Inherited from [`LazySet`](@ref):
9293
* [`exponential_map`](@ref exponential_map(::AbstractMatrix, ::LazySet))
9394
* [`is_interior_point`](@ref is_interior_point(::AbstractVector, ::LazySet))
9495
* [`sample`](@ref sample(::LazySet, ::Int=1))
95-
* [`scale`](@ref scale(::Real, ::LazySet))
9696
* [`convex_hull`](@ref convex_hull(::LazySet, ::LazySet))
9797
* [`exact_sum`](@ref exact_sum(::LazySet, ::LazySet))
9898
* [``](@ref ≈(::LazySet, ::LazySet))

docs/src/lib/sets/LineSegment.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ Undocumented implementations:
107107
* [`dim`](@ref dim(::LazySet))
108108
* [`isoperationtype`](@ref isoperationtype(::Type{LazySet}))
109109
* [`vertices_list`](@ref vertices_list(::LazySet))
110+
* [`scale`](@ref scale(::Real, ::LazySet))
111+
* [`scale!`](@ref scale!(::Real, ::LazySet))
110112
* [`ρ`](@ref ρ(::AbstractVector, ::LazySet))
111113

112114
```@meta
@@ -136,7 +138,6 @@ Inherited from [`LazySet`](@ref):
136138
* [`exponential_map`](@ref exponential_map(::AbstractMatrix, ::LazySet))
137139
* [`is_interior_point`](@ref is_interior_point(::AbstractVector, ::LazySet))
138140
* [`sample`](@ref sample(::LazySet, ::Int))
139-
* [`scale`](@ref scale(::Real, ::LazySet))
140141
* [``](@ref ≈(::LazySet, ::LazySet))
141142
* [`==`](@ref ==(::LazySet, ::LazySet))
142143
* [`isequivalent`](@ref isequivalent(::LazySet, ::LazySet))

docs/src/lib/sets/Singleton.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Undocumented implementations:
6161
* [`linear_map`](@ref linear_map(::AbstractMatrix, ::LazySet))
6262
* [`permute`](@ref permute(::LazySet, ::AbstractVector{Int}))
6363
* [`project`](@ref project(::LazySet, ::AbstractVector{Int}))
64+
* [`scale`](@ref scale(::Real, ::LazySet))
6465
* [`scale!`](@ref scale!(::Real, ::LazySet))
6566

6667
```@meta
@@ -84,7 +85,6 @@ Inherited from [`LazySet`](@ref):
8485
* [`exponential_map`](@ref exponential_map(::AbstractMatrix, ::LazySet))
8586
* [`is_interior_point`](@ref is_interior_point(::AbstractVector, ::LazySet))
8687
* [`sample`](@ref sample(::LazySet))
87-
* [`scale`](@ref scale(::Real, ::LazySet))
8888
* [`translate`](@ref translate(::LazySet, ::AbstractVector))
8989
* [``](@ref ≈(::LazySet, ::LazySet))
9090
* [`==`](@ref ==(::LazySet, ::LazySet))

docs/src/lib/sets/VPolytope.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ Undocumented implementations:
140140
* [`permute`](@ref permute(::LazySet, ::AbstractVector{Int}))
141141
* [`project`](@ref project(::LazySet, ::AbstractVector{Int}))
142142
* [`reflect`](@ref reflect(::LazySet))
143+
* [`scale`](@ref scale(::Real, ::LazySet))
143144
* [`scale!`](@ref scale!(::Real, ::LazySet))
144145
* [`ρ`](@ref ρ(::AbstractVector, ::LazySet))
145146
* [`translate`](@ref translate(::LazySet, ::AbstractVector))
@@ -173,7 +174,6 @@ Inherited from [`LazySet`](@ref):
173174
* [`exponential_map`](@ref exponential_map(::AbstractMatrix, ::LazySet))
174175
* [`is_interior_point`](@ref is_interior_point(::AbstractVector, ::LazySet))
175176
* [`sample`](@ref sample(::LazySet, ::Int=1))
176-
* [`scale`](@ref scale(::Real, ::LazySet))
177177
* [`exact_sum`](@ref exact_sum(::LazySet, ::LazySet))
178178
* [``](@ref ≈(::LazySet, ::LazySet))
179179
* [`==`](@ref ==(::LazySet, ::LazySet))

docs/src/lib/sets/Zonotope.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ CurrentModule = LazySets.API
8888
CurrentModule = LazySets
8989
```
9090
* [`reduce_order`](@ref reduce_order(::AbstractZonotope, ::Real, ::AbstractReductionMethod=GIR05()))
91+
```@meta
92+
CurrentModule = LazySets.API
93+
```
94+
* [`scale`](@ref scale(::Real, ::LazySet))
95+
```@meta
96+
CurrentModule = LazySets
97+
```
9198
* [`split`](@ref split(::AbstractZonotope, ::Int))
9299
* [`split`](@ref split(::AbstractZonotope, ::AbstractVector{Int}, ::AbstractVector{Int}))
93100
```@meta
@@ -123,7 +130,6 @@ Inherited from [`LazySet`](@ref):
123130
* [`exponential_map`](@ref exponential_map(::AbstractMatrix, ::LazySet))
124131
* [`is_interior_point`](@ref is_interior_point(::AbstractVector, ::LazySet))
125132
* [`sample`](@ref sample(::LazySet, ::Int=1))
126-
* [`scale`](@ref scale(::Real, ::LazySet))
127133
* [`translate`](@ref translate(::LazySet, ::AbstractVector))
128134
* [`convex_hull`](@ref convex_hull(::LazySet, ::LazySet))
129135
* [`exact_sum`](@ref exact_sum(::LazySet, ::LazySet))

src/Sets/DensePolynomialZonotope/DensePolynomialZonotopeModule.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ module DensePolynomialZonotopeModule
22

33
using Reexport
44

5-
using ..LazySets: AbstractPolynomialZonotope
5+
using ..LazySets: AbstractPolynomialZonotope, _scale_copy_inplace
66

7-
@reexport import ..API: center, isoperationtype, linear_map, scale!
7+
@reexport import ..API: center, isoperationtype, linear_map, scale, scale!
88
@reexport import ..LazySets: ngens_dep, ngens_indep, polynomial_order
99
@reexport using ..API
1010

src/Sets/DensePolynomialZonotope/scale.jl

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
function scale::Real, P::DensePolynomialZonotope)
2+
return _scale_copy_inplace(α, P)
3+
end
4+
15
function scale!::Real, P::DensePolynomialZonotope)
26
P.c .*= α
37
P.E .*= α

src/Sets/Hyperrectangle/HyperrectangleModule.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ module HyperrectangleModule
22

33
using Reexport, Requires
44

5-
using ..LazySets: AbstractHyperrectangle, _ρ_sev_hyperrectangle,
6-
_σ_sev_hyperrectangle
5+
using ..LazySets: AbstractHyperrectangle, _scale_copy_inplace,
6+
_ρ_sev_hyperrectangle, _σ_sev_hyperrectangle
77
using Random: AbstractRNG, GLOBAL_RNG
88
using ReachabilityBase.Arrays: SingleEntryVector
99
using ReachabilityBase.Comparison: isapproxzero
1010
using ReachabilityBase.Distribution: reseed!
1111
using SparseArrays: SparseVector, findnz, sparse
1212

13-
@reexport import ..API: center, isoperationtype, rand, permute, scale!, ρ, σ,
14-
translate, translate!
13+
@reexport import ..API: center, isoperationtype, rand, permute, scale, scale!,
14+
ρ, σ, translate, translate!
1515
@reexport import ..LazySets: genmat, radius_hyperrectangle, □
1616
import ..LazySets: _genmat_static
1717
import Base: convert

src/Sets/Hyperrectangle/scale.jl

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
function scale::Real, H::Hyperrectangle)
2+
return _scale_copy_inplace(α, H)
3+
end
4+
15
function scale!::Real, H::Hyperrectangle)
26
H.center .*= α
37
H.radius .*= abs(α)

src/Sets/LineSegment/LineSegmentModule.jl

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ module LineSegmentModule
22

33
using Reexport, Requires
44

5-
using ..LazySets: AbstractZonotope, right_turn, _witness_result_empty
5+
using ..LazySets: AbstractZonotope, right_turn, _scale_copy_inplace,
6+
_witness_result_empty
67
using LinearAlgebra: dot
78
using Random: AbstractRNG, GLOBAL_RNG
89
using ReachabilityBase.Comparison: _isapprox, isapproxzero, _leq
@@ -11,8 +12,8 @@ using ReachabilityBase.Iteration: EmptyIterator, SingletonIterator
1112
using ReachabilityBase.Require: require
1213

1314
@reexport import ..API: an_element, center, constraints_list, dim,
14-
isoperationtype, rand, vertices_list, , scale!, ρ, σ,
15-
translate, intersection, isdisjoint
15+
isoperationtype, rand, vertices_list, , scale, scale!,
16+
ρ, σ, translate, intersection, isdisjoint
1617
@reexport import ..LazySets: generators, genmat, ngens, halfspace_left,
1718
halfspace_right
1819
@reexport using ..API

src/Sets/LineSegment/scale.jl

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
function scale::Real, L::LineSegment)
2+
return _scale_copy_inplace(α, L)
3+
end
4+
15
function scale!::Real, L::LineSegment)
26
L.p .*= α
37
L.q .*= α

src/Sets/Singleton/SingletonModule.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ module SingletonModule
22

33
using Reexport
44

5-
using ..LazySets: AbstractSingleton
5+
using ..LazySets: AbstractSingleton, _scale_copy_inplace
66
using Random: AbstractRNG, GLOBAL_RNG
77
using ReachabilityBase.Distribution: reseed!
88

99
@reexport import ..API: isoperationtype, rand, rectify, linear_map, permute,
10-
project, scale!, translate!
10+
project, scale, scale!, translate!
1111
@reexport import ..LazySets: element, singleton_list
1212
@reexport using ..API
1313

src/Sets/Singleton/scale.jl

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
function scale::Real, S::Singleton)
2+
return _scale_copy_inplace(α, S)
3+
end
4+
15
function scale!::Real, S::Singleton)
26
S.element .*= α
37
return S

src/Sets/VPolytope/VPolytopeModule.jl

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ using Reexport, Requires
55
using ..LazySets: AbstractPolytope, LazySet, LinearMapVRep, default_lp_solver,
66
default_lp_solver_polyhedra, default_polyhedra_backend,
77
is_lp_infeasible, is_lp_optimal, linprog, _extrema_vlist,
8-
_high_vlist, _low_vlist, _minkowski_sum_vrep_nd
8+
_high_vlist, _low_vlist, _minkowski_sum_vrep_nd,
9+
_scale_copy_inplace
910
using LinearAlgebra: dot
1011
using Random: AbstractRNG, GLOBAL_RNG
1112
using ReachabilityBase.Arrays: projection_matrix
@@ -15,8 +16,9 @@ using ReachabilityBase.Require: require
1516

1617
@reexport import ..API: constraints_list, dim, extrema, high, isoperationtype,
1718
low, rand, reflect, vertices_list, , linear_map,
18-
permute, project, scale!, ρ, σ, translate, translate!,
19-
cartesian_product, convex_hull, minkowski_sum
19+
permute, project, scale, scale!, ρ, σ, translate,
20+
translate!, cartesian_product, convex_hull,
21+
minkowski_sum
2022
@reexport import ..LazySets: remove_redundant_vertices, tohrep, tovrep
2123
import ..LazySets: _linear_map_vrep
2224
import Base: convert

src/Sets/VPolytope/scale.jl

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
function scale::Real, P::VPolytope)
2+
return _scale_copy_inplace(α, P)
3+
end
4+
15
function scale!::Real, P::VPolytope)
26
P.vertices .*= α
37
return P

src/Sets/Zonotope/ZonotopeModule.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module ZonotopeModule
22

33
using Reexport, Requires
44

5-
using ..LazySets: AbstractZonotope, generators_fallback
5+
using ..LazySets: AbstractZonotope, generators_fallback, _scale_copy_inplace
66
using LinearAlgebra: mul!
77
using Random: AbstractRNG, GLOBAL_RNG
88
using ReachabilityBase.Arrays: ismultiple, remove_zero_columns, to_matrix,
@@ -11,7 +11,7 @@ using ReachabilityBase.Distribution: reseed!
1111
using ReachabilityBase.Require: require
1212

1313
@reexport import ..API: center, high, isoperationtype, low, rand,
14-
permute, scale!, translate!
14+
permute, scale, scale!, translate!
1515
@reexport import ..LazySets: generators, genmat, ngens, reduce_order,
1616
remove_redundant_generators, togrep
1717
import Base: convert

src/Sets/Zonotope/scale.jl

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
function scale::Real, Z::Zonotope)
2+
return _scale_copy_inplace(α, Z)
3+
end
4+
15
"""
26
# Extended help
37

0 commit comments

Comments
 (0)