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

A builder class for linear expressions. More...

Inheritance diagram for Google.OrTools.Sat.LinearExprBuilder:
Google.OrTools.Sat.LinearExpr

Public Member Functions

 LinearExprBuilder (int sizeHint=2)
 
LinearExprBuilder Add (LinearExpr expr)
 Adds expr to the builder.
 
LinearExprBuilder Add (ILiteral literal)
 Adds literal to the builder.
 
LinearExprBuilder Add (BoolVar var)
 Adds var to the builder.
 
LinearExprBuilder Add (long constant)
 Adds constant to the builder.
 
LinearExprBuilder AddTerm (LinearExpr expr, long coefficient)
 Adds expr * coefficient to the builder.
 
LinearExprBuilder AddTerm (ILiteral literal, long coefficient)
 Adds literal * coefficient to the builder.
 
LinearExprBuilder AddTerm (BoolVar var, long coefficient)
 Adds var * coefficient to the builder.
 
LinearExprBuilder AddSum (IEnumerable< LinearExpr > exprs)
 Adds sum(exprs) to the builder.
 
LinearExprBuilder AddSum (IEnumerable< ILiteral > literals)
 Adds sum(literals) to the builder.
 
LinearExprBuilder AddSum (IEnumerable< BoolVar > vars)
 Adds sum(vars) to the builder.
 
LinearExprBuilder AddWeightedSum (IEnumerable< LinearExpr > exprs, IEnumerable< long > coefficients)
 Adds sum(exprs[i] * coeffs[i]) to the builder.
 
LinearExprBuilder AddWeightedSum (IEnumerable< LinearExpr > exprs, IEnumerable< int > coefficients)
 Adds sum(exprs[i] * coeffs[i]) to the builder.
 
LinearExprBuilder AddWeightedSum (IEnumerable< ILiteral > literals, IEnumerable< int > coefficients)
 Adds sum(literals[i] * coeffs[i]) to the builder.
 
LinearExprBuilder AddWeightedSum (IEnumerable< ILiteral > literals, IEnumerable< long > coefficients)
 Adds sum(literals[i] * coeffs[i]) to the builder.
 
LinearExprBuilder AddWeightedSum (IEnumerable< BoolVar > vars, IEnumerable< long > coefficients)
 Adds sum(vars[i] * coeffs[i]) to the builder.
 
LinearExprBuilder AddWeightedSum (IEnumerable< BoolVar > vars, IEnumerable< int > coefficients)
 Adds sum(vars[i] * coeffs[i]) to the builder.
 
override string ToString ()
 

Properties

long Offset [get]
 
List< TermTerms [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from Google.OrTools.Sat.LinearExpr
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)
 
- Static Package Functions inherited from Google.OrTools.Sat.LinearExpr

Detailed Description

A builder class for linear expressions.

Definition at line 444 of file IntegerExpressions.cs.

Constructor & Destructor Documentation

◆ LinearExprBuilder()

Google.OrTools.Sat.LinearExprBuilder.LinearExprBuilder ( int sizeHint = 2)
inline

Definition at line 446 of file IntegerExpressions.cs.

Member Function Documentation

◆ Add() [1/4]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.Add ( BoolVar var)
inline

Adds var to the builder.

Definition at line 465 of file IntegerExpressions.cs.

◆ Add() [2/4]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.Add ( ILiteral literal)
inline

Adds literal to the builder.

Definition at line 459 of file IntegerExpressions.cs.

◆ Add() [3/4]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.Add ( LinearExpr expr)
inline

Adds expr to the builder.

Definition at line 453 of file IntegerExpressions.cs.

◆ Add() [4/4]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.Add ( long constant)
inline

Adds constant to the builder.

Definition at line 471 of file IntegerExpressions.cs.

◆ AddSum() [1/3]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.AddSum ( IEnumerable< BoolVar > vars)
inline

Adds sum(vars) to the builder.

Definition at line 529 of file IntegerExpressions.cs.

◆ AddSum() [2/3]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.AddSum ( IEnumerable< ILiteral > literals)
inline

Adds sum(literals) to the builder.

Definition at line 518 of file IntegerExpressions.cs.

◆ AddSum() [3/3]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.AddSum ( IEnumerable< LinearExpr > exprs)
inline

Adds sum(exprs) to the builder.

Definition at line 507 of file IntegerExpressions.cs.

◆ AddTerm() [1/3]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.AddTerm ( BoolVar var,
long coefficient )
inline

Adds var * coefficient to the builder.

Definition at line 500 of file IntegerExpressions.cs.

◆ AddTerm() [2/3]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.AddTerm ( ILiteral literal,
long coefficient )
inline

Adds literal * coefficient to the builder.

Definition at line 485 of file IntegerExpressions.cs.

◆ AddTerm() [3/3]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.AddTerm ( LinearExpr expr,
long coefficient )
inline

Adds expr * coefficient to the builder.

Definition at line 478 of file IntegerExpressions.cs.

◆ AddWeightedSum() [1/6]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.AddWeightedSum ( IEnumerable< BoolVar > vars,
IEnumerable< int > coefficients )
inline

Adds sum(vars[i] * coeffs[i]) to the builder.

Definition at line 595 of file IntegerExpressions.cs.

◆ AddWeightedSum() [2/6]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.AddWeightedSum ( IEnumerable< BoolVar > vars,
IEnumerable< long > coefficients )
inline

Adds sum(vars[i] * coeffs[i]) to the builder.

Definition at line 584 of file IntegerExpressions.cs.

◆ AddWeightedSum() [3/6]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.AddWeightedSum ( IEnumerable< ILiteral > literals,
IEnumerable< int > coefficients )
inline

Adds sum(literals[i] * coeffs[i]) to the builder.

Definition at line 562 of file IntegerExpressions.cs.

◆ AddWeightedSum() [4/6]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.AddWeightedSum ( IEnumerable< ILiteral > literals,
IEnumerable< long > coefficients )
inline

Adds sum(literals[i] * coeffs[i]) to the builder.

Definition at line 573 of file IntegerExpressions.cs.

◆ AddWeightedSum() [5/6]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.AddWeightedSum ( IEnumerable< LinearExpr > exprs,
IEnumerable< int > coefficients )
inline

Adds sum(exprs[i] * coeffs[i]) to the builder.

Definition at line 551 of file IntegerExpressions.cs.

◆ AddWeightedSum() [6/6]

LinearExprBuilder Google.OrTools.Sat.LinearExprBuilder.AddWeightedSum ( IEnumerable< LinearExpr > exprs,
IEnumerable< long > coefficients )
inline

Adds sum(exprs[i] * coeffs[i]) to the builder.

Definition at line 540 of file IntegerExpressions.cs.

◆ ToString()

override string Google.OrTools.Sat.LinearExprBuilder.ToString ( )
inline

Definition at line 605 of file IntegerExpressions.cs.

Property Documentation

◆ Offset

long Google.OrTools.Sat.LinearExprBuilder.Offset
get

Definition at line 693 of file IntegerExpressions.cs.

◆ Terms

List<Term> Google.OrTools.Sat.LinearExprBuilder.Terms
get

Definition at line 700 of file IntegerExpressions.cs.


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