Changeset 2441


Ignore:
Timestamp:
Apr 5, 2019 2:39:14 AM (7 weeks ago)
Author:
stefan
Message:

add Clp_writeMps, Clp_setRowName, Clp_setColumnName from patch provided by @framlingham in #101

Location:
trunk/Clp/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/Clp_C_Interface.cpp

    r2385 r2441  
    264264    collb, colub, obj, rowlb, rowub);
    265265}
     266
    266267/* read quadratic part of the objective (the matrix part) */
    267268COINLIBAPI void COINLINKAGE
     
    283284{
    284285  return model->model_->readMps(filename, keepNames != 0, ignoreErrors != 0);
     286}
     287/* Write an MPS file to the given filename */
     288COINLIBAPI int COINLINKAGE
     289Clp_writeMps(Clp_Simplex *model, const char *filename,
     290  int formatType,
     291  int numberAcross,
     292  double objSense)
     293{
     294  return model->model_->writeMps(filename, formatType, numberAcross, objSense);
    285295}
    286296/* Copy in integer informations */
     
    772782  std::string columnName = model->model_->columnName(iColumn);
    773783  strcpy(name, columnName.c_str());
     784}
     785
     786/** Set row name - Nice if they are short - 8 chars or less I think */
     787COINLIBAPI void COINLINKAGE Clp_setRowName(Clp_Simplex *model, int iRow, char *name)
     788{
     789  std::string sName = name; // Copies the memory AFAIK
     790  model->model_->setRowName(iRow, sName);
     791}
     792/** Set column name - Nice if they are short - 8 chars or less I think */
     793COINLIBAPI void COINLINKAGE Clp_setColumnName(Clp_Simplex *model, int iColumn, char *name)
     794{
     795  std::string sName = name; // Copies the memory AFAIK
     796  model->model_->setColumnName(iColumn, sName);
    774797}
    775798
  • trunk/Clp/src/Clp_C_Interface.h

    r2385 r2441  
    104104  int keepNames,
    105105  int ignoreErrors);
     106/** Write an mps file to the given filename */
     107/** Format type is 0 = normal, 1 = extra or 2 = hex.
     108    Number across is 1 or 2.
     109    Use objSense = -1D to flip the objective function around. */
     110COINLIBAPI int COINLINKAGE Clp_writeMps(Clp_Simplex *model, const char *filename,
     111  int formatType,
     112  int numberAcross,
     113  double objSense);
    106114/** Copy in integer informations */
    107115COINLIBAPI void COINLINKAGE Clp_copyInIntegerInformation(Clp_Simplex *model, const char *information);
     
    294302/** Fill in array (at least lengthNames+1 long) with a column name */
    295303COINLIBAPI void COINLINKAGE Clp_columnName(Clp_Simplex *model, int iColumn, char *name);
     304/** Set row name - Nice if they are short - 8 chars or less I think */
     305COINLIBAPI void COINLINKAGE Clp_setRowName(Clp_Simplex *model, int iRow, char *name);
     306/** Set column name - Nice if they are short - 8 chars or less I think */
     307COINLIBAPI void COINLINKAGE Clp_setColumnName(Clp_Simplex *model, int iColumn, char *name);
    296308
    297309/*@}*/
Note: See TracChangeset for help on using the changeset viewer.