Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的问题很简单。我正在使用来自 Julia 的 JuMP,我想通过分离动态地向模型添加约束,并且我希望它们都属于同一个 @constraintref。问题是我不知道我最终会添加多少约束。有没有一种推!或附加功能以将约束添加到同一个参考?
如果您需要扩展集合,只需创建自己的数组(例如,ConstraintRef[])并将push!其添加到它而不是使用@constraintref.
ConstraintRef[]
push!
@constraintref