Originally posted by: SystemAdmin
Something like this should do the trick (untested code):
IloCsvReader reader(env, "arcs.csv");
IloInt lines = reader.getNumberOfItems();
IloNumArrayArray data(env);
for (IloInt i = 0; i < lines; ++i) {
IloNumArray lineData(env);
IloCsvLine line = reader.getLineByNumber(i);
IloInt fields = line.getNumberOfFields();
for (IloInt f = 0; f < fields; ++f)
lineData.add(line.getFloatByPosition(f));
data.add(lineData);
}
Please see also the reference documentation of classes
IloCsvReader and
IloCsvLine. Looking through the available functions should already tell you how to get the table into the array.
#CPLEXOptimizers#DecisionOptimization