C++ Reference: class BoolVar

This documentation is automatically generated.



A Boolean variable.

This class wraps an IntegerVariableProto with domain [0, 1]. It supports the logical negation (Not).

This can only be constructed via \c CpModelBuilder.NewBoolVar().

Method
BoolVar

DebugString

Return type: std::string

Debug std::string.

index

Return type: int

Returns the index of the variable in the model. If the variable is the negation of another variable v, its index is -v.index() - 1.

MutableProto

Return type: IntegerVariableProto*

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

Name

Return type: const std::string&

Returns the name of the variable.

Not

Return type: BoolVar

Returns the logical negation of the current Boolean variable.

Proto

Return type: const IntegerVariableProto&

Returns the underlying protobuf object (useful for testing).

WithName

Return type: BoolVar

Arguments: const std::string& name

Sets the name of the variable.