Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::ModelSubset Struct Reference

#include <compute_infeasible_subsystem_result.h>

Classes

struct  Bounds
 

Public Member Functions

ModelSubsetProto Proto () const
 
absl::Status CheckModelStorage (const ModelStorage *expected_storage) const
 
bool empty () const
 True if this object corresponds to the empty subset.
 
std::string ToString () const
 

Static Public Member Functions

static absl::StatusOr< ModelSubsetFromProto (const ModelStorage *model, const ModelSubsetProto &proto)
 

Public Attributes

absl::flat_hash_map< Variable, Boundsvariable_bounds
 
absl::flat_hash_set< Variablevariable_integrality
 
absl::flat_hash_map< LinearConstraint, Boundslinear_constraints
 
absl::flat_hash_map< QuadraticConstraint, Boundsquadratic_constraints
 
absl::flat_hash_set< SecondOrderConeConstraintsecond_order_cone_constraints
 
absl::flat_hash_set< Sos1Constraintsos1_constraints
 
absl::flat_hash_set< Sos2Constraintsos2_constraints
 
absl::flat_hash_set< IndicatorConstraintindicator_constraints
 

Detailed Description

Represents a subset of the constraints (including variable bounds and integrality) of a Model.

The fields contain Variable and Constraint objects which retain pointers back to their associated Model. Therefore, a ModelSubset should not outlive the Model it is in reference to.

Definition at line 45 of file compute_infeasible_subsystem_result.h.

Member Function Documentation

◆ CheckModelStorage()

absl::Status operations_research::math_opt::ModelSubset::CheckModelStorage ( const ModelStorage * expected_storage) const

Returns a failure if the Variable and Constraints contained in the fields do not belong to the input expected_storage (which must not be nullptr).

Definition at line 184 of file compute_infeasible_subsystem_result.cc.

◆ empty()

bool operations_research::math_opt::ModelSubset::empty ( ) const

True if this object corresponds to the empty subset.

Definition at line 222 of file compute_infeasible_subsystem_result.cc.

◆ FromProto()

absl::StatusOr< ModelSubset > operations_research::math_opt::ModelSubset::FromProto ( const ModelStorage * model,
const ModelSubsetProto & proto )
static

Returns the ModelSubset equivalent to proto.

Returns an error when model does not contain a variable or constraint associated with an index present in proto.

Definition at line 134 of file compute_infeasible_subsystem_result.cc.

◆ Proto()

ModelSubsetProto operations_research::math_opt::ModelSubset::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 167 of file compute_infeasible_subsystem_result.cc.

◆ ToString()

std::string operations_research::math_opt::ModelSubset::ToString ( ) const

Returns a detailed string description of the contents of the model subset. (not the component names, use << for that instead).

We only want to only print the bounds appearing in the subset. The << operator for BoundedQuadraticExpressions will ignore -/+inf bound values for the lower/upper bounds, respectively (assuming that at least one is finite, otherwise it chooses to print one bound arbitrarily). So, to suppress bounds not in the subset, it suffices to set their value to the appropriate infinity.

Definition at line 229 of file compute_infeasible_subsystem_result.cc.

Member Data Documentation

◆ indicator_constraints

absl::flat_hash_set<IndicatorConstraint> operations_research::math_opt::ModelSubset::indicator_constraints

Definition at line 94 of file compute_infeasible_subsystem_result.h.

◆ linear_constraints

absl::flat_hash_map<LinearConstraint, Bounds> operations_research::math_opt::ModelSubset::linear_constraints

Definition at line 89 of file compute_infeasible_subsystem_result.h.

◆ quadratic_constraints

absl::flat_hash_map<QuadraticConstraint, Bounds> operations_research::math_opt::ModelSubset::quadratic_constraints

Definition at line 90 of file compute_infeasible_subsystem_result.h.

◆ second_order_cone_constraints

absl::flat_hash_set<SecondOrderConeConstraint> operations_research::math_opt::ModelSubset::second_order_cone_constraints

Definition at line 91 of file compute_infeasible_subsystem_result.h.

◆ sos1_constraints

absl::flat_hash_set<Sos1Constraint> operations_research::math_opt::ModelSubset::sos1_constraints

Definition at line 92 of file compute_infeasible_subsystem_result.h.

◆ sos2_constraints

absl::flat_hash_set<Sos2Constraint> operations_research::math_opt::ModelSubset::sos2_constraints

Definition at line 93 of file compute_infeasible_subsystem_result.h.

◆ variable_bounds

absl::flat_hash_map<Variable, Bounds> operations_research::math_opt::ModelSubset::variable_bounds

Definition at line 87 of file compute_infeasible_subsystem_result.h.

◆ variable_integrality

absl::flat_hash_set<Variable> operations_research::math_opt::ModelSubset::variable_integrality

Definition at line 88 of file compute_infeasible_subsystem_result.h.


The documentation for this struct was generated from the following files: