|
Ublas : |
Subject: Re: [ublas] Banded matrix storage
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2012-10-15 12:09:17
Hello,
Am Thursday 11 October 2012 schrieb Rutger ter Borg:
> Dear Gunter and/or David,
>
> I have a question regarding the banded matrix storage. Suppose we
> have a 5x5 matrix with 1 upper and 1 lower band,
>
> row 0 [5]( 1, 2, 0, 0, 0)
> row 1 [5]( 3, 4, 5, 0, 0)
> row 2 [5]( 0, 6, 7, 8, 0)
> row 3 [5]( 0, 0, 9,10,11)
> row 4 [5]( 0, 0, 0,12,13)
>
> and if we store this in ublas::row_major format, the raw data array
> looks like
>
> 0: 0
> 1: 1
> 2: 3
> 3: 2
This is really surprising. row_major should store the element row by row
(as defined by netlib).
>
> But, if I use a band array in ublas::column_major format, the raw
> data looks like
>
> 0: 0
> 1: 2
> 2: 5
> 3: 8
> 4: 11
this looks like the banded storage format.
>
> Can this be fixed in ublas?
Could you please provide a simple test program which checks the storage
format? Then we (or maybe you) can create a new ticket.
mfg
Gunter