20#include "absl/container/flat_hash_set.h"
22#include "ortools/math_opt/sparse_containers.pb.h"
34 for (
const LinearExpressionProto& expr_proto : in_proto.arguments_to_norm()) {
38 data.
name = in_proto.name();
47 *constraint.add_arguments_to_norm() = expr.Proto();
49 constraint.set_name(
name);
55 absl::flat_hash_set<VariableId> vars;
60 for (
const auto& [
var, unused] : expr.coeffs.terms()) {
64 return std::vector<VariableId>(vars.begin(), vars.end());
70 expr.coeffs.set(
var, 0.0);
bool set(VariableId id, double coeff)
Returns true if the stored value changes.
const absl::flat_hash_map< VariableId, double > & terms() const
An object oriented wrapper for quadratic constraints in ModelStorage.
static LinearExpressionData FromProto(const LinearExpressionProto &expr_proto)
LinearExpressionProto Proto() const
Inline implementations.
SparseCoefficientMap coeffs
LinearExpressionData upper_bound
std::vector< LinearExpressionData > arguments_to_norm
SecondOrderConeConstraintProto ProtoType
static SecondOrderConeConstraintData FromProto(const ProtoType &in_proto)
void DeleteVariable(VariableId var)
std::vector< VariableId > RelatedVariables() const