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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,bf03d731a6ef511f X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!m31g2000yqd.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Copying rows in a two dimensional array. Date: Wed, 3 Feb 2010 20:27:24 -0800 (PST) Organization: http://groups.google.com Message-ID: <0192c17e-8c41-464f-9f4c-a3b4b9b763c1@m31g2000yqd.googlegroups.com> References: <4b6637a1$0$4586$4d3efbfe@news.sover.net> <4b667ac4$0$6289$4f793bc4@news.tdc.fi> NNTP-Posting-Host: 86.66.190.223 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1265257644 19780 127.0.0.1 (4 Feb 2010 04:27:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 4 Feb 2010 04:27:24 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m31g2000yqd.googlegroups.com; posting-host=86.66.190.223; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8872 Date: 2010-02-03T20:27:24-08:00 List-Id: On 1 f=E9v, 07:55, Niklas Holsti wrote: > Another solution -- which perhaps you have considered -- is to use a > generic package to define row and matrix types: > > =A0 =A0 generic Size : Positive; > =A0 =A0 package Matrices > =A0 =A0 is > =A0 =A0 =A0 =A0type Row is array (1 .. Size) of Float; > =A0 =A0 =A0 =A0type Matrix is array (1 .. Size) of Row; > =A0 =A0 end Matrices; > > However, this will probably force some other parts of your code to > become generic, too, parametrized either by a Size, or by an instance of > Matrices. I was just thinking while I was reading you : if he use generics, then the generic package should define two matrix types, one for source matrix and one for result matrix of some matrix functions (which returns matrix with reversed dimensions). One Matrix(X,Y) and one Matrix(Y,X)