From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:3587:: with SMTP id k129mr14086984ita.55.1556378503111; Sat, 27 Apr 2019 08:21:43 -0700 (PDT) X-Received: by 2002:a9d:4c05:: with SMTP id l5mr29570121otf.36.1556378502961; Sat, 27 Apr 2019 08:21:42 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.166.215.MISMATCH!b2no354594itd.0!news-out.google.com!w17ni301itb.0!nntp.google.com!b2no354589itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 27 Apr 2019 08:21:42 -0700 (PDT) In-Reply-To: <4b46fe61-45af-4700-967c-503a4dafcee5@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a01:5c0:e086:51a1:395b:40ba:ca0d:d102; posting-account=3Fg1FgoAAACfsmWScNfMD1tGFhR4DU0o NNTP-Posting-Host: 2a01:5c0:e086:51a1:395b:40ba:ca0d:d102 References: <4b46fe61-45af-4700-967c-503a4dafcee5@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: matrix manipulation From: hnptz@yahoo.de Injection-Date: Sat, 27 Apr 2019 15:21:43 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56198 Date: 2019-04-27T08:21:42-07:00 List-Id: On Saturday, April 27, 2019 at 4:50:13 PM UTC+2, hn...@yahoo.de wrote: > Hi, >=20 > I would like to solve the following Ada-Programming demand: >=20 > bk :=3D3; Dv :=3D 4; >=20 > H : Real_Matrix(1..bk*Dv,1..bk*Dv); >=20 > type Block_Matrix > is array (Positive range <>, Positive range <>) of Real_Matrix(1..Dv,1= ..Dv); >=20 > HB : Block_Matrix(1..bk,1..bk); >=20 > Now, there are 12 Block_Matrices which make up H. After calculation of al= l HB's I want to place them into H and ended up in coding of 8 different fo= r loops. Is there a more elegant solution? I noticed that slicing would onl= y work with a definition of linear arrays of a linear array, which does not= fit for the rest of my program. Sorry, I meant six. Two for H, two for the block and two inside the block; H(i,j) :=3D HB(i1,j1)(i2,j2); The mod solution sounds interesting. I then might switch to indices startin= g with zero, which may be easier to handle in connection with the mod funct= ion.