diff --git a/src/concrete_intersection.jl b/src/concrete_intersection.jl index e5402ac99d..210c0e518b 100644 --- a/src/concrete_intersection.jl +++ b/src/concrete_intersection.jl @@ -806,8 +806,8 @@ function intersection(X::CartesianProductArray{N}, oa=Hyperrectangle) where {N} low_set, vars, block_structure = initialize_vars(X, blocks) - - low_intersection = intersection(low_set, Approximations.project(Y, vars, LinearMap)) + + low_intersection = intersection(low_set, Approximations.project(Y, vars)) if isempty(low_intersection) return EmptySet() diff --git a/src/helper_functions.jl b/src/helper_functions.jl index 0ef8ec7761..eacd4be7a1 100644 --- a/src/helper_functions.jl +++ b/src/helper_functions.jl @@ -4,8 +4,8 @@ export _At_mul_B const DEFAULT_COND_TOL = 1e6 # matrix-matrix multiplication and division -@inline _At_mul_B(A, B) = transpose(Matrix(A)) * B -@inline _At_ldiv_B(A, B) = transpose(Matrix(A)) \ B +@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} @@ -159,13 +159,13 @@ We check whether the matrix is square and whether the `cond(M)` is below some prescribed tolerance. """ function isinvertible(M::Matrix; cond_tol::Number=DEFAULT_COND_TOL) - return cond(M) < cond_tol + return issquare(M) && cond(M) < cond_tol end # cond is not available for sparse matrices; see JuliaLang#6485 and related issues function isinvertible(M::AbstractSparseMatrix; cond_tol::Number=DEFAULT_COND_TOL) - return isinvertible(Matrix(M), cond_tol=cond_tol) + return issquare(M) && isinvertible(Matrix(M), cond_tol=cond_tol) end function isinvertible(M::Diagonal; cond_tol=nothing) @@ -542,9 +542,9 @@ julia> subtypes(AbstractPolytope, true) function subtypes(interface, concrete::Bool) subtypes_to_test = subtypes(interface) - + # do not seek the concrete subtypes further - if !concrete + if !concrete return sort(subtypes_to_test, by=string) end diff --git a/test/unit_CartesianProduct.jl b/test/unit_CartesianProduct.jl index e14b6a026c..988b2f2475 100644 --- a/test/unit_CartesianProduct.jl +++ b/test/unit_CartesianProduct.jl @@ -279,7 +279,6 @@ end for N in [Float64, Float32] #intersection and is_intersection_empty - intersection and is_intersection_empty i1 = Interval(N[0, 1]) i2 = Interval(N[2, 3]) h1 = Hyperrectangle(low=N[3, 4], high=N[5, 7])