Originally posted by: SystemAdmin
As far as I know there is no matrix support for cplex in c++. So I was trying to implement it myself and I can't figure out what is going on or if it is a bug.
I have the following code
IloEnv env;
std::vector< IloNumArray > T(2, IloNumArray(env) );
T[0].add(7.1); T[0].add(1.1);
T[1].add(8.1); T[1].add(1.2);
for( unsigned int i=0;i<T.size();++i)
{
env.out() << T[i] << endl;
}
As for as I can tell this should print
7.1 1.1
8.1 1.2
But it doesn't it prints
7.1 1.1 8.1 1.2
7.1 1.1 8.1 1.2
What is going on here? Why doesn't using the overloaded operator from std::vector move to the next element of T and then add elements there? Is IloNumArray not a class? Why does it concat on the previous vector element?
#CPLEXOptimizers#DecisionOptimization