alpar@1: /* mplsamp1.c */ alpar@1: alpar@1: #include alpar@1: #include alpar@1: #include alpar@1: alpar@1: int main(void) alpar@1: { glp_prob *lp; alpar@1: glp_tran *tran; alpar@1: int ret; alpar@1: lp = glp_create_prob(); alpar@1: tran = glp_mpl_alloc_wksp(); alpar@1: ret = glp_mpl_read_model(tran, "egypt.mod", 0); alpar@1: if (ret != 0) alpar@1: { fprintf(stderr, "Error on translating model\n"); alpar@1: goto skip; alpar@1: } alpar@1: ret = glp_mpl_generate(tran, NULL); alpar@1: if (ret != 0) alpar@1: { fprintf(stderr, "Error on generating model\n"); alpar@1: goto skip; alpar@1: } alpar@1: glp_mpl_build_prob(tran, lp); alpar@1: ret = glp_write_mps(lp, GLP_MPS_FILE, NULL, "egypt.mps"); alpar@1: if (ret != 0) alpar@1: fprintf(stderr, "Error on writing MPS file\n"); alpar@1: skip: glp_mpl_free_wksp(tran); alpar@1: glp_delete_prob(lp); alpar@1: return 0; alpar@1: } alpar@1: alpar@1: /* eof */