Python equivalent of Cplex IloExpr from C++

254 Views Asked by At

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.

0

There are 0 best solutions below