linear_solver: Enable multithread in integer programming example
This commit is contained in:
@@ -71,6 +71,7 @@ void IntegerProgrammingExample() {
|
||||
// [END objective]
|
||||
|
||||
// [START solve]
|
||||
solver->SetNumThreads(8);
|
||||
const MPSolver::ResultStatus result_status = solver->Solve();
|
||||
// Check that the problem has an optimal solution.
|
||||
if (result_status != MPSolver::OPTIMAL) {
|
||||
|
||||
@@ -64,6 +64,7 @@ def IntegerProgrammingExample():
|
||||
|
||||
# Solve the problem and print the solution.
|
||||
# [START print_solution]
|
||||
solver.SetNumThreads(8)
|
||||
solver.Solve()
|
||||
# Print the objective value of the solution.
|
||||
print('Maximum objective function value = %d' % solver.Objective().Value())
|
||||
|
||||
Reference in New Issue
Block a user