[Coin-discuss] problem with CoinPackedMatrix

Michal Kaut mail at michalkaut.net
Thu Nov 29 10:22:54 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 just my misunderstanding of things?

Thanks a lot in advance.


Regards,
Michal Kaut


PS: I originally posted this to coinutils at list.coin-or.org, but then I 
noticed that it is the first post since August. Is that forum obsolete? 
(Even the CoinUtils web page has a link to this forum, not coinutils@)



More information about the Coin-discuss mailing list