53 static absl::StatusOr<std::unique_ptr<SolverInterface>>
New(
56 absl::StatusOr<SolveResultProto>
Solve(
63 absl::StatusOr<ComputeInfeasibleSubsystemResultProto>
80 struct AuxiliaryStructureHandler {
84 absl::Status DeleteStructure(GScip& gscip);
86 std::vector<SCIP_VAR*> variables;
87 std::vector<SCIP_CONS*> constraints;
90 explicit GScipSolver(std::unique_ptr<GScip> gscip);
94 const absl::flat_hash_map<int64_t, double>&
95 linear_objective_coefficients);
99 absl::StatusOr<bool> UpdateVariables(
102 absl::Status AddQuadraticObjectiveTerms(
106 absl::Status AddLinearConstraints(
112 absl::Status UpdateLinearConstraints(
115 std::optional<int64_t> first_new_var_id,
116 std::optional<int64_t> first_new_cstr_id);
118 absl::Status AddQuadraticConstraints(
119 const google::protobuf::Map<int64_t, QuadraticConstraintProto>&
120 quadratic_constraints);
122 absl::Status AddIndicatorConstraints(
123 const google::protobuf::Map<int64_t, IndicatorConstraintProto>&
124 indicator_constraints);
129 absl::StatusOr<std::pair<SCIP_VAR*, SCIP_CONS*>>
136 absl::StatusOr<std::pair<GScipSOSData, AuxiliaryStructureHandler>>
139 absl::Status AddSos1Constraints(
140 const google::protobuf::Map<int64_t, SosConstraintProto>&
142 absl::Status AddSos2Constraints(
143 const google::protobuf::Map<int64_t, SosConstraintProto>&
146 absl::flat_hash_set<SCIP_VAR*> LookupAllVariables(
147 absl::Span<const int64_t> variable_ids);
148 absl::StatusOr<SolveResultProto> CreateSolveResultProto(
149 GScipResult gscip_result,
151 std::optional<double> cutoff);
163 std::unique_ptr<GScipSolverConstraintData> constraint_data_;
164 const std::unique_ptr<GScip> gscip_;
168 bool has_quadratic_objective_ =
false;
169 absl::flat_hash_map<int64_t, SCIP_CONS*> linear_constraints_;
170 absl::flat_hash_map<int64_t, SCIP_CONS*> quadratic_constraints_;
174 absl::flat_hash_map<int64_t, std::optional<std::pair<SCIP_CONS*, int64_t>>>
175 indicator_constraints_;
176 absl::flat_hash_map<int64_t, std::pair<SCIP_CONS*, AuxiliaryStructureHandler>>
178 absl::flat_hash_map<int64_t, std::pair<SCIP_CONS*, AuxiliaryStructureHandler>>
absl::StatusOr< SolveResultProto > Solve(const SolveParametersProto ¶meters, const ModelSolveParametersProto &model_parameters, MessageCallback message_cb, const CallbackRegistrationProto &callback_registration, Callback cb, const SolveInterrupter *interrupter) override