/******************************************************** Xpress-BCL C++ Example Problems =============================== file xbexpl1.cxx ```````````````` BCL user guide example. Definition of variables and constraints, variable arrays and SOS, followed by file output, solving and printing of solutions. (c) 2008 Fair Isaac Corporation author: S.Heipcke, Jan. 2000, rev. Mar. 2011 ********************************************************/ #include #include "xprb_cpp.h" using namespace std; using namespace ::dashoptimization; /**************************************************************************/ /* Define the following option to try out a problem formulation using */ /* Special Ordered Sets: */ #undef SOS /**************************************************************************/ #define NJ 4 /* Number of jobs */ #define NT 10 /* Time limit */ /**** DATA ****/ double DUR[] = {3,4,2,2}; /* Durations of jobs */ XPRBvar start[NJ]; /* Start times of jobs */ XPRBvar delta[NJ][NT]; /* Binaries for start times */ XPRBvar z; /* Maximum completion time (makespan) */ XPRBsos set[NJ]; /* Sets regrouping start times for jobs */ void jobsModel(XPRBprob &); /* Basic model formulation */ void jobsModelb(XPRBprob &);/* Model using SOS */ void jobsSolve(XPRBprob &); /* Solving and solution printing */ /*************************************************************************/ void jobsModel(XPRBprob &p) { XPRBexpr le; int j,t; /****VARIABLES****/ /* Create start time variables */ for(j=0;j