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

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 195 of file integer_base.h.

#include <integer_base.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)

Constructor & Destructor Documentation

◆ IntegerLiteral() [1/2]

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

Clients should prefer the static construction methods above.

Definition at line 211 of file integer_base.h.

◆ IntegerLiteral() [2/2]

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

Definition at line 212 of file integer_base.h.

Member Function Documentation

◆ DebugString()

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

Definition at line 231 of file integer_base.h.

◆ FalseLiteral()

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

Definition at line 537 of file integer_base.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 521 of file integer_base.h.

◆ IsAlwaysFalse()

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

Definition at line 219 of file integer_base.h.

◆ IsAlwaysTrue()

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

Definition at line 218 of file integer_base.h.

◆ IsValid()

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

Definition at line 217 of file integer_base.h.

◆ LowerOrEqual()

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

Definition at line 527 of file integer_base.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 541 of file integer_base.h.

◆ operator!=()

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

Definition at line 227 of file integer_base.h.

◆ operator==()

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

Definition at line 224 of file integer_base.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 533 of file integer_base.h.

Member Data Documentation

◆ bound

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

Definition at line 239 of file integer_base.h.

◆ var

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

Definition at line 238 of file integer_base.h.


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