Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ortools.linear_solver.python.linear_solver_natural_api.SumArray Class Reference

Detailed Description

Represents the sum of a list of LinearExpr.

Definition at line 222 of file linear_solver_natural_api.py.

Inheritance diagram for ortools.linear_solver.python.linear_solver_natural_api.SumArray:
ortools.linear_solver.python.linear_solver_natural_api.LinearExpr

Public Member Functions

 __init__ (self, array)
 __str__ (self)
 AddSelfToCoeffMapOrStack (self, coeffs, multiplier, stack)
Public Member Functions inherited from ortools.linear_solver.python.linear_solver_natural_api.LinearExpr
 solution_value (self)
 GetCoeffs (self)
 __add__ (self, expr)
 __radd__ (self, cst)
 __sub__ (self, expr)
 __rsub__ (self, cst)
 __mul__ (self, cst)
 __rmul__ (self, cst)
 __div__ (self, cst)
 __truediv__ (self, cst)
 __neg__ (self)
 __eq__ (self, arg)
 __ge__ (self, arg)
 __le__ (self, arg)
 __lt__ (self, arg)
 __gt__ (self, arg)
 __ne__ (self, arg)

Additional Inherited Members

Static Public Attributes inherited from ortools.linear_solver.python.linear_solver_natural_api.LinearExpr
list OVERRIDDEN_OPERATOR_METHODS

Constructor & Destructor Documentation

◆ __init__()

ortools.linear_solver.python.linear_solver_natural_api.SumArray.__init__ ( self,
array )

Definition at line 225 of file linear_solver_natural_api.py.

Member Function Documentation

◆ __str__()

ortools.linear_solver.python.linear_solver_natural_api.SumArray.__str__ ( self)

Definition at line 228 of file linear_solver_natural_api.py.

◆ AddSelfToCoeffMapOrStack()

ortools.linear_solver.python.linear_solver_natural_api.SumArray.AddSelfToCoeffMapOrStack ( self,
coeffs,
multiplier,
stack )
Private function used by GetCoeffs() to delegate processing.

Implementation must either update coeffs or push to the stack a
sub-expression and the accumulated multiplier that applies to it.

Args:
  coeffs: A dictionary of variables' coefficients. It is a defaultdict that
      initializes the new values to 0 by default.
  multiplier: The current accumulated multiplier to apply to this
      expression.
  stack: A list to append to if the current expression is composed of
      sub-expressions. The elements of the stack are pair tuples
      (multiplier, linear_expression).

Reimplemented from ortools.linear_solver.python.linear_solver_natural_api.LinearExpr.

Definition at line 240 of file linear_solver_natural_api.py.


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