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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e52f7c34095c85e5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!newsfeed.stueberl.de!eusc.inter.net!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: unconstrained array type problems Date: Wed, 21 Jul 2004 17:33:16 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <87zn5tl7n1.fsf@insalien.org> <40fe8ce1@dnews.tpgi.com.au> <87vfghl456.fsf@insalien.org> NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1090431196 8423 134.91.1.34 (21 Jul 2004 17:33:16 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Wed, 21 Jul 2004 17:33:16 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: g2news1.google.com comp.lang.ada:2326 Date: 2004-07-21T17:33:16+00:00 List-Id: Ludovic Brenta wrote: : : begin : Get (File, number_rows_1); : Get (File, number_columns_1); : Get (File, number_rows_2); : Get (File, number_columns_2); : : declare : array1: Matrix_Type (1 .. number_rows, 1 .. number_columns); : array2: Matrix_Type (1 .. number_rows, 1 .. number_columns); : begin : -- read in array1 : -- read in array2 : -- multiply array1 by array2 (array multiplication) : end; : end; Maybe things can be made a bit more separate: subtype Realistic_Index is Positive range 1 .. 50; -- declared womewhere or "generically" type Matrix_Data is array(Realistic_Index range <>, Realistic_Index range <>) of Value; type Matrix(rows, columns: Realistic_Index) is limited -- ! record item: Matrix_Data(1 .. rows, 1 .. columns); end record; procedure Read(filename: String; m: in out Matrix); This way a Matrix object can be declared and constrained before cell items are read. Copying is avoided if I'm not mistaken? -- Georg