DotNet Reference

.Net Reference

Detailed Description

A builder class for linear expressions.

Definition at line 442 of file IntegerExpressions.cs.

Public Member Functions

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

Static Public Member Functions

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

Properties

long Offset [get]
 
List< TermTerms [get]
 

Constructor & Destructor Documentation

◆ LinearExprBuilder()

LinearExprBuilder ( int  sizeHint = 2)
inline

Definition at line 444 of file IntegerExpressions.cs.

Member Function Documentation

◆ Add() [1/4]

LinearExprBuilder Add ( BoolVar  var)
inline

Adds var to the builder.

Definition at line 463 of file IntegerExpressions.cs.

◆ Add() [2/4]

LinearExprBuilder Add ( ILiteral  literal)
inline

Adds literal to the builder.

Definition at line 457 of file IntegerExpressions.cs.

◆ Add() [3/4]

LinearExprBuilder Add ( LinearExpr  expr)
inline

Adds expr to the builder.

Definition at line 451 of file IntegerExpressions.cs.

◆ Add() [4/4]

LinearExprBuilder Add ( long  constant)
inline

Adds constant to the builder.

Definition at line 469 of file IntegerExpressions.cs.

◆ AddSum() [1/3]

LinearExprBuilder AddSum ( IEnumerable< BoolVar vars)
inline

Adds sum(vars) to the builder.

Definition at line 527 of file IntegerExpressions.cs.

◆ AddSum() [2/3]

LinearExprBuilder AddSum ( IEnumerable< ILiteral literals)
inline

Adds sum(literals) to the builder.

Definition at line 516 of file IntegerExpressions.cs.

◆ AddSum() [3/3]

LinearExprBuilder AddSum ( IEnumerable< LinearExpr exprs)
inline

Adds sum(exprs) to the builder.

Definition at line 505 of file IntegerExpressions.cs.

◆ AddTerm() [1/3]

LinearExprBuilder AddTerm ( BoolVar  var,
long  coefficient 
)
inline

Adds var * coefficient to the builder.

Definition at line 498 of file IntegerExpressions.cs.

◆ AddTerm() [2/3]

LinearExprBuilder AddTerm ( ILiteral  literal,
long  coefficient 
)
inline

Adds literal * coefficient to the builder.

Definition at line 483 of file IntegerExpressions.cs.

◆ AddTerm() [3/3]

LinearExprBuilder AddTerm ( LinearExpr  expr,
long  coefficient 
)
inline

Adds expr * coefficient to the builder.

Definition at line 476 of file IntegerExpressions.cs.

◆ AddWeightedSum() [1/6]

LinearExprBuilder AddWeightedSum ( IEnumerable< BoolVar vars,
IEnumerable< int >  coefficients 
)
inline

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

Definition at line 593 of file IntegerExpressions.cs.

◆ AddWeightedSum() [2/6]

LinearExprBuilder AddWeightedSum ( IEnumerable< BoolVar vars,
IEnumerable< long >  coefficients 
)
inline

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

Definition at line 582 of file IntegerExpressions.cs.

◆ AddWeightedSum() [3/6]

LinearExprBuilder AddWeightedSum ( IEnumerable< ILiteral literals,
IEnumerable< int >  coefficients 
)
inline

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

Definition at line 560 of file IntegerExpressions.cs.

◆ AddWeightedSum() [4/6]

LinearExprBuilder AddWeightedSum ( IEnumerable< ILiteral literals,
IEnumerable< long >  coefficients 
)
inline

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

Definition at line 571 of file IntegerExpressions.cs.

◆ AddWeightedSum() [5/6]

LinearExprBuilder AddWeightedSum ( IEnumerable< LinearExpr exprs,
IEnumerable< int >  coefficients 
)
inline

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

Definition at line 549 of file IntegerExpressions.cs.

◆ AddWeightedSum() [6/6]

LinearExprBuilder AddWeightedSum ( IEnumerable< LinearExpr exprs,
IEnumerable< long >  coefficients 
)
inline

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

Definition at line 538 of file IntegerExpressions.cs.

◆ Affine() [1/3]

static LinearExpr Affine ( BoolVar  var,
long  coeff,
long  offset 
)
inlinestaticinherited

Creates var * coeff + offset.

Definition at line 205 of file IntegerExpressions.cs.

◆ Affine() [2/3]

static LinearExpr Affine ( ILiteral  literal,
long  coeff,
long  offset 
)
inlinestaticinherited

Creates literal * coeff + offset.

Definition at line 199 of file IntegerExpressions.cs.

◆ Affine() [3/3]

static LinearExpr Affine ( LinearExpr  expr,
long  coeff,
long  offset 
)
inlinestaticinherited

Creates expr * coeff + offset.

Definition at line 189 of file IntegerExpressions.cs.

◆ Constant()

static LinearExpr Constant ( long  value)
inlinestaticinherited

Creates a constant expression.

Definition at line 211 of file IntegerExpressions.cs.

◆ NewBuilder()

static LinearExprBuilder NewBuilder ( int  sizeHint = 2)
inlinestaticinherited

Creates a builder class for linear expression.

Definition at line 217 of file IntegerExpressions.cs.

◆ operator!=() [1/2]

static BoundedLinearExpression operator!= ( LinearExpr  a,
LinearExpr  b 
)
inlinestaticinherited

Definition at line 272 of file IntegerExpressions.cs.

◆ operator!=() [2/2]

static BoundedLinearExpression operator!= ( LinearExpr  a,
long  v 
)
inlinestaticinherited

Definition at line 282 of file IntegerExpressions.cs.

◆ operator*() [1/2]

static LinearExpr operator* ( LinearExpr  a,
long  v 
)
inlinestaticinherited

Definition at line 252 of file IntegerExpressions.cs.

◆ operator*() [2/2]

static LinearExpr operator* ( long  v,
LinearExpr  a 
)
inlinestaticinherited

Definition at line 257 of file IntegerExpressions.cs.

◆ operator+() [1/3]

static LinearExpr operator+ ( LinearExpr  a,
LinearExpr  b 
)
inlinestaticinherited

Definition at line 222 of file IntegerExpressions.cs.

◆ operator+() [2/3]

static LinearExpr operator+ ( LinearExpr  a,
long  v 
)
inlinestaticinherited

Definition at line 227 of file IntegerExpressions.cs.

◆ operator+() [3/3]

static LinearExpr operator+ ( long  v,
LinearExpr  a 
)
inlinestaticinherited

Definition at line 232 of file IntegerExpressions.cs.

◆ operator-() [1/4]

static LinearExpr operator- ( LinearExpr  a)
inlinestaticinherited

Definition at line 262 of file IntegerExpressions.cs.

◆ operator-() [2/4]

static LinearExpr operator- ( LinearExpr  a,
LinearExpr  b 
)
inlinestaticinherited

Definition at line 237 of file IntegerExpressions.cs.

◆ operator-() [3/4]

static LinearExpr operator- ( LinearExpr  a,
long  v 
)
inlinestaticinherited

Definition at line 242 of file IntegerExpressions.cs.

◆ operator-() [4/4]

static LinearExpr operator- ( long  v,
LinearExpr  a 
)
inlinestaticinherited

Definition at line 247 of file IntegerExpressions.cs.

◆ operator<() [1/3]

static BoundedLinearExpression operator< ( LinearExpr  a,
LinearExpr  b 
)
inlinestaticinherited

Definition at line 342 of file IntegerExpressions.cs.

◆ operator<() [2/3]

static BoundedLinearExpression operator< ( LinearExpr  a,
long  v 
)
inlinestaticinherited

Definition at line 317 of file IntegerExpressions.cs.

◆ operator<() [3/3]

static BoundedLinearExpression operator< ( long  v,
LinearExpr  a 
)
inlinestaticinherited

Definition at line 322 of file IntegerExpressions.cs.

◆ operator<=() [1/3]

static BoundedLinearExpression operator<= ( LinearExpr  a,
LinearExpr  b 
)
inlinestaticinherited

Definition at line 337 of file IntegerExpressions.cs.

◆ operator<=() [2/3]

static BoundedLinearExpression operator<= ( LinearExpr  a,
long  v 
)
inlinestaticinherited

Definition at line 307 of file IntegerExpressions.cs.

◆ operator<=() [3/3]

static BoundedLinearExpression operator<= ( long  v,
LinearExpr  a 
)
inlinestaticinherited

Definition at line 312 of file IntegerExpressions.cs.

◆ operator==() [1/2]

static BoundedLinearExpression operator== ( LinearExpr  a,
LinearExpr  b 
)
inlinestaticinherited

Definition at line 267 of file IntegerExpressions.cs.

◆ operator==() [2/2]

static BoundedLinearExpression operator== ( LinearExpr  a,
long  v 
)
inlinestaticinherited

Definition at line 277 of file IntegerExpressions.cs.

◆ operator>() [1/3]

static BoundedLinearExpression operator> ( LinearExpr  a,
LinearExpr  b 
)
inlinestaticinherited

Definition at line 332 of file IntegerExpressions.cs.

◆ operator>() [2/3]

static BoundedLinearExpression operator> ( LinearExpr  a,
long  v 
)
inlinestaticinherited

Definition at line 297 of file IntegerExpressions.cs.

◆ operator>() [3/3]

static BoundedLinearExpression operator> ( long  v,
LinearExpr  a 
)
inlinestaticinherited

Definition at line 302 of file IntegerExpressions.cs.

◆ operator>=() [1/3]

static BoundedLinearExpression operator>= ( LinearExpr  a,
LinearExpr  b 
)
inlinestaticinherited

Definition at line 327 of file IntegerExpressions.cs.

◆ operator>=() [2/3]

static BoundedLinearExpression operator>= ( LinearExpr  a,
long  v 
)
inlinestaticinherited

Definition at line 287 of file IntegerExpressions.cs.

◆ operator>=() [3/3]

static BoundedLinearExpression operator>= ( long  v,
LinearExpr  a 
)
inlinestaticinherited

Definition at line 292 of file IntegerExpressions.cs.

◆ Sum() [1/3]

static LinearExpr Sum ( IEnumerable< BoolVar vars)
inlinestaticinherited

Creates Sum(vars).

Definition at line 122 of file IntegerExpressions.cs.

◆ Sum() [2/3]

static LinearExpr Sum ( IEnumerable< ILiteral literals)
inlinestaticinherited

Creates Sum(literals).

Definition at line 116 of file IntegerExpressions.cs.

◆ Sum() [3/3]

static LinearExpr Sum ( IEnumerable< LinearExpr exprs)
inlinestaticinherited

Creates Sum(exprs).

Definition at line 110 of file IntegerExpressions.cs.

◆ Term() [1/3]

static LinearExpr Term ( BoolVar  var,
long  coeff 
)
inlinestaticinherited

Creates var * coeff.

Definition at line 183 of file IntegerExpressions.cs.

◆ Term() [2/3]

static LinearExpr Term ( ILiteral  literal,
long  coeff 
)
inlinestaticinherited

Creates literal * coeff.

Definition at line 170 of file IntegerExpressions.cs.

◆ Term() [3/3]

static LinearExpr Term ( LinearExpr  expr,
long  coeff 
)
inlinestaticinherited

Creates expr * coeff.

Definition at line 164 of file IntegerExpressions.cs.

◆ ToString()

override string ToString ( )
inline

Definition at line 603 of file IntegerExpressions.cs.

◆ WeightedSum() [1/6]

static LinearExpr WeightedSum ( IEnumerable< BoolVar vars,
IEnumerable< int >  coeffs 
)
inlinestaticinherited

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

Definition at line 152 of file IntegerExpressions.cs.

◆ WeightedSum() [2/6]

static LinearExpr WeightedSum ( IEnumerable< BoolVar vars,
IEnumerable< long >  coeffs 
)
inlinestaticinherited

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

Definition at line 158 of file IntegerExpressions.cs.

◆ WeightedSum() [3/6]

static LinearExpr WeightedSum ( IEnumerable< ILiteral literals,
IEnumerable< int >  coeffs 
)
inlinestaticinherited

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

Definition at line 140 of file IntegerExpressions.cs.

◆ WeightedSum() [4/6]

static LinearExpr WeightedSum ( IEnumerable< ILiteral literals,
IEnumerable< long >  coeffs 
)
inlinestaticinherited

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

Definition at line 146 of file IntegerExpressions.cs.

◆ WeightedSum() [5/6]

static LinearExpr WeightedSum ( IEnumerable< LinearExpr exprs,
IEnumerable< int >  coeffs 
)
inlinestaticinherited

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

Definition at line 128 of file IntegerExpressions.cs.

◆ WeightedSum() [6/6]

static LinearExpr WeightedSum ( IEnumerable< LinearExpr exprs,
IEnumerable< long >  coeffs 
)
inlinestaticinherited

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

Definition at line 134 of file IntegerExpressions.cs.

Property Documentation

◆ Offset

long Offset
get

Definition at line 679 of file IntegerExpressions.cs.

◆ Terms

List<Term> Terms
get

Definition at line 686 of file IntegerExpressions.cs.


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