- IIRC
fixwill not replace variables with constant because converting it to a constant is an irreversible operation, you cannot set its upper bound or lower bound afterwards. -
SparseAxisArraybehaves like aSparseArray. It is also anAbstractArraysosumshould work as usual, but common index operation of dense array cannot be used (like v[1, :]). You can access all indices viaeachindex(v). It is closer to aDict{Index, Value}whereindexis a N dimensional tuple.
Containers · JuMP gives a clear comparison. - Use
SparseAxisArrayif your variables are really sparse, otherwise usingDenseAxisArraythen fixing variables is more convenient.
If creating variables is not your bottleneck, do not worry about it before profiling. Most solvers will eliminate fixed variables at the presolve step so it will impact the solution time significantly.
2 Likes