Boost logo

Ublas :

Subject: Re: [ublas] symmetric matrices, row and column-major
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2009-03-14 17:44:25


Am Dienstag, 24. Februar 2009 23:08 schrieb Tiago Requeijo:
> Looking at functional.hpp, I think the problem is indeed the
> transposed_structure template. As far as I understand, the template
> simply takes an upper matrix and regards it as the transpose of a
> lower matrix. While this is (of course) correct, it doesn't take into
> account the row/column major storage:
>
> If we take the upper matrix U
>
> 1 2 3
> - 4 5
> - - 6
>
> and regard it as the transpose of a lower matrix L
>
> 1
> 2 4
> 3 5 6
>
> without a row/column major swap, then we're storing the row major
> version of the lower matrix or, in other words, the column major
> version of the upper matrix:
>
> a) row_major for U: 1 2 3 4 5 6
> b) row_major for L: 1 2 4 3 5 6
>
> Since the transposed_structure template simply maps the elements to
> the transpose and doesn't change the storage, we are in fact storing
> b) instead of a)

The bug is now fixed in trunk.