Forum Discussion
FICO
2 years agoCommunity Manager
hey hii i have to make a variable of type set nonfinal how can i do that i am using option noautofinal but that we make all the variables non final globally so is there any way just to make that parti
please answer as soon as possible as its urgent
1 Reply
- FICOCommunity Manager
Based on the observation that many sets and array dimensions remain unchanged once they have been initialized, Mosel applies 'automatic finalization' to arrays declared of dense type (that is, without a 'dynamic' or 'hashmap' marker) and to sets that are not explicitly marked as 'dynamic', in order to turn them into static structures that are handled more efficiently.
However, automatic finalization may not be desired in all cases, and there are various ways how to disable it.
- General setting for the whole model (not recommended):
model "my model name" options noautofinal ...- For an individual 'initializations from' block:
declarations MYARRAY: array(R:range) of real ! Dense array with variable index set end-declarations setparam("autofinal", false) ! Disable automatic finalization initializations from "datafile.dat" MYARRAY end-initializations setparam("autofinal", true) ! Re-enable automatic finalization- For individual arrays or sets:
declarations S: dynamic set of integer A: dynamic array(R:range) of real B: hashmap array(R) of real end-declarationsWith earlier versions of Mosel, the explicit use of a 'dynamic' marker for arrays was not required, starting with version 5 of Mosel (Xpress Rel8.6, 2019) it is necessary to specify explicitly the 'dynamic' or 'hashmap' marker in order to make sure that an array is treated as a sparse array and as such not impacted by automatic finalization.
Related Content
Related Content
Variable names in callback (Java API)
I construct a cut in a preintsol callback using variables from the model containing the callback. When constructing the model, I give the variables names (using withName(...)) and store them in a vec...9 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum4 unread comments4 unread1View0likes4CommentsVariable object mapping issue in Python Callbacks with Presolve enabled
Hi, I am implementing a Branch-and-Cut algorithm using the Xpress Python interface. I have structured my code as a class where I create variables (using xp.var) and store them in a dictionary attrib...9 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum6 unread comments6 unread6Views0likes6Commentsxpress variable type
Hi, I set vartype=xp.binary when I create the xpress variables, but some of the results have values such as 0.13333, 0.36667, 0.5. I found that this was caused by one of the constraints. When I disa...6 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum1 unread comment1 unread0Views0likes1Comment