Boost logo

Ublas :

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2004-12-14 04:08:35

Thomas Lemaire wrote:
> I already sent this email to the boost-dev list, but it did not get any
> answer, I hope I reach the good audience now... (I also submit a bug in
> sourceforge)
> When resizing a symmetric matrix with the preserve tag to "true", I got:
> before
> P:
> [6,6]((0,0,0,0,0,0),(0,0,0,0,0,0),(0,0,0,0,0,0),(0,0,0,0,0,0),(0,0,0,0,0,0),(0,0,0,0,0,0))
> after
> P:
> [9,9]((5.54836e-321,-NaN,7.57149e-96,7.57149e-96,7.57149e-96,0,3.06321e-322,0,0),(-NaN,5.75348e+140,4.10451e-115,7.56598e-96,4.10451e-115,0,1.92686e-322,0,0),(7.57149e-96,4.10451e-115,7.57149e-96,7.57149e-96,7.57149e-96,3.31031e-311,6.57819e-313,0,0),(7.57149e-96,7.56598e-96,7.57149e-96,2.34163e-110,0,1.10492e-317,0,3.07265e-311,0),(7.57149e-96,4.10451e-115,7.57149e-96,0,0,5.00601e-308,0,1.10498e-317,0),(0,0,3.31031e-311,1.10492e-317,5.00601e-308,4.99745e-308,0,5.00601e-308,0),(3.06321e-322,1.92686e-322,6.57819e-313,0,0,0,0,4.99745e-308,0),(0,0,0,3.07265e-311,1.10498e-317,5.00601e-308,4.99745e-308,3.06321e-322,0),(0,0,0,0,0,0,0,0,0))

There are some issues with the 'preserve' functionality. If for instance
you have a 3x3 matrix and you resize to a 9x9. Do you want to have the
original content as a 3x3 block in the 9x9 matrix or do you want to have
the content of the original 3x3 in the first row (or column, depending
on column_major or row_major) of the 9x9.

That why I think the 'preserve' functionality should go. You can do it
yourself. Both possibilities described above can be done either taking a
3x3 view on the 9x9 and assign the original to the view or by using
std::copy from the original to the 9x9.