original_docstring:  Adds a constraint to a model
  
      Input:
         csrmatrix_rep: a matrix representation of the constraint in csr format
         sense: '<', '=', '>' or equivalent (e.g., ==, lt, le, gt, ge)
         rhs: right hand side (constant) of the constraint
         model: the gurobi model
         variables: the base variables of the model involved in the constraint
         name: name of the constraint
  
      Note: variables is a vector with the semantics that csrmatrix_rep * variables = rhs
  
      Output: the model is modified, otherwise there is no output
      
docstring: 
  
  variables is a vector with the semantics that csrmatrix_rep * variables = rhs
  
  the model is modified, otherwise there is no output
docstring_tokens: variables is a vector with the semantics that csrmatrix_rep * variables = rhs the model is modified otherwise there is no output
code: def addConstraint(csrmatrix_rep, sense, rhs, model, variables, name):
      """ Adds a constraint to a model
  
      Input:
         csrmatrix_rep: a matrix representation of the constraint in csr format
         sense: '<', '=', '>' or equivalent (e.g., ==, lt, le, gt, ge)
         rhs: right hand side (constant) of the constraint
         model: the gurobi model
         variables: the base variables of the model involved in the constraint
         name: name of the constraint
  
      Note: variables is a vector with the semantics that csrmatrix_rep * variables = rhs
  
      Output: the model is modified, otherwise there is no output
      """
      gurobi_sense = convertSense(sense)
      num_rows = csrmatrix_rep.shape[0]
      for i in range(num_rows):
          expr = [variables[x] for x in csrmatrix_rep[i, :].indices]
          model.addConstr(lhs=sum(expr), sense=gurobi_sense, rhs=rhs[i], name=name)
code_tokens: def addConstraint ( csrmatrix_rep , sense , rhs , model , variables , name ) : gurobi_sense = convertSense ( sense ) num_rows = csrmatrix_rep . shape [ 0 ] for i in range ( num_rows ) : expr = [ variables [ x ] for x in csrmatrix_rep [ i , : ] . indices ] model . addConstr ( lhs = sum ( expr ) , sense = gurobi_sense , rhs = rhs [ i ] , name = name )
short_docstring: Adds a constraint to a model
  Input:
  csrmatrix_rep: a matrix representation of the constraint in csr format
  sense: '<', '=', '>' or equivalent (e.g., ==, lt, le, gt, ge)
  rhs: right hand side (constant) of the constraint
  model: the gurobi model
  variables: the base variables of the model involved in the constraint
  name: name of the constraint
short_docstring_tokens: Adds a constraint to a model Input : csrmatrix_rep : a matrix representation of the constraint in csr format sense : ' < ' ' = ' ' > ' or equivalent ( e . g . == lt le gt ge ) rhs : right hand side ( constant ) of the constraint model : the gurobi model variables : the base variables of the model involved in the constraint name : name of the constraint
comment: """ Adds a constraint to a model
  
      Input:
         csrmatrix_rep: a matrix representation of the constraint in csr format
         sense: '<', '=', '>' or equivalent (e.g., ==, lt, le, gt, ge)
         rhs: right hand side (constant) of the constraint
         model: the gurobi model
         variables: the base variables of the model involved in the constraint
         name: name of the constraint
  
      Note: variables is a vector with the semantics that csrmatrix_rep * variables = rhs
  
      Output: the model is modified, otherwise there is no output
      """