|
Boost Users : |
Subject: [Boost-users] Howto check Matrix Byte Size in Boost's Ublas Object
From: Gundala Viswanath (gundalav_at_[hidden])
Date: 2009-01-28 08:47:15
Dear All,
I have the following matrix implementation using
Ublas. One is plain old matrix ('m') and the other is
sparse matrix ('sm')
My question is how can I check the byte size
of 'sm' and 'm'?
If my implementation is correct
'sm' byte size should give much smaller byte size than 'm'.
Since both 'm' and 'sm' print the same output here.
//____ BEGIN__
matrix<double> m(matDim[0], matDim[1], 0);
coordinate_matrix<double> sm(matDim[0],matDim[1], 0);
for (size_t i = 0; i < realValue.size(); ++i){
m(rowIndex[i]-1,colIndex[i]-1) = realValue[i];
sm(rowIndex[i]-1,colIndex[i]-1) = realValue[i];
}
// End
The full and compilable code can be found here:
http://cpp.codepad.org/MbPm3OuK
- Gundala Viswanath
Jakarta - Indonesia
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net