exanauts / ExaModels.jl

An algebraic modeling and automatic differentiation tool in Julia Language, specialized for SIMD abstraction of nonlinear programs.
MIT License
53 stars 4 forks source link

Unsafe use of MOI #100

Open mlubin opened 3 months ago

mlubin commented 3 months ago

The code below is accessing fields in a way that assumes jm_cache is a MOI.Utilities.UniversalFallback. This doesn't match the type of the argument (MOI.ModelLike) and could break in multiple ways. You should use the MOI API instead to query properties like variable bounds and starts.

https://github.com/exanauts/ExaModels.jl/blob/0ac40c25602229ecf8c65f5cf1ae70a13f1348bd/ext/ExaModelsMOI.jl#L58C10-L78

CC @blegat