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

A builder class for linear expressions. More...

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

Public Member Functions

 LinearExprBuilder (int sizeHint=2)
 
LinearExprBuilder Add (LinearExpr expr)
 Adds expr to the builder.
 
LinearExprBuilder Add (double constant)
 Adds constant to the builder.
 
LinearExprBuilder AddTerm (LinearExpr expr, double coefficient)
 Adds expr * coefficient to the builder.
 
LinearExprBuilder AddSum (IEnumerable< LinearExpr > exprs)
 Adds sum(exprs) to the builder.
 
LinearExprBuilder AddWeightedSum (IEnumerable< LinearExpr > exprs, IEnumerable< double > coefficients)
 Adds sum(exprs[i] * coeffs[i]) 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.
 
override string ToString ()
 

Properties

double Offset [get]
 
List< TermTerms [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from Google.OrTools.ModelBuilder.LinearExpr
static LinearExpr Sum (IEnumerable< LinearExpr > exprs)
 Creates Sum(exprs).
 
static LinearExpr WeightedSum (IEnumerable< LinearExpr > exprs, IEnumerable< int > coeffs)
 Creates Sum(exprs[i] * coeffs[i]).
 
static LinearExpr WeightedSum (IEnumerable< LinearExpr > exprs, IEnumerable< double > coeffs)
 Creates Sum(exprs[i] * coeffs[i]).
 
static LinearExpr Term (LinearExpr expr, double coeff)
 Creates expr * coeff.
 
static LinearExpr Affine (LinearExpr expr, double coeff, double offset)
 Creates expr * coeff + offset.
 
static LinearExpr Constant (double 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, double v)
 
static LinearExpr operator+ (double v, LinearExpr a)
 
static LinearExpr operator- (LinearExpr a, LinearExpr b)
 
static LinearExpr operator- (LinearExpr a, double v)
 
static LinearExpr operator- (double v, LinearExpr a)
 
static LinearExpr operator* (LinearExpr a, double v)
 
static LinearExpr operator* (double 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, double v)
 
static BoundedLinearExpression operator!= (LinearExpr a, double v)
 
static BoundedLinearExpression operator>= (LinearExpr a, double v)
 
static BoundedLinearExpression operator>= (double v, LinearExpr a)
 
static BoundedLinearExpression operator<= (LinearExpr a, double v)
 
static BoundedLinearExpression operator<= (double v, LinearExpr a)
 
static BoundedLinearExpression operator>= (LinearExpr a, LinearExpr b)
 
static BoundedLinearExpression operator<= (LinearExpr a, LinearExpr b)
 
- Static Package Functions inherited from Google.OrTools.ModelBuilder.LinearExpr

Detailed Description

A builder class for linear expressions.

Definition at line 310 of file ModelBuilderExpr.cs.

Constructor & Destructor Documentation

◆ LinearExprBuilder()

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

Definition at line 312 of file ModelBuilderExpr.cs.

Member Function Documentation

◆ Add() [1/2]

LinearExprBuilder Google.OrTools.ModelBuilder.LinearExprBuilder.Add ( double constant)
inline

Adds constant to the builder.

Definition at line 325 of file ModelBuilderExpr.cs.

◆ Add() [2/2]

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

Adds expr to the builder.

Definition at line 319 of file ModelBuilderExpr.cs.

◆ AddSum()

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

Adds sum(exprs) to the builder.

Definition at line 339 of file ModelBuilderExpr.cs.

◆ AddTerm()

LinearExprBuilder Google.OrTools.ModelBuilder.LinearExprBuilder.AddTerm ( LinearExpr expr,
double coefficient )
inline

Adds expr * coefficient to the builder.

Definition at line 332 of file ModelBuilderExpr.cs.

◆ AddWeightedSum() [1/3]

LinearExprBuilder Google.OrTools.ModelBuilder.LinearExprBuilder.AddWeightedSum ( IEnumerable< LinearExpr > exprs,
IEnumerable< double > coefficients )
inline

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

Definition at line 350 of file ModelBuilderExpr.cs.

◆ AddWeightedSum() [2/3]

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

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

Definition at line 372 of file ModelBuilderExpr.cs.

◆ AddWeightedSum() [3/3]

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

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

Definition at line 361 of file ModelBuilderExpr.cs.

◆ ToString()

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

Definition at line 381 of file ModelBuilderExpr.cs.

Property Documentation

◆ Offset

double Google.OrTools.ModelBuilder.LinearExprBuilder.Offset
get

Definition at line 457 of file ModelBuilderExpr.cs.

◆ Terms

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

Definition at line 464 of file ModelBuilderExpr.cs.


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