Skip to content

Commit

Permalink
test2
Browse files Browse the repository at this point in the history
  • Loading branch information
sgatto committed Sep 23, 2024
1 parent 008548a commit b558e44
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,35 @@
' 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"''',
'''#include "absl/strings/numbers.h"
#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',
''' }
Expand All @@ -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;
};
Expand All @@ -221,7 +241,9 @@
<< " to value " << convertedValue << std::endl; \
setter(mLp, matchingParamIter->second, convertedValue); \
continue; \
}''',
} \
}
''',
''' }
}
Expand All @@ -242,7 +264,9 @@
} \
setter(mLp, matchingParamIter->second, convertedValue); \
continue; \
}'''
} \
}
'''
))

replacements.append(Replacement(
Expand Down

0 comments on commit b558e44

Please sign in to comment.