rework ortools samples (#4590)
This commit is contained in:
@@ -20,7 +20,10 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/base/logging.h"
|
||||
#include "ortools/linear_solver/linear_solver.h"
|
||||
// [END import]
|
||||
@@ -230,7 +233,9 @@ void AssignmentTeamsMip() {
|
||||
}
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int main(int argc, char* argv[]) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::AssignmentTeamsMip();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/base/logging.h"
|
||||
#include "ortools/linear_solver/linear_solver.h"
|
||||
// [END import]
|
||||
@@ -115,7 +118,9 @@ void AssignmentMip() {
|
||||
}
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int main(int argc, char* argv[]) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::AssignmentMip();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
#include <numeric>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/base/logging.h"
|
||||
#include "ortools/linear_solver/linear_solver.h"
|
||||
// [END import]
|
||||
@@ -135,7 +138,9 @@ void AssignmentTeamsMip() {
|
||||
}
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int main(int argc, char* argv[]) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::AssignmentTeamsMip();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
#include <numeric>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/base/logging.h"
|
||||
#include "ortools/linear_solver/linear_solver.h"
|
||||
// [END import]
|
||||
@@ -149,7 +152,9 @@ void AssignmentTeamsMip() {
|
||||
}
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int main(int argc, char* argv[]) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::AssignmentTeamsMip();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/linear_solver/linear_solver.h"
|
||||
// [END import]
|
||||
|
||||
@@ -89,7 +92,9 @@ void IntegerProgrammingExample() {
|
||||
}
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int main(int argc, char* argv[]) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::IntegerProgrammingExample();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/linear_solver/linear_solver.h"
|
||||
// [END import]
|
||||
|
||||
@@ -80,7 +83,9 @@ void LinearProgrammingExample() {
|
||||
}
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int main(int argc, char* argv[]) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::LinearProgrammingExample();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/linear_solver/linear_solver.h"
|
||||
// [END import]
|
||||
|
||||
@@ -101,7 +104,9 @@ void MipVarArray() {
|
||||
}
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int main(int argc, char* argv[]) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::MipVarArray();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
#include <numeric>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/linear_solver/linear_expr.h"
|
||||
#include "ortools/linear_solver/linear_solver.h"
|
||||
// [END import]
|
||||
@@ -129,6 +132,8 @@ void MultipleKnapsackMip() {
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::MultipleKnapsackMip();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -11,8 +11,10 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/flags/flag.h"
|
||||
#include "absl/log/check.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "absl/log/log.h"
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
@@ -29,6 +31,7 @@ using operations_research::MPSolver;
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::CapacityPlanningInstance request;
|
||||
operations_research::CapacityPlanningProblem problem;
|
||||
::absl::Status status =
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/linear_solver/linear_solver.h"
|
||||
// [END import]
|
||||
|
||||
@@ -81,7 +84,9 @@ void SimpleLpProgram() {
|
||||
}
|
||||
} // namespace operations_research
|
||||
|
||||
int main() {
|
||||
int main(int argc, char* argv[]) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::SimpleLpProgram();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
// [START import]
|
||||
#include <memory>
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/linear_solver/linear_solver.h"
|
||||
// [END import]
|
||||
|
||||
@@ -86,7 +89,9 @@ void SimpleMipProgram() {
|
||||
}
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int main(int argc, char* argv[]) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::SimpleMipProgram();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -321,8 +321,8 @@ void StiglerDiet() {
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::StiglerDiet();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user