sync most c++ examples

This commit is contained in:
Laurent Perron
2021-01-14 10:48:19 +01:00
parent 692b590128
commit 805b733f98
35 changed files with 499 additions and 189 deletions

View File

@@ -13,12 +13,15 @@
// Integer programming example that shows how to use the API.
#include "ortools/base/commandlineflags.h"
#include "absl/flags/parse.h"
#include "absl/flags/usage.h"
#include "absl/strings/match.h"
#include "absl/strings/string_view.h"
#include "ortools/base/logging.h"
#include "ortools/linear_solver/linear_solver.h"
namespace operations_research {
void RunIntegerProgrammingExample(const std::string& solver_id) {
void RunIntegerProgrammingExample(absl::string_view solver_id) {
LOG(INFO) << "---- Integer programming example with " << solver_id << " ----";
MPSolver::OptimizationProblemType problem_type;
@@ -87,9 +90,7 @@ void RunAllExamples() {
int main(int argc, char** argv) {
google::InitGoogleLogging(argv[0]);
absl::SetFlag(&FLAGS_logtostderr, true);
absl::SetFlag(&FLAGS_log_prefix, false);
absl::ParseCommandLine(argc, argv);
operations_research::RunAllExamples();
return 0;
return EXIT_SUCCESS;
}