/******************************************************** Mosel Library Example Problems ============================== file foliomat.c ``````````````` Exporting a matrix. (c) 2008 Fair Isaac Corporation author: S.Heipcke, Aug. 2003 ********************************************************/ #include #include "xprm_mc.h" int main(int argc, char *argv[]) { int result, type; XPRMmodel model; XPRMalltypes rvalue; XPRMlinctr obj; XPRMinit(); /* Initialize Mosel */ /* Execute = compile/load/run a model */ XPRMexecmod(NULL, "foliodata.mos", NULL, &result, &model); /* Retrieve a model object by its name */ type = XPRMfindident(model, "Return", &rvalue); if((XPRM_TYP(type)!=XPRM_TYP_LINCTR)|| /* Check the type: */ (XPRM_STR(type)!=XPRM_STR_REF)) /* it must be a reference to a linear constraint */ return 1; obj = rvalue.linctr; /* Store the objective function reference */ XPRMexportprob(model, "p", "folio", obj); return 0; }