# Boost Users :

Subject: Re: [Boost-users] multi-array and pdes
From: pmamales_at_[hidden]
Date: 2011-05-24 01:58:30

Hi Larry,

Thank you very much for your extended response.
I am not sure, will have to think about it, altough this seems right.
In appreciation of your effort to help me, let me give you some color:
Say I am trying to sove a 3d problem using splitting methods. Lets say that the original
system f reference is xyz.
One alays ends up to a system of equations in the vectorized reprezentation of the grid (very much like the
array where the elements of the ma are stored).
Then, when trying to solve the problem in the x direction (while in fortran storage scheme),
I obtain a nice tridiagonal system of equations which I can solve very efficiently (using Thomas algorithm which is O(N) ).
When I go to the second dimension, the tridiagonal system is hidden (in the original vector). However, in the rotsted yzx system it is there!!
So, I am "paying the price" of writting it in the rotated view and copying it into a different vector to solve efficiently
(o/wise I end up with a much more expensive sparse system to solve..)
Hence the root of my questions.
One of the issues is that the rows that I need to permute is rather complicated and with a little of smoke and mirrors, I hope to bypass
the complications.
Apologies, if all this is known to ou already or if went way too atray. Also, apologies for not catching your response earlier.
Thank you agian for all your help-will look inth the references,
Petros

---- Larry Evans <cppljevans_at_[hidden]> wrote:
> On 05/22/11 12:17, Larry Evans wrote:
> [snip]
> >
> > The book referenced in that post also has a section on rotation;
> > hence, it may be useful for that also.
> >
> Just to be clear about rotation, suppose:
>
> multi_array<int,2> ma2(extents[3][4]);
>
> and suppose it was filled with 1...12 so that a printout would show:
>
> { { 1, 2, 3, 4}
> , { 5, 6, 7, 8}
> , { 9,10,11,12}
> }
>
> Then, to rotate the 3 rows by 2 1 and -1 elements would produce:
>
> { { 3, 4, 1, 2}
> , { 6, 7, 8, 5}
> , {12, 9,10,11}
> }
>
> and to rotate the 4 columns by 0 1 -1 -2 would produce:
>
> { { 1, 6,11, 8}
> , { 5,10, 3,12}
> , { 9, 2, 7, 4}
> }
>
> Is that what you meant by rotation?
>
> -regards,
> Larry
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]