0

Hi!

I am using concert tech to link Cplex with C++ Coding.
There is an error that pop up when I tried to run:
error C2676: binary '+=' : 'IloNumVar' does not define this operator or a conversion to a type acceptable to the predefined operator

Below is a portion of my code:

    for(i=1;i<n_nd+1;i++)
    {
        if(i < n_nd)
        {
            //Start Flow Demand
            for(t=0;t<(n_T-1)*delta;t+=delta)
            {
                h[i] += var_w[i][t];
            }

            sprintf(buf, "Demand balance constraint (%d)", i);
            cst_wdmdbal.add(IloRange(env, 0, h, 0, buf));
        }

        else if(i == n_nd)
        {
            //End Flow Demand
            for(t=0;t<(n_T-1)*delta;t+=delta)
            {
                h[i] += var_v[i][t];
            }
            sprintf(buf, "Demand balance constraint (%d)", i);
            cst_vdmdbal.add(IloRange(env, 0, h, 0, buf));
        }

        else
        {
            for(t=0;t<(n_T-1)*delta;t+=delta)
            {
                var_w[i][t] = 0;
            }
        }
    }

Please do help.

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by WaltP
0

error C2676: binary '+=' : 'IloNumVar' does not define this operator

Whatever IloNumVar is, you cannot do a +=. It's obviously not an integer.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.