class

ORTools::Sat::LinearExpression

Inherits Reference < Object

LinearExpression class provides an expression of variables and fixed coefficients The expression is used as input to constraints that accept linear expressions

Constructors

new(variables : Array(Int32) = [] of Int32, coefficients : Array(Int64) = [] of Int64, constant : Int64 = 0_i64)
Source

Class methods

zero

Needed to allow sum of an array of LinearExpression

Source

Instance methods

!=(other : Expressible)
Source
+(other : Expressible)
Source
-(other : Expressible)
Source
<(other : Expressible)
Source
<=(other : Expressible)
Source
==(other : Expressible)
Source
>(other : Expressible)
Source
>=(other : Expressible)
Source
coefficients
Source
constant
Source
normalize

Combines duplicate variables by summing their coefficients and drops any term whose coefficient is zero; the constant is preserved. Returns a new, equivalent expression in which each variable appears at most once. This keeps expressions like x + x from emitting a proto with repeated variable references.

Source
proto
Source
to_lexpr
Source
variables
Source