Column()


Column()

Column ( coeffs=None, constrs=None )

Column constructor.

Arguments:

coeffs (optional): Lists the coefficients associated with the members of constrs.

constrs (optional): Constraint or constraints that participate in expression. If constrs is a list, then coeffs must contain a list of the same length. If constrs is a single constraint, then coeffs must be a scalar.

Return value:

An expression object.

Example usage:

  constrs = model.getConstrs()

  c = Column()
  c.addTerms(3.0, constrs[0])
  model.addVar(vtype=GRB.BINARY, obj=1.0, col=c)

  model.addVar(vtype=GRB.INTEGER, col=Column(3.0, constrs[0]))

  model.addVar(obj=3.0, col=Column([1.0, 2.0], constrs[1:3]))