Originally posted by: wzyryan
Hello all,
I want to add the two IloIfThen constraints into an IloRangeArray con. Does anyone have any idea how to implement it? Thanks a lot! The values of w and h are both 128. t[0] and t[1] are decision variables.
for(int p=0;p<w;p++){
for(int q=0;q<h;q++){
model.add(IloIfThen(env, mat[p][q] >= t[0], fmat[p][q] >= t[0]));
model.add(IloIfThen(env, mat[p][q] <= t[1], fmat[p][q] <= t[1]));
}
}
What I want to implement is as follows:
IloRangeArray con(env);
for(int p=0;p<w;p++){
for(int q=0;q<h;q++){
con.add(IloIfThen(env, mat[p][q] >= t[0], fmat[p][q] >= t[0]));
con.add(IloIfThen(env, mat[p][q] <= t[1], fmat[p][q] <= t[1]));
} //The expression above is obviously wrong. How can I implement it?
}
#CPLEXOptimizers#DecisionOptimization