rework ortools samples (#4590)
This commit is contained in:
@@ -21,7 +21,10 @@
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "ortools/algorithms/knapsack_solver.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
// [END import]
|
||||
|
||||
namespace operations_research {
|
||||
@@ -86,6 +89,8 @@ void RunKnapsackExample() {
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::RunKnapsackExample();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -21,8 +21,11 @@
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "absl/log/log.h"
|
||||
#include "ortools/algorithms/knapsack_solver.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
// [END import]
|
||||
|
||||
namespace operations_research {
|
||||
@@ -80,7 +83,9 @@ void SimpleKnapsackProgram() {
|
||||
} // namespace algorithms
|
||||
} // namespace operations_research
|
||||
|
||||
int main() {
|
||||
int main(int argc, char* argv[]) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::algorithms::SimpleKnapsackProgram();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user