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

Detailed Description

Definition at line 361 of file integer_base.h.

#include <integer_base.h>

Public Member Functions

 LinearExpression2 ()=default
 LinearExpression2 (IntegerVariable v1, IntegerVariable v2, IntegerValue c1, IntegerValue c2)
void Negate ()
void SimpleCanonicalization ()
bool CanonicalizeAndUpdateBounds (IntegerValue &lb, IntegerValue &ub)
AffineExpression GetAffineLowerBound (int var_index, IntegerValue expr_lb, IntegerValue other_var_lb) const
IntegerValue DivideByGcd ()
bool IsCanonicalized () const
bool NegateForCanonicalization ()
void MakeVariablesPositive ()
absl::Span< const IntegerVariable > non_zero_vars () const
absl::Span< const IntegerValue > non_zero_coeffs () const
bool operator== (const LinearExpression2 &o) const
bool operator< (const LinearExpression2 &o) const

Static Public Member Functions

static LinearExpression2 Difference (IntegerVariable v1, IntegerVariable v2)

Public Attributes

IntegerValue coeffs [2]
IntegerVariable vars [2] = {kNoIntegerVariable, kNoIntegerVariable}

Friends

template<typename Sink>
void AbslStringify (Sink &sink, const LinearExpression2 &expr)

Constructor & Destructor Documentation

◆ LinearExpression2() [1/2]

operations_research::sat::LinearExpression2::LinearExpression2 ( )
default

◆ LinearExpression2() [2/2]

operations_research::sat::LinearExpression2::LinearExpression2 ( IntegerVariable v1,
IntegerVariable v2,
IntegerValue c1,
IntegerValue c2 )
inline

Definition at line 365 of file integer_base.h.

Member Function Documentation

◆ CanonicalizeAndUpdateBounds()

bool operations_research::sat::LinearExpression2::CanonicalizeAndUpdateBounds ( IntegerValue & lb,
IntegerValue & ub )

Definition at line 87 of file integer_base.cc.

◆ Difference()

LinearExpression2 operations_research::sat::LinearExpression2::Difference ( IntegerVariable v1,
IntegerVariable v2 )
inlinestatic

Definition at line 374 of file integer_base.h.

◆ DivideByGcd()

IntegerValue operations_research::sat::LinearExpression2::DivideByGcd ( )

Definition at line 64 of file integer_base.cc.

◆ GetAffineLowerBound()

AffineExpression operations_research::sat::LinearExpression2::GetAffineLowerBound ( int var_index,
IntegerValue expr_lb,
IntegerValue other_var_lb ) const

Definition at line 135 of file integer_base.cc.

◆ IsCanonicalized()

bool operations_research::sat::LinearExpression2::IsCanonicalized ( ) const

Definition at line 117 of file integer_base.cc.

◆ MakeVariablesPositive()

void operations_research::sat::LinearExpression2::MakeVariablesPositive ( )

Definition at line 174 of file integer_base.cc.

◆ Negate()

void operations_research::sat::LinearExpression2::Negate ( )
inline

Definition at line 379 of file integer_base.h.

◆ NegateForCanonicalization()

bool operations_research::sat::LinearExpression2::NegateForCanonicalization ( )

Definition at line 74 of file integer_base.cc.

◆ non_zero_coeffs()

absl::Span< const IntegerValue > operations_research::sat::LinearExpression2::non_zero_coeffs ( ) const
inline

Definition at line 428 of file integer_base.h.

◆ non_zero_vars()

absl::Span< const IntegerVariable > operations_research::sat::LinearExpression2::non_zero_vars ( ) const
inline

Definition at line 422 of file integer_base.h.

◆ operator<()

bool operations_research::sat::LinearExpression2::operator< ( const LinearExpression2 & o) const
inline

Definition at line 439 of file integer_base.h.

◆ operator==()

bool operations_research::sat::LinearExpression2::operator== ( const LinearExpression2 & o) const
inline

Definition at line 434 of file integer_base.h.

◆ SimpleCanonicalization()

void operations_research::sat::LinearExpression2::SimpleCanonicalization ( )

Definition at line 28 of file integer_base.cc.

◆ AbslStringify

template<typename Sink>
void AbslStringify ( Sink & sink,
const LinearExpression2 & expr )
friend

Definition at line 448 of file integer_base.h.

Member Data Documentation

◆ coeffs

IntegerValue operations_research::sat::LinearExpression2::coeffs[2]

Definition at line 444 of file integer_base.h.

◆ vars

IntegerVariable operations_research::sat::LinearExpression2::vars[2] = {kNoIntegerVariable, kNoIntegerVariable}

Definition at line 445 of file integer_base.h.


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