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!g29g2000yqe.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:13:20 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <4b6637a1$0$4586$4d3efbfe@news.sover.net> 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 1265256801 30660 127.0.0.1 (4 Feb 2010 04:13:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 4 Feb 2010 04:13:21 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g29g2000yqe.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:8870 Date: 2010-02-03T20:13:20-08:00 List-Id: On 1 f=E9v, 03:11, "Peter C. Chapin" wrote: > Apparently the component type of an array needs to be fully constrained (= which > again makes sense) yet I don't know the size That's what generics are made for. But you will have a single matrix type of a fixed size. I you don't want a fixed size type, the best I will think about, would be to create an abstract matrix type which will be implemented on a one dimensional array. You could use slice in the implementation. Ex. for a 2x2 matrix, you will use a 1 .. 4 array of Float. You may define a swap row method which will move items from 1 .. 2 to 3 .. 4 and vice-versa. You will be able to use slice optimized operations. Tell me if you need a more concrete example (I confess I'm a bit terse here).