30 if (!constraint.weights().empty() &&
31 constraint.weights_size() != constraint.expressions_size()) {
33 <<
"Length mismatch between weights and expressions: "
34 << constraint.weights_size() <<
" vs. "
35 << constraint.expressions_size();
37 for (
const LinearExpressionProto& expression : constraint.expressions()) {
39 <<
"Invalid SOS expression";
42 absl::flat_hash_set<double> weights;
43 for (
const double weight : constraint.weights()) {
45 if (!weights.insert(
weight).second) {
47 <<
"SOS weights must be unique, but encountered duplicate weight: "
51 return absl::OkStatus();