-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matrix Multiplication of Intervals Raises Error #693
Comments
Thank you for reporting this issue :). I cannot reproduce it on the latest version of IntervalArithmetic ; are you sure you are using v0.22.21? |
I tried this and it didn't work either:
No I am using "0.21.2" through LazySets and they have a restriction on the version :/// :
|
For now I will commit a little type piracy
but this should be resolved in a better way in the future. |
Your When using julia> using IntervalArithmetic
julia> bnds = [interval(-1., 1.); interval(-1., 1.)]
2-element Vector{Interval{Float64}}:
[-1.0, 1.0]
[-1.0, 1.0]
julia> [0. 1.] * bnds
1-element Vector{Interval{Float64}}:
[-1.0, 1.0] |
Also note that Generally, consider using https://github.com/JuliaReach/IntervalMatrices.jl for calculations with interval matrices. |
Thanks @schillic for clarifying this. I close this issue then; if anything comes up, feel free to re-open it or open a new one. |
@schillic Is the LazySets.Interval not a wrapper of IntervalArithmetic.Interval? |
Yes it is, but it does not act like a julia> @which [0. 1.] * bnds # IntervalArithmetic.Interval; note the `S<:Real` for the eltype of `bnds`
*(A::Union{LinearAlgebra.Adjoint{<:Any, <:StridedMatrix{T}}, LinearAlgebra.Transpose{<:Any, <:StridedMatrix{T}}, StridedMatrix{T}}, x::StridedVector{S}) where {T<:Union{Float32, Float64, ComplexF64, ComplexF32}, S<:Real}
@ LinearAlgebra .../share/julia/stdlib/v1.11/LinearAlgebra/src/matmul.jl:53
julia> @which [0. 1.] * bnds # LazySets.Interval
*(A::AbstractMatrix{T}, x::AbstractVector{S}) where {T, S}
@ LinearAlgebra .../share/julia/stdlib/v1.11/LinearAlgebra/src/matmul.jl:58 But that is actually not the issue here. Both methods would yield the same error. The issue is that the generic matrix-vector multiplication tries to initialize the solution vector, which requires the zero element of addition. Hence the call to More generally, |
And if I try to assert the shapes (should be correct before anyway, 1x2 * 2x1) I still get an error:
I feel like this is basic functionality that should work, no?
The text was updated successfully, but these errors were encountered: