From: gautier_niouzes@hotmail.com
Subject: Re: ANN: miscellaneous Math routines, GPL'd
Date: Wed, 13 May 2009 04:52:16 -0700 (PDT)
Date: 2009-05-13T04:52:16-07:00 [thread overview]
Message-ID: <5f730696-4657-489f-a89b-518b49194f62@n4g2000vba.googlegroups.com> (raw)
In-Reply-To: 46c1db7c-e6b4-48a1-9a4a-a777a1baaf60@r13g2000vbr.googlegroups.com
On 13 Mai, 11:25, johns...@googlemail.com wrote:
> Another irritation: suppose user declares
>
> V : Vector (1..10);
> M : Matrix (0..9, 0..9);
> or worse
> M : Matrix (0..9, 2..11);
> or worse still
> 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 and near bottom of
> Disorderly-Random-Deviates.ads.) 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!
next prev parent reply other threads:[~2009-05-13 11:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-12 16:38 ANN: miscellaneous Math routines, GPL'd johnscpg
2009-05-12 18:45 ` John B. Matthews
2009-05-13 9:39 ` johnscpg
2009-05-13 13:40 ` John B. Matthews
2009-05-12 19:03 ` Dmitry A. Kazakov
2009-05-12 21:02 ` lanceboyle
2009-05-13 9:25 ` johnscpg
2009-05-13 11:52 ` gautier_niouzes [this message]
2009-05-13 13:43 ` johnscpg
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox