comp.lang.ada
 help / color / mirror / Atom feed
* matrix manipulation
@ 2016-11-12 18:16 hnptz
  2016-11-12 19:12 ` Jacob Sparre Andersen
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: hnptz @ 2016-11-12 18:16 UTC (permalink / raw)


What is an elegant way to program exchange of columns in a matrix. 
Application: 
C is a matrix. Cj be the j-th column of C.
Sort C1,C2, ..., Cn in non increasing order with respect to their first component.
I tried and ended up in a very messy program, as I had to sort the first components first, remember their new index and then reconstruct the matrix.


^ permalink raw reply	[flat|nested] 12+ messages in thread
* matrix manipulation
@ 2019-04-27 14:50 hnptz
  2019-04-27 15:05 ` mockturtle
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: hnptz @ 2019-04-27 14:50 UTC (permalink / raw)


Hi,

I would like to solve the following Ada-Programming demand:

bk :=3; Dv := 4;

H : Real_Matrix(1..bk*Dv,1..bk*Dv);

type Block_Matrix
   is array (Positive range <>, Positive range <>) of Real_Matrix(1..Dv,1..Dv);

HB : Block_Matrix(1..bk,1..bk);

Now, there are 12 Block_Matrices which make up H. After calculation of all HB's I want to place them into H and ended up in coding of 8 different for loops. Is there a more elegant solution? I noticed that slicing would only work with a definition of linear arrays of a linear array, which does not fit for the rest of my program.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-04-27 22:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-12 18:16 matrix manipulation hnptz
2016-11-12 19:12 ` Jacob Sparre Andersen
2016-11-12 23:30 ` Stephen Leake
2016-11-14 17:39   ` hnptz
2016-11-15 17:54     ` Stephen Leake
2016-11-15 18:57 ` Robert Eachus
  -- strict thread matches above, loose matches on Subject: below --
2019-04-27 14:50 hnptz
2019-04-27 15:05 ` mockturtle
2019-04-27 15:21 ` hnptz
2019-04-27 16:37   ` J-P. Rosen
2019-04-27 16:58     ` mockturtle
2019-04-27 22:45 ` Simon Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox