[CoinUtils] problem with CoinPackedMatrix
Michal Kaut
mail at michalkaut.net
Thu Nov 29 10:01:10 EST 2007
Hello,
I need to add elements to CoinPackedMatrix one by one and while doing
so, I encountered the following problem:
-------------------------------------------------
CoinPackedMatrix A;
A.setDimensions(2, 3);
A.modifyCoefficient(1, 1, 3);
A.modifyCoefficient(1, 2, 5);
cout << "A(1,1) = " << A.getCoefficient(1, 1) << endl;
cout << "A(1,2) = " << A.getCoefficient(1, 2) << endl;
cout << "A has " << A.getNumElements() << " elements:";
for (int el=0; el<A.getNumElements(); el++)
cout << " " << A.getElements()[el];
cout << endl;
-------------------------------------------------
results in:
A(1,1) = 3
A(1,2) = 5
A has 2 elements: 3 0
In other words, there seems to be a problem with the element_ member.
Is this a bug, or am I just doing something wrong?
Thanks a lot in advance.
Regards,
Michal Kaut
More information about the CoinUtils
mailing list