Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <model_solve_parameters.h>
Classes | |
struct | ObjectiveParameters |
Parameters for an individual objective in a multi-objective model. More... | |
struct | SolutionHint |
Public Member Functions | |
absl::Status | CheckModelStorage (const ModelStorage *expected_storage) const |
ModelSolveParametersProto | Proto () const |
Static Public Member Functions | |
static ModelSolveParameters | OnlyPrimalVariables () |
template<typename Collection > | |
static ModelSolveParameters | OnlySomePrimalVariables (const Collection &variables) |
static ModelSolveParameters | OnlySomePrimalVariables (std::initializer_list< Variable > variables) |
static absl::StatusOr< ModelSolveParameters > | FromProto (const Model &model, const ModelSolveParametersProto &proto) |
Public Attributes | |
MapFilter< Variable > | variable_values_filter |
MapFilter< LinearConstraint > | dual_values_filter |
The filter that is applied to dual_values of DualSolution and DualRay. | |
MapFilter< QuadraticConstraint > | quadratic_dual_values_filter |
MapFilter< Variable > | reduced_costs_filter |
The filter that is applied to reduced_costs of DualSolution and DualRay. | |
std::optional< Basis > | initial_basis |
std::vector< SolutionHint > | solution_hints |
VariableMap< int32_t > | branching_priorities |
ObjectiveMap< ObjectiveParameters > | objective_parameters |
Parameters for individual objectives in a multi-objective model. | |
absl::flat_hash_set< LinearConstraint > | lazy_linear_constraints |
Parameters to control a single solve that are specific to the input model (see SolveParametersProto for model independent parameters).
Definition at line 43 of file model_solve_parameters.h.
absl::Status operations_research::math_opt::ModelSolveParameters::CheckModelStorage | ( | const ModelStorage * | expected_storage | ) | const |
Returns a failure if the referenced variables and constraints do not belong to the input expected_storage (which must not be nullptr).
Definition at line 57 of file model_solve_parameters.cc.
|
static |
Returns the ModelSolveParameters corresponding to this proto and the given model.
Definition at line 219 of file model_solve_parameters.cc.
|
static |
Returns the parameters that empty DualSolution and DualRay, only keep the values of all variables in PrimalSolution and PrimalRay.
This is a shortcut method that is equivalent to setting the dual filters with MakeSkipAllFilter().
Definition at line 43 of file model_solve_parameters.cc.
|
static |
Returns the parameters that empty DualSolution and DualRay, only keep the values of the specified variables in PrimalSolution and PrimalRay.
The input Collection must be usable in a for-range loop with Variable values. This will be typically a std::vector<Variable> or and std::initializer_list<Variable> (see the other overload).
This is a shortcut method that is equivalent to setting the dual filters with MakeSkipAllFilter() and the variable_values_filter with MakeKeepKeysFilter(variables).
Example: std::vector<Variable> decision_vars = ...; const auto params = ModelSolveParameters::OnlySomePrimalVariables(decision_vars);
Inline functions implementations.
Definition at line 227 of file model_solve_parameters.h.
|
static |
Returns the parameters that empty DualSolution and DualRay, only keeping the values of the specified variables in PrimalSolution and PrimalRay.
See the other overload's documentation for details. This overload is needed since C++ can't guess the type when using an initializer list expression.
Example: const Variable a = ...; const Variable b = ...; const auto params = ModelSolveParameters::OnlySomePrimalVariables({a, b});
Definition at line 52 of file model_solve_parameters.cc.
ModelSolveParametersProto operations_research::math_opt::ModelSolveParameters::Proto | ( | ) | const |
Returns the proto equivalent of this object.
The caller should use CheckModelStorage() as this function does not check internal consistency of the referenced variables and constraints.
Definition at line 170 of file model_solve_parameters.cc.
VariableMap<int32_t> operations_research::math_opt::ModelSolveParameters::branching_priorities |
Optional branching priorities. Variables with higher values will be branched on first. Variables for which priorities are not set get the solver's default priority (usually zero).
Definition at line 153 of file model_solve_parameters.h.
MapFilter<LinearConstraint> operations_research::math_opt::ModelSolveParameters::dual_values_filter |
The filter that is applied to dual_values of DualSolution and DualRay.
Definition at line 89 of file model_solve_parameters.h.
std::optional<Basis> operations_research::math_opt::ModelSolveParameters::initial_basis |
Optional initial basis for warm starting simplex LP solvers. If set, it is expected to be valid.
Definition at line 100 of file model_solve_parameters.h.
absl::flat_hash_set<LinearConstraint> operations_research::math_opt::ModelSolveParameters::lazy_linear_constraints |
Optional lazy constraint annotations. Included linear constraints will be marked as "lazy" with supporting solvers, meaning that they will only be added to the working model as-needed as the solver runs.
Definition at line 202 of file model_solve_parameters.h.
ObjectiveMap<ObjectiveParameters> operations_research::math_opt::ModelSolveParameters::objective_parameters |
Parameters for individual objectives in a multi-objective model.
Definition at line 193 of file model_solve_parameters.h.
MapFilter<QuadraticConstraint> operations_research::math_opt::ModelSolveParameters::quadratic_dual_values_filter |
The filter that is applied to quadratic_dual_values of DualSolution and DualRay.
Definition at line 93 of file model_solve_parameters.h.
The filter that is applied to reduced_costs of DualSolution and DualRay.
Definition at line 96 of file model_solve_parameters.h.
std::vector<SolutionHint> operations_research::math_opt::ModelSolveParameters::solution_hints |
Optional solution hints. If the underlying solver only accepts a single hint, the first hint is used.
Definition at line 148 of file model_solve_parameters.h.
The filter that is applied to variable_values of both PrimalSolution and PrimalRay.
Definition at line 86 of file model_solve_parameters.h.