C++ Reference: class Constraint

This documentation is automatically generated.

Method
MutableProto

Return type: ConstraintProto*

Returns the mutable underlying protobuf object (useful for model edition).

Name

Return type: const std::string&

Returns the name of the constraint (or the empty string if not set).

OnlyEnforceIf

Return type: Constraint

Arguments: absl::Span<const BoolVar> literals

OnlyEnforceIf

Return type: Constraint

Arguments: BoolVar literal

See OnlyEnforceIf(absl::Span literals).

Proto

Return type: const ConstraintProto&

Returns the underlying protobuf object (useful for testing).

WithName

Return type: Constraint

Arguments: const std::string& name

Sets the name of the constraint.