1

I want to move from using C++ to using Python however, I can't seem to find what the Python equivalent of IloExpr from the C++ API to Cplex is.

More specifically, I'd like to write the following function in Python...

IloExpr targetSetLHS(IloEnv & env, Sparse_Matrix<IloInt>& vox, vector<unsigned int> & A,
    IloNum Tx, vector<unsigned int> & X, IloNumVarArray& w)
{
    IloExpr expr(env);
    for (unsigned int i = 0; i < A.size(); ++i)
    {
        expr += D(A[i], vox, w, env) - Tx;
    }
    return expr;
}

Naturally, I checked the documentation for the Python API but I can't find anything of the sort and I'm wondering if what I am trying to do is even possible.

Constantine
  • 479
  • 1
  • 9
  • 19
  • The SO question you mention is about the example provided by the official documentation. My current understanding goes well beyond the simple example, yet I still cannot answer the question I have posed here. I also found a variety of wrappers, including the one you mention. However, optimizing code efficiency by avoiding wrappers is a secondary objective and beyond the scope of my question. – Constantine Jun 16 '15 at 19:08
  • Did YOU check [IloExpr](http://www-01.ibm.com/support/knowledgecenter/SSSA5P_12.4.0/ilog.odms.cpo.help/CP_Optimizer/User_manual/topics/model_vars_expr.html) ? – Constantine Jun 17 '15 at 22:06

0 Answers0