Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
names_removal.cc
Go to the documentation of this file.
1// Copyright 2010-2025 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
15
18
20
21namespace {
22
23template <typename T>
24void RemoveMapNames(google::protobuf::Map<int64_t, T>& map) {
25 for (auto& [unused, value] : map) {
26 value.clear_name();
27 }
28}
29
30} // namespace
31
32void RemoveNames(ModelProto& model) {
33 model.clear_name();
36 RemoveMapNames(*model.mutable_auxiliary_objectives());
37 RemoveMapNames(*model.mutable_quadratic_constraints());
38 RemoveMapNames(*model.mutable_second_order_cone_constraints());
39 RemoveMapNames(*model.mutable_sos1_constraints());
40 RemoveMapNames(*model.mutable_sos2_constraints());
41 RemoveMapNames(*model.mutable_indicator_constraints());
42}
43
60
61} // namespace operations_research::math_opt
::google::protobuf::Map<::int64_t, ::operations_research::math_opt::ObjectiveProto > *PROTOBUF_NONNULL mutable_new_objectives()
::google::protobuf::Map<::int64_t, ::operations_research::math_opt::IndicatorConstraintProto > *PROTOBUF_NONNULL mutable_new_constraints()
::operations_research::math_opt::VariablesProto *PROTOBUF_NONNULL mutable_variables()
Definition model.pb.h:4458
::google::protobuf::Map<::int64_t, ::operations_research::math_opt::SosConstraintProto > *PROTOBUF_NONNULL mutable_sos2_constraints()
Definition model.pb.h:4914
::google::protobuf::Map<::int64_t, ::operations_research::math_opt::ObjectiveProto > *PROTOBUF_NONNULL mutable_auxiliary_objectives()
Definition model.pb.h:4607
::google::protobuf::Map<::int64_t, ::operations_research::math_opt::QuadraticConstraintProto > *PROTOBUF_NONNULL mutable_quadratic_constraints()
Definition model.pb.h:4827
::google::protobuf::Map<::int64_t, ::operations_research::math_opt::SecondOrderConeConstraintProto > *PROTOBUF_NONNULL mutable_second_order_cone_constraints()
Definition model.pb.h:4856
::operations_research::math_opt::LinearConstraintsProto *PROTOBUF_NONNULL mutable_linear_constraints()
Definition model.pb.h:4683
::google::protobuf::Map<::int64_t, ::operations_research::math_opt::IndicatorConstraintProto > *PROTOBUF_NONNULL mutable_indicator_constraints()
Definition model.pb.h:4943
::google::protobuf::Map<::int64_t, ::operations_research::math_opt::SosConstraintProto > *PROTOBUF_NONNULL mutable_sos1_constraints()
Definition model.pb.h:4885
::operations_research::math_opt::IndicatorConstraintUpdatesProto *PROTOBUF_NONNULL mutable_indicator_constraint_updates()
::operations_research::math_opt::AuxiliaryObjectivesUpdatesProto *PROTOBUF_NONNULL mutable_auxiliary_objectives_updates()
::operations_research::math_opt::SecondOrderConeConstraintUpdatesProto *PROTOBUF_NONNULL mutable_second_order_cone_constraint_updates()
::operations_research::math_opt::SosConstraintUpdatesProto *PROTOBUF_NONNULL mutable_sos1_constraint_updates()
::operations_research::math_opt::QuadraticConstraintUpdatesProto *PROTOBUF_NONNULL mutable_quadratic_constraint_updates()
::operations_research::math_opt::VariablesProto *PROTOBUF_NONNULL mutable_new_variables()
::operations_research::math_opt::SosConstraintUpdatesProto *PROTOBUF_NONNULL mutable_sos2_constraint_updates()
::operations_research::math_opt::LinearConstraintsProto *PROTOBUF_NONNULL mutable_new_linear_constraints()
::google::protobuf::Map<::int64_t, ::operations_research::math_opt::QuadraticConstraintProto > *PROTOBUF_NONNULL mutable_new_constraints()
::google::protobuf::Map<::int64_t, ::operations_research::math_opt::SecondOrderConeConstraintProto > *PROTOBUF_NONNULL mutable_new_constraints()
::google::protobuf::Map<::int64_t, ::operations_research::math_opt::SosConstraintProto > *PROTOBUF_NONNULL mutable_new_constraints()
An object oriented wrapper for quadratic constraints in ModelStorage.
Definition gurobi_isv.cc:28
void RemoveNames(ModelProto &model)
Removes the model, variables and constraints names of the provided model.