Originally posted by: SystemAdmin
[ekimg said:]
Hi all,
I have a problem with the setVectors command in Cplex under C++. I have a two dimesional variable array and want to give starting values. But I could not manage it. I tried to this thing:
Use cplex.getValues(IloNumArray vals, IloNumVarArray vars) to put the solution values of the numeric variables indicated by the array vars into the array vals.
Write out the array vals into a simple text file values.txt.
Then, you can read the variable values back from values.txt and load them into IloCplex using IloCplex::setVectors:
Create an IloNumArray valsRead and populate it by reading the values from values.txt.
Create an IloNumVarsArray vars, initialize the model and the IloCplex object.
Call cplex.setVectors(valsRead, 0, vars,0,0,0);
Call cplex.solve();
but since my array has two dimensions. I can not figure it out.
Any help or suggestion will be appreciated. Thanks.
#CPLEXOptimizers#DecisionOptimization