From 6ca49c597583e088429fe7f9d69a905f695f0a9c Mon Sep 17 00:00:00 2001 From: John Forrest Date: Tue, 13 Aug 2024 14:33:40 +0100 Subject: [PATCH] annoys me not having size of problem given --- src/CoinLpIO.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/CoinLpIO.cpp b/src/CoinLpIO.cpp index 9ede09ff..aac780fc 100644 --- a/src/CoinLpIO.cpp +++ b/src/CoinLpIO.cpp @@ -2020,6 +2020,18 @@ void CoinLpIO::readLp(const char *filename) // see if just .lp int length = strlen(filename); if ((length > 3 && !strncmp(filename + length - 3, ".lp", 3))) { +#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN32__) + // leave problemName_ as null +#else + // find last / + length--; + while (length>=0) { + if (filename[length]=='/') + break; + length--; + } + problemName_ = CoinStrdup(filename+length+1); +#endif FILE *fp = fopen(filename, "r"); if (fp) { readable = true; @@ -2746,7 +2758,12 @@ void CoinLpIO::readLp() int saveNumberSets = numberSets_; set_ = NULL; numberSets_ = 0; - + if (strlen(problemName_)) + handler_->message(COIN_MPS_STATS, messages_) << problemName_ + << numberRows_ + << numberColumns_ + << numberElements_ + << CoinMessageEol; setLpDataWithoutRowAndColNames(*matrix, collow, colup, const_cast< const double ** >(obj), num_objectives, has_int ? is_int : 0, rowlow, rowup);