Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Google.OrTools.Sat.LinearExpr Class Reference

Holds a linear expression: sum (ai * xi) + b. More...

Inheritance diagram for Google.OrTools.Sat.LinearExpr:
Google.OrTools.Sat.IntVar Google.OrTools.Sat.LinearExprBuilder Google.OrTools.Sat.NotBoolVar Google.OrTools.Sat.BoolVar

Static Public Member Functions

static LinearExpr Sum (IEnumerable< LinearExpr > exprs)
 Creates Sum(exprs).
 
static LinearExpr Sum (IEnumerable< ILiteral > literals)
 Creates Sum(literals).
 
static LinearExpr Sum (IEnumerable< BoolVar > vars)
 Creates Sum(vars).
 
static LinearExpr WeightedSum (IEnumerable< LinearExpr > exprs, IEnumerable< int > coeffs)
 Creates Sum(exprs[i] * coeffs[i]).
 
static LinearExpr WeightedSum (IEnumerable< LinearExpr > exprs, IEnumerable< long > coeffs)
 Creates Sum(exprs[i] * coeffs[i]).
 
static LinearExpr WeightedSum (IEnumerable< ILiteral > literals, IEnumerable< int > coeffs)
 Creates Sum(literals[i] * coeffs[i]).
 
static LinearExpr WeightedSum (IEnumerable< ILiteral > literals, IEnumerable< long > coeffs)
 Creates Sum(literals[i] * coeffs[i]).
 
static LinearExpr WeightedSum (IEnumerable< BoolVar > vars, IEnumerable< int > coeffs)
 Creates Sum(vars[i] * coeffs[i]).
 
static LinearExpr WeightedSum (IEnumerable< BoolVar > vars, IEnumerable< long > coeffs)
 Creates Sum(vars[i] * coeffs[i]).
 
static LinearExpr Term (LinearExpr expr, long coeff)
 Creates expr * coeff.
 
static LinearExpr Term (ILiteral literal, long coeff)
 Creates literal * coeff.
 
static LinearExpr Term (BoolVar var, long coeff)
 Creates var * coeff.
 
static LinearExpr Affine (LinearExpr expr, long coeff, long offset)
 Creates expr * coeff + offset.
 
static LinearExpr Affine (ILiteral literal, long coeff, long offset)
 Creates literal * coeff + offset.
 
static LinearExpr Affine (BoolVar var, long coeff, long offset)
 Creates var * coeff + offset.
 
static LinearExpr Constant (long value)
 Creates a constant expression.
 
static LinearExprBuilder NewBuilder (int sizeHint=2)
 Creates a builder class for linear expression.
 
static LinearExpr operator+ (LinearExpr a, LinearExpr b)
 
static LinearExpr operator+ (LinearExpr a, long v)
 
static LinearExpr operator+ (long v, LinearExpr a)
 
static LinearExpr operator- (LinearExpr a, LinearExpr b)
 
static LinearExpr operator- (LinearExpr a, long v)
 
static LinearExpr operator- (long v, LinearExpr a)
 
static LinearExpr operator* (LinearExpr a, long v)
 
static LinearExpr operator* (long v, LinearExpr a)
 
static LinearExpr operator- (LinearExpr a)
 
static BoundedLinearExpression operator== (LinearExpr a, LinearExpr b)
 
static BoundedLinearExpression operator!= (LinearExpr a, LinearExpr b)
 
static BoundedLinearExpression operator== (LinearExpr a, long v)
 
static BoundedLinearExpression operator!= (LinearExpr a, long v)
 
static BoundedLinearExpression operator>= (LinearExpr a, long v)
 
static BoundedLinearExpression operator>= (long v, LinearExpr a)
 
static BoundedLinearExpression operator> (LinearExpr a, long v)
 
static BoundedLinearExpression operator> (long v, LinearExpr a)
 
static BoundedLinearExpression operator<= (LinearExpr a, long v)
 
static BoundedLinearExpression operator<= (long v, LinearExpr a)
 
static BoundedLinearExpression operator< (LinearExpr a, long v)
 
static BoundedLinearExpression operator< (long v, LinearExpr a)
 
static BoundedLinearExpression operator>= (LinearExpr a, LinearExpr b)
 
static BoundedLinearExpression operator> (LinearExpr a, LinearExpr b)
 
static BoundedLinearExpression operator<= (LinearExpr a, LinearExpr b)
 
static BoundedLinearExpression operator< (LinearExpr a, LinearExpr b)
 

Detailed Description

Holds a linear expression: sum (ai * xi) + b.

Definition at line 109 of file IntegerExpressions.cs.

Member Function Documentation

◆ Affine() [1/3]

static LinearExpr Google.OrTools.Sat.LinearExpr.Affine ( BoolVar var,
long coeff,
long offset )
inlinestatic

Creates var * coeff + offset.

Definition at line 207 of file IntegerExpressions.cs.

◆ Affine() [2/3]

static LinearExpr Google.OrTools.Sat.LinearExpr.Affine ( ILiteral literal,
long coeff,
long offset )
inlinestatic

Creates literal * coeff + offset.

Definition at line 201 of file IntegerExpressions.cs.

◆ Affine() [3/3]

static LinearExpr Google.OrTools.Sat.LinearExpr.Affine ( LinearExpr expr,
long coeff,
long offset )
inlinestatic

Creates expr * coeff + offset.

Definition at line 191 of file IntegerExpressions.cs.

◆ Constant()

static LinearExpr Google.OrTools.Sat.LinearExpr.Constant ( long value)
inlinestatic

Creates a constant expression.

Definition at line 213 of file IntegerExpressions.cs.

◆ NewBuilder()

static LinearExprBuilder Google.OrTools.Sat.LinearExpr.NewBuilder ( int sizeHint = 2)
inlinestatic

Creates a builder class for linear expression.

Definition at line 219 of file IntegerExpressions.cs.

◆ operator!=() [1/2]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator!= ( LinearExpr a,
LinearExpr b )
inlinestatic

Definition at line 274 of file IntegerExpressions.cs.

◆ operator!=() [2/2]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator!= ( LinearExpr a,
long v )
inlinestatic

Definition at line 284 of file IntegerExpressions.cs.

◆ operator*() [1/2]

static LinearExpr Google.OrTools.Sat.LinearExpr.operator* ( LinearExpr a,
long v )
inlinestatic

Definition at line 254 of file IntegerExpressions.cs.

◆ operator*() [2/2]

static LinearExpr Google.OrTools.Sat.LinearExpr.operator* ( long v,
LinearExpr a )
inlinestatic

Definition at line 259 of file IntegerExpressions.cs.

◆ operator+() [1/3]

static LinearExpr Google.OrTools.Sat.LinearExpr.operator+ ( LinearExpr a,
LinearExpr b )
inlinestatic

Definition at line 224 of file IntegerExpressions.cs.

◆ operator+() [2/3]

static LinearExpr Google.OrTools.Sat.LinearExpr.operator+ ( LinearExpr a,
long v )
inlinestatic

Definition at line 229 of file IntegerExpressions.cs.

◆ operator+() [3/3]

static LinearExpr Google.OrTools.Sat.LinearExpr.operator+ ( long v,
LinearExpr a )
inlinestatic

Definition at line 234 of file IntegerExpressions.cs.

◆ operator-() [1/4]

static LinearExpr Google.OrTools.Sat.LinearExpr.operator- ( LinearExpr a)
inlinestatic

Definition at line 264 of file IntegerExpressions.cs.

◆ operator-() [2/4]

static LinearExpr Google.OrTools.Sat.LinearExpr.operator- ( LinearExpr a,
LinearExpr b )
inlinestatic

Definition at line 239 of file IntegerExpressions.cs.

◆ operator-() [3/4]

static LinearExpr Google.OrTools.Sat.LinearExpr.operator- ( LinearExpr a,
long v )
inlinestatic

Definition at line 244 of file IntegerExpressions.cs.

◆ operator-() [4/4]

static LinearExpr Google.OrTools.Sat.LinearExpr.operator- ( long v,
LinearExpr a )
inlinestatic

Definition at line 249 of file IntegerExpressions.cs.

◆ operator<() [1/3]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator< ( LinearExpr a,
LinearExpr b )
inlinestatic

Definition at line 344 of file IntegerExpressions.cs.

◆ operator<() [2/3]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator< ( LinearExpr a,
long v )
inlinestatic

Definition at line 319 of file IntegerExpressions.cs.

◆ operator<() [3/3]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator< ( long v,
LinearExpr a )
inlinestatic

Definition at line 324 of file IntegerExpressions.cs.

◆ operator<=() [1/3]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator<= ( LinearExpr a,
LinearExpr b )
inlinestatic

Definition at line 339 of file IntegerExpressions.cs.

◆ operator<=() [2/3]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator<= ( LinearExpr a,
long v )
inlinestatic

Definition at line 309 of file IntegerExpressions.cs.

◆ operator<=() [3/3]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator<= ( long v,
LinearExpr a )
inlinestatic

Definition at line 314 of file IntegerExpressions.cs.

◆ operator==() [1/2]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator== ( LinearExpr a,
LinearExpr b )
inlinestatic

Definition at line 269 of file IntegerExpressions.cs.

◆ operator==() [2/2]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator== ( LinearExpr a,
long v )
inlinestatic

Definition at line 279 of file IntegerExpressions.cs.

◆ operator>() [1/3]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator> ( LinearExpr a,
LinearExpr b )
inlinestatic

Definition at line 334 of file IntegerExpressions.cs.

◆ operator>() [2/3]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator> ( LinearExpr a,
long v )
inlinestatic

Definition at line 299 of file IntegerExpressions.cs.

◆ operator>() [3/3]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator> ( long v,
LinearExpr a )
inlinestatic

Definition at line 304 of file IntegerExpressions.cs.

◆ operator>=() [1/3]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator>= ( LinearExpr a,
LinearExpr b )
inlinestatic

Definition at line 329 of file IntegerExpressions.cs.

◆ operator>=() [2/3]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator>= ( LinearExpr a,
long v )
inlinestatic

Definition at line 289 of file IntegerExpressions.cs.

◆ operator>=() [3/3]

static BoundedLinearExpression Google.OrTools.Sat.LinearExpr.operator>= ( long v,
LinearExpr a )
inlinestatic

Definition at line 294 of file IntegerExpressions.cs.

◆ Sum() [1/3]

static LinearExpr Google.OrTools.Sat.LinearExpr.Sum ( IEnumerable< BoolVar > vars)
inlinestatic

Creates Sum(vars).

Definition at line 124 of file IntegerExpressions.cs.

◆ Sum() [2/3]

static LinearExpr Google.OrTools.Sat.LinearExpr.Sum ( IEnumerable< ILiteral > literals)
inlinestatic

Creates Sum(literals).

Definition at line 118 of file IntegerExpressions.cs.

◆ Sum() [3/3]

static LinearExpr Google.OrTools.Sat.LinearExpr.Sum ( IEnumerable< LinearExpr > exprs)
inlinestatic

Creates Sum(exprs).

Definition at line 112 of file IntegerExpressions.cs.

◆ Term() [1/3]

static LinearExpr Google.OrTools.Sat.LinearExpr.Term ( BoolVar var,
long coeff )
inlinestatic

Creates var * coeff.

Definition at line 185 of file IntegerExpressions.cs.

◆ Term() [2/3]

static LinearExpr Google.OrTools.Sat.LinearExpr.Term ( ILiteral literal,
long coeff )
inlinestatic

Creates literal * coeff.

Definition at line 172 of file IntegerExpressions.cs.

◆ Term() [3/3]

static LinearExpr Google.OrTools.Sat.LinearExpr.Term ( LinearExpr expr,
long coeff )
inlinestatic

Creates expr * coeff.

Definition at line 166 of file IntegerExpressions.cs.

◆ WeightedSum() [1/6]

static LinearExpr Google.OrTools.Sat.LinearExpr.WeightedSum ( IEnumerable< BoolVar > vars,
IEnumerable< int > coeffs )
inlinestatic

Creates Sum(vars[i] * coeffs[i]).

Definition at line 154 of file IntegerExpressions.cs.

◆ WeightedSum() [2/6]

static LinearExpr Google.OrTools.Sat.LinearExpr.WeightedSum ( IEnumerable< BoolVar > vars,
IEnumerable< long > coeffs )
inlinestatic

Creates Sum(vars[i] * coeffs[i]).

Definition at line 160 of file IntegerExpressions.cs.

◆ WeightedSum() [3/6]

static LinearExpr Google.OrTools.Sat.LinearExpr.WeightedSum ( IEnumerable< ILiteral > literals,
IEnumerable< int > coeffs )
inlinestatic

Creates Sum(literals[i] * coeffs[i]).

Definition at line 142 of file IntegerExpressions.cs.

◆ WeightedSum() [4/6]

static LinearExpr Google.OrTools.Sat.LinearExpr.WeightedSum ( IEnumerable< ILiteral > literals,
IEnumerable< long > coeffs )
inlinestatic

Creates Sum(literals[i] * coeffs[i]).

Definition at line 148 of file IntegerExpressions.cs.

◆ WeightedSum() [5/6]

static LinearExpr Google.OrTools.Sat.LinearExpr.WeightedSum ( IEnumerable< LinearExpr > exprs,
IEnumerable< int > coeffs )
inlinestatic

Creates Sum(exprs[i] * coeffs[i]).

Definition at line 130 of file IntegerExpressions.cs.

◆ WeightedSum() [6/6]

static LinearExpr Google.OrTools.Sat.LinearExpr.WeightedSum ( IEnumerable< LinearExpr > exprs,
IEnumerable< long > coeffs )
inlinestatic

Creates Sum(exprs[i] * coeffs[i]).

Definition at line 136 of file IntegerExpressions.cs.


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