Changeset 2429 for trunk


Ignore:
Timestamp:
Nov 21, 2018 7:57:23 AM (7 months ago)
Author:
unxusr
Message:

writeLp in Cbc_C_interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/Cbc_C_Interface.cpp

    r2428 r2429  
    357357    return;
    358358}
     359
     360/* Write an mps file from the given filename */
     361COINLIBAPI void COINLINKAGE
     362Cbc_writeLp(Cbc_Model * model, const char *filename)
     363{
     364    const char prefix[] = "Cbc_C_Interface::Cbc_writeLp(): ";
     365//  const int  VERBOSE = 2;
     366    if (VERBOSE > 0) printf("%s begin\n", prefix);
     367    if (VERBOSE > 1) printf("%s filename = '%s'\n", prefix, filename);
     368
     369    char outFile[512];
     370    strncpy(outFile, filename, 512);
     371
     372    char *s = NULL;
     373    if ((s = strstr(outFile, ".lp"))) {
     374        if (s != outFile) // not at the start
     375            *s = '\0';
     376    }
     377
     378    model->model_->solver()->writeLp(outFile);
     379
     380    if (VERBOSE > 0) printf("%s return\n", prefix);
     381    return;
     382}
     383
     384
    359385/* Read an lp file from the given filename */
    360386COINLIBAPI int COINLINKAGE
Note: See TracChangeset for help on using the changeset viewer.