Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
linear_solver.cc File Reference
#include "ortools/linear_solver/linear_solver.h"
#include <unistd.h>
#include <algorithm>
#include <atomic>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <iostream>
#include <limits>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "absl/base/const_init.h"
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/flags/flag.h"
#include "absl/log/check.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/ascii.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/string_view.h"
#include "absl/synchronization/mutex.h"
#include "absl/synchronization/notification.h"
#include "absl/time/clock.h"
#include "absl/time/time.h"
#include "google/protobuf/text_format.h"
#include "ortools/base/accurate_sum.h"
#include "ortools/base/logging.h"
#include "ortools/base/map_util.h"
#include "ortools/base/stl_util.h"
#include "ortools/base/threadpool.h"
#include "ortools/linear_solver/linear_expr.h"
#include "ortools/linear_solver/linear_solver.pb.h"
#include "ortools/linear_solver/linear_solver_callback.h"
#include "ortools/linear_solver/model_exporter.h"
#include "ortools/linear_solver/model_validator.h"
#include "ortools/port/file.h"
#include "ortools/port/proto_utils.h"
#include "ortools/util/fp_utils.h"
#include "ortools/util/lazy_mutable_copy.h"
#include "ortools/util/time_limit.h"

Go to the source code of this file.

Namespaces

namespace  operations_research
 In SWIG mode, we don't want anything besides these top-level includes.
 

Functions

 ABSL_FLAG (bool, verify_solution, false, "Systematically verify the solution when calling Solve()" ", and change the return value of Solve() to ABNORMAL if" " an error was detected.")
 
 ABSL_FLAG (bool, log_verification_errors, true, "If --verify_solution is set: LOG(ERROR) all errors detected" " during the verification of the solution.")
 
 ABSL_FLAG (bool, linear_solver_enable_verbose_output, false, "If set, enables verbose output for the solver. Setting this flag" " is the same as calling MPSolver::EnableOutput().")
 
 ABSL_FLAG (bool, mpsolver_bypass_model_validation, false, "If set, the user-provided Model won't be verified before Solve()." " Invalid models will typically trigger various error responses" " from the underlying solvers; sometimes crashes.")
 
bool operations_research::SolverTypeIsMip (MPModelRequest::SolverType solver_type)
 There is a homonymous version taking a MPSolver::OptimizationProblemType.
 
MPSolverInterfaceoperations_research::BuildBopInterface (MPSolver *const solver)
 Register BOP in the global linear solver factory.
 
MPSolverInterfaceoperations_research::BuildCBCInterface (MPSolver *const solver)
 
MPSolverInterfaceoperations_research::BuildCLPInterface (MPSolver *const solver)
 
MPSolverInterfaceoperations_research::BuildGLOPInterface (MPSolver *const solver)
 Register GLOP in the global linear solver factory.
 
MPSolverInterfaceoperations_research::BuildGLPKInterface (bool mip, MPSolver *const solver)
 
MPSolverInterfaceoperations_research::BuildHighsInterface (bool mip, MPSolver *const solver)
 Register PDLP in the global linear solver factory.
 
MPSolverInterfaceoperations_research::BuildPdlpInterface (MPSolver *const solver)
 Register PDLP in the global linear solver factory.
 
MPSolverInterfaceoperations_research::BuildSatInterface (MPSolver *const solver)
 Register Sat in the global linear solver factory.
 
MPSolverInterfaceoperations_research::BuildSCIPInterface (MPSolver *const solver)
 
MPSolverInterfaceoperations_research::BuildGurobiInterface (bool mip, MPSolver *const solver)
 
MPSolverInterfaceoperations_research::BuildCplexInterface (bool mip, MPSolver *const solver)
 
MPSolverInterfaceoperations_research::BuildXpressInterface (bool mip, MPSolver *const solver)
 
bool operations_research::GurobiIsCorrectlyInstalled ()
 
bool operations_research::XpressIsCorrectlyInstalled ()
 
absl::string_view operations_research::ToString (MPSolver::OptimizationProblemType optimization_problem_type)
 
bool operations_research::AbslParseFlag (const absl::string_view text, MPSolver::OptimizationProblemType *solver_type, std::string *error)
 
bool operations_research::MPSolverResponseStatusIsRpcError (MPSolverResponseStatus status)
 

Variables

constexpr NamedOptimizationProblemType operations_research::kOptimizationProblemTypeNames []
 

Function Documentation

◆ ABSL_FLAG() [1/4]

ABSL_FLAG ( bool ,
linear_solver_enable_verbose_output ,
false ,
"If set,
enables verbose output for the solver. Setting this flag" " is the same as calling MPSolver::EnableOutput()."  )

◆ ABSL_FLAG() [2/4]

ABSL_FLAG ( bool ,
log_verification_errors ,
true ,
"If --verify_solution is set: LOG(ERROR) all errors detected" " during the verification of the solution."  )

◆ ABSL_FLAG() [3/4]

ABSL_FLAG ( bool ,
mpsolver_bypass_model_validation ,
false ,
"If set,
the user-provided Model won 't be verified before Solve()." " Invalid models will typically trigger various error responses" " from the underlying solvers;sometimes crashes."  )

◆ ABSL_FLAG() [4/4]

ABSL_FLAG ( bool ,
verify_solution ,
false ,
"Systematically verify the solution when calling Solve()" " ,
and change the return value of Solve() to ABNORMAL if" " an error was detected."  )

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Variable Documentation

◆ name

absl::string_view name

Definition at line 560 of file linear_solver.cc.

◆ problem_type

MPSolver::OptimizationProblemType problem_type

Definition at line 559 of file linear_solver.cc.