Skip to content

Commit 1de0d94

Browse files
committed
change default implementation of 'scale'
1 parent 66caa49 commit 1de0d94

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Interfaces/LazySet.jl

+10-1
Original file line numberDiff line numberDiff line change
@@ -1545,16 +1545,25 @@ function linear_map(M::AbstractMatrix, P::LazySet; kwargs...)
15451545
end
15461546
end
15471547

1548+
function linear_map(αI::UniformScaling, X::LazySet)
1549+
M = Diagonal(fill(αI.λ, dim(X)))
1550+
return linear_map(M, X)
1551+
end
1552+
15481553
"""
15491554
# Extended help
15501555
15511556
scale(α::Real, X::LazySet)
15521557
15531558
### Algorithm
15541559
1555-
The default implementation calls `scale!` on a copy of `X`.
1560+
The default implementation computes `linear_map` with the diagonal matrix ``α*I``.
15561561
"""
15571562
function scale::Real, X::LazySet)
1563+
return linear_map*I, X)
1564+
end
1565+
1566+
function _scale_copy_inplace::Real, X::LazySet)
15581567
Y = copy(X)
15591568
scale!(α, Y)
15601569
return Y

0 commit comments

Comments
 (0)