Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::VariablesAssignment Class Reference

#include <sat_base.h>

Public Member Functions

 VariablesAssignment ()=default
 
 VariablesAssignment (int num_variables)
 
 VariablesAssignment (const VariablesAssignment &)=delete
 This type is neither copyable nor movable.
 
VariablesAssignmentoperator= (const VariablesAssignment &)=delete
 
void Resize (int num_variables)
 
void AssignFromTrueLiteral (Literal literal)
 
void UnassignLiteral (Literal literal)
 
bool LiteralIsFalse (Literal literal) const
 
bool LiteralIsTrue (Literal literal) const
 
bool LiteralIsAssigned (Literal literal) const
 
bool VariableIsAssigned (BooleanVariable var) const
 Returns true iff the given variable is assigned.
 
Literal GetTrueLiteralForAssignedVariable (BooleanVariable var) const
 
int NumberOfVariables () const
 

Friends

class AssignmentView
 

Detailed Description

Holds the current variable assignment of the solver. Each variable can be unassigned or be assigned to true or false.

Definition at line 156 of file sat_base.h.

Constructor & Destructor Documentation

◆ VariablesAssignment() [1/3]

operations_research::sat::VariablesAssignment::VariablesAssignment ( )
default

◆ VariablesAssignment() [2/3]

operations_research::sat::VariablesAssignment::VariablesAssignment ( int num_variables)
inlineexplicit

Definition at line 159 of file sat_base.h.

◆ VariablesAssignment() [3/3]

operations_research::sat::VariablesAssignment::VariablesAssignment ( const VariablesAssignment & )
delete

This type is neither copyable nor movable.

Member Function Documentation

◆ AssignFromTrueLiteral()

void operations_research::sat::VariablesAssignment::AssignFromTrueLiteral ( Literal literal)
inline

Makes the given literal true by assigning its underlying variable to either true or false depending on the literal sign. This can only be called on an unassigned variable.

Definition at line 171 of file sat_base.h.

◆ GetTrueLiteralForAssignedVariable()

Literal operations_research::sat::VariablesAssignment::GetTrueLiteralForAssignedVariable ( BooleanVariable var) const
inline

Returns the literal of the given variable that is assigned to true. That is, depending on the variable, it can be the positive literal or the negative one. Only call this on an assigned variable.

Definition at line 203 of file sat_base.h.

◆ LiteralIsAssigned()

bool operations_research::sat::VariablesAssignment::LiteralIsAssigned ( Literal literal) const
inline

Definition at line 191 of file sat_base.h.

◆ LiteralIsFalse()

bool operations_research::sat::VariablesAssignment::LiteralIsFalse ( Literal literal) const
inline

Literal getters. Note that both can be false, in which case the corresponding variable is not assigned.

Definition at line 185 of file sat_base.h.

◆ LiteralIsTrue()

bool operations_research::sat::VariablesAssignment::LiteralIsTrue ( Literal literal) const
inline

Definition at line 188 of file sat_base.h.

◆ NumberOfVariables()

int operations_research::sat::VariablesAssignment::NumberOfVariables ( ) const
inline

Definition at line 208 of file sat_base.h.

◆ operator=()

VariablesAssignment & operations_research::sat::VariablesAssignment::operator= ( const VariablesAssignment & )
delete

◆ Resize()

void operations_research::sat::VariablesAssignment::Resize ( int num_variables)
inline

Definition at line 164 of file sat_base.h.

◆ UnassignLiteral()

void operations_research::sat::VariablesAssignment::UnassignLiteral ( Literal literal)
inline

Unassign the variable corresponding to the given literal. This can only be called on an assigned variable.

Definition at line 178 of file sat_base.h.

◆ VariableIsAssigned()

bool operations_research::sat::VariablesAssignment::VariableIsAssigned ( BooleanVariable var) const
inline

Returns true iff the given variable is assigned.

Definition at line 196 of file sat_base.h.

Friends And Related Symbol Documentation

◆ AssignmentView

friend class AssignmentView
friend

Definition at line 217 of file sat_base.h.


The documentation for this class was generated from the following file: