Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <cp_model.h>
Public Member Functions | |
BoolVar ()=default | |
BoolVar | WithName (absl::string_view name) |
std::string | Name () const |
Returns the name of the variable. | |
BoolVar | Not () const |
Returns the logical negation of the current Boolean variable. | |
bool | operator== (const BoolVar &other) const |
bool | operator!= (const BoolVar &other) const |
BoolVar | operator~ () const |
std::string | DebugString () const |
int | index () const |
Friends | |
class | CircuitConstraint |
class | Constraint |
class | CpModelBuilder |
class | DoubleLinearExpr |
class | IntVar |
class | IntervalVar |
class | MultipleCircuitConstraint |
class | LinearExpr |
class | ReservoirConstraint |
bool | SolutionBooleanValue (const CpSolverResponse &r, BoolVar x) |
Evaluates the value of a Boolean literal in a solver response. | |
A Boolean variable.
This class refer to an IntegerVariableProto with domain [0, 1] or to its logical negation (Not). This is called a Boolean Literal in other context.
This can only be constructed via CpModelBuilder.NewBoolVar()
.
Definition at line 75 of file cp_model.h.
|
default |
A default constructed BoolVar can be used to mean not defined yet. However, it shouldn't be passed to any of the functions in this file. Doing so will crash in debug mode and will result in an invalid model in opt mode.
std::string operations_research::sat::BoolVar::DebugString | ( | ) | const |
Special case for constant variables without names.
Definition at line 59 of file cp_model.cc.
|
inline |
Returns the index of the variable in the model.
Warning: If the variable is the negation of another variable v, its index is -v.index() - 1. So this can be negative.
Definition at line 111 of file cp_model.h.
std::string operations_research::sat::BoolVar::Name | ( | ) | const |
Returns the name of the variable.
Definition at line 48 of file cp_model.cc.
|
inline |
Returns the logical negation of the current Boolean variable.
Definition at line 91 of file cp_model.h.
|
inline |
Definition at line 97 of file cp_model.h.
|
inline |
Definition at line 93 of file cp_model.h.
|
inline |
Definition at line 101 of file cp_model.h.
BoolVar operations_research::sat::BoolVar::WithName | ( | absl::string_view | name | ) |
Sets the name of the variable.
Definition at line 39 of file cp_model.cc.
|
friend |
Definition at line 114 of file cp_model.h.
|
friend |
Definition at line 115 of file cp_model.h.
|
friend |
Definition at line 116 of file cp_model.h.
|
friend |
Definition at line 117 of file cp_model.h.
|
friend |
Definition at line 119 of file cp_model.h.
|
friend |
Definition at line 118 of file cp_model.h.
|
friend |
Definition at line 121 of file cp_model.h.
|
friend |
Definition at line 120 of file cp_model.h.
|
friend |
Definition at line 122 of file cp_model.h.
|
friend |
Evaluates the value of a Boolean literal in a solver response.
Definition at line 1403 of file cp_model.cc.