Boost logo

Boost Users :

Subject: Re: [Boost-users] multi-array and pdes
From: Larry Evans (cppljevans_at_[hidden])
Date: 2011-05-22 14:02:33


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 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