diff --git a/patch.py b/patch.py index 650139a..ee27c78 100644 --- a/patch.py +++ b/patch.py @@ -182,7 +182,7 @@ ' friend class SiriusInterface;\n')) # add temporary patch for XPressInterface -additions.append(Addition( +replacements.append(Replacement( Path.cwd()/'ortools'/'linear_solver'/'xpress_interface.cc', '''#include "absl/strings/str_format.h" #include "ortools/base/logging.h"''', @@ -190,6 +190,27 @@ #include "absl/strings/str_format.h" #include "ortools/base/logging.h"''')) +replacements.append(Replacement( + Path.cwd()/'ortools'/'linear_solver'/'xpress_interface.cc', + ''' num_nodes_(num_nodes), + variable_values_(0) {}; +''', + ''' num_nodes_(num_nodes), + variable_values_(0){}; +''')) + +replacements.append(Replacement( + Path.cwd()/'ortools'/'linear_solver'/'xpress_interface.cc', + ''' public: + explicit MPCallbackWrapper(MPCallback* callback) : callback_(callback) {}; + MPCallback* GetCallback() const { return callback_; } +''', + ''' public: + explicit MPCallbackWrapper(MPCallback* callback) : callback_(callback){}; + MPCallback* GetCallback() const { return callback_; } +''')) + + replacements.append(Replacement( Path.cwd()/'ortools'/'linear_solver'/'xpress_interface.cc', ''' } @@ -206,8 +227,7 @@ CHECK_EQ(std::string(newLocale), "C"); } ~ScopedLocale() { std::setlocale(LC_NUMERIC, oldLocale); } -+bool stringToCharPtr(const std::string& var, const char** out) { - + private: const char* oldLocale; }; @@ -221,7 +241,9 @@ << " to value " << convertedValue << std::endl; \ setter(mLp, matchingParamIter->second, convertedValue); \ continue; \ - }''', + } \ + } +''', ''' } } @@ -242,7 +264,9 @@ } \ setter(mLp, matchingParamIter->second, convertedValue); \ continue; \ - }''' + } \ + } +''' )) replacements.append(Replacement(