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

#include <integer.h>

Public Member Functions

 IntegerLiteral ()
 Clients should prefer the static construction methods above.
 
 IntegerLiteral (IntegerVariable v, IntegerValue b)
 
bool IsValid () const
 
bool IsAlwaysTrue () const
 
bool IsAlwaysFalse () const
 
IntegerLiteral Negated () const
 The negation of x >= bound is x <= bound - 1.
 
bool operator== (IntegerLiteral o) const
 
bool operator!= (IntegerLiteral o) const
 
std::string DebugString () const
 

Static Public Member Functions

static IntegerLiteral GreaterOrEqual (IntegerVariable i, IntegerValue bound)
 
static IntegerLiteral LowerOrEqual (IntegerVariable i, IntegerValue bound)
 
static IntegerLiteral TrueLiteral ()
 
static IntegerLiteral FalseLiteral ()
 

Public Attributes

IntegerVariable var = kNoIntegerVariable
 
IntegerValue bound = IntegerValue(0)
 

Detailed Description

The integer equivalent of a literal. It represents an IntegerVariable and an upper/lower bound on it.

Overflow: all the bounds below kMinIntegerValue and kMaxIntegerValue are treated as kMinIntegerValue - 1 and kMaxIntegerValue + 1.

Definition at line 218 of file integer.h.

Constructor & Destructor Documentation

◆ IntegerLiteral() [1/2]

operations_research::sat::IntegerLiteral::IntegerLiteral ( )
inline

Clients should prefer the static construction methods above.

Definition at line 234 of file integer.h.

◆ IntegerLiteral() [2/2]

operations_research::sat::IntegerLiteral::IntegerLiteral ( IntegerVariable v,
IntegerValue b )
inline

Definition at line 235 of file integer.h.

Member Function Documentation

◆ DebugString()

std::string operations_research::sat::IntegerLiteral::DebugString ( ) const
inline

Definition at line 254 of file integer.h.

◆ FalseLiteral()

IntegerLiteral operations_research::sat::IntegerLiteral::FalseLiteral ( )
inlinestatic

Definition at line 1683 of file integer.h.

◆ GreaterOrEqual()

IntegerLiteral operations_research::sat::IntegerLiteral::GreaterOrEqual ( IntegerVariable i,
IntegerValue bound )
inlinestatic

Because IntegerLiteral should never be created at a bound less constrained than an existing IntegerVariable bound, we don't allow GreaterOrEqual() to have a bound lower than kMinIntegerValue, and LowerOrEqual() to have a bound greater than kMaxIntegerValue. The other side is not constrained to allow for a computed bound to overflow. Note that both the full initial domain and the empty domain can always be represented.

Implementation.

Definition at line 1667 of file integer.h.

◆ IsAlwaysFalse()

bool operations_research::sat::IntegerLiteral::IsAlwaysFalse ( ) const
inline

Definition at line 242 of file integer.h.

◆ IsAlwaysTrue()

bool operations_research::sat::IntegerLiteral::IsAlwaysTrue ( ) const
inline

Definition at line 241 of file integer.h.

◆ IsValid()

bool operations_research::sat::IntegerLiteral::IsValid ( ) const
inline

Definition at line 240 of file integer.h.

◆ LowerOrEqual()

IntegerLiteral operations_research::sat::IntegerLiteral::LowerOrEqual ( IntegerVariable i,
IntegerValue bound )
inlinestatic

Definition at line 1673 of file integer.h.

◆ Negated()

IntegerLiteral operations_research::sat::IntegerLiteral::Negated ( ) const
inline

The negation of x >= bound is x <= bound - 1.

Note
bound >= kMinIntegerValue, so -bound + 1 will have the correct capped value.

Definition at line 1687 of file integer.h.

◆ operator!=()

bool operations_research::sat::IntegerLiteral::operator!= ( IntegerLiteral o) const
inline

Definition at line 250 of file integer.h.

◆ operator==()

bool operations_research::sat::IntegerLiteral::operator== ( IntegerLiteral o) const
inline

Definition at line 247 of file integer.h.

◆ TrueLiteral()

IntegerLiteral operations_research::sat::IntegerLiteral::TrueLiteral ( )
inlinestatic

These two static integer literals represent an always true and an always false condition.

Definition at line 1679 of file integer.h.

Member Data Documentation

◆ bound

IntegerValue operations_research::sat::IntegerLiteral::bound = IntegerValue(0)

Definition at line 262 of file integer.h.

◆ var

IntegerVariable operations_research::sat::IntegerLiteral::var = kNoIntegerVariable
Note
bound should be in [kMinIntegerValue, kMaxIntegerValue + 1].

Definition at line 261 of file integer.h.


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