Model.getRow()

getRow ( constr )

Retrieve the list of variables that participate in a constraint, and the associated coefficients. The result is returned as a LinExpr object.

Arguments:

constr: The constraint of interest. A Constr object, typically obtained from addConstr or getConstrs.

Return value:

A LinExpr object that captures the set of variables that participate in the constraint.

Example usage:

  constrs = model.getConstrs()
  print(model.getRow(constrs[0]))