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,523c3848a9d03183 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!n4g2000vba.googlegroups.com!not-for-mail From: gautier_niouzes@hotmail.com Newsgroups: comp.lang.ada Subject: Re: ANN: miscellaneous Math routines, GPL'd Date: Wed, 13 May 2009 04:52:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5f730696-4657-489f-a89b-518b49194f62@n4g2000vba.googlegroups.com> References: <9dbcdcd0-3c15-4165-9336-3d5778df2ca3@e20g2000vbc.googlegroups.com> <7f7fcafe-189e-423e-a24d-5933bfd6f754@n7g2000prc.googlegroups.com> <46c1db7c-e6b4-48a1-9a4a-a777a1baaf60@r13g2000vbr.googlegroups.com> NNTP-Posting-Host: 206.122.158.4 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1242215536 8417 127.0.0.1 (13 May 2009 11:52:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 13 May 2009 11:52:16 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n4g2000vba.googlegroups.com; posting-host=206.122.158.4; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5806 Date: 2009-05-13T04:52:16-07:00 List-Id: On 13 Mai, 11:25, johns...@googlemail.com wrote: > Another irritation: =A0suppose user declares > > =A0 V : Vector (1..10); > =A0 M : Matrix (0..9, 0..9); > or worse > =A0 M : Matrix (0..9, 2..11); > or worse still > =A0 M : Matrix (0..11, 2..11); > > How do you handle it? > 1. shift indices during iteration inside loops in the lin alg program. > 2. slide arrays so indices coincide. > 3. Raise constraint_error; > 4. Assume they won't do it. > > I do 3. (See for example procedure Choleski_Decompose at end of > Disorderly-Random-Deviates.adb =A0and near bottom of > Disorderly-Random-Deviates.ads.) =A0 But I'm not sure what to do. > (I was going ask here on comp.lang.ada, but got lazy.) > Generics with constrained arrays work ok for me here. It's done here: http://www.cs.umbc.edu/~squire/adaclass/gnatmath95 , generic_real_linear_equations.ads . For using with Ada 2005's matrices, all you need is to replace package Generic_Real_Arrays by Ada.Numerics.Generic_Real_Arrays :-) _________________________________________________________ Gautier's Ada programming -- http://sf.net/users/gdemont/ NB: For a direct answer, e-mail address on the Web site!