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,e5485065ad2544d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!l38g2000pro.googlegroups.com!not-for-mail From: Jerry Newsgroups: comp.lang.ada Subject: Re: How do I "with" Numerics without linking BLAS, LAPACK? (and more) Date: Tue, 31 Aug 2010 17:05:56 -0700 (PDT) Organization: http://groups.google.com Message-ID: <16c85eec-213d-4a90-8338-058b4ceff2df@l38g2000pro.googlegroups.com> References: <4ac95d41-5d82-4d77-ae4a-a02331170f1f@k17g2000prf.googlegroups.com> NNTP-Posting-Host: 75.172.184.10 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1283299557 24808 127.0.0.1 (1 Sep 2010 00:05:57 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 1 Sep 2010 00:05:57 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l38g2000pro.googlegroups.com; posting-host=75.172.184.10; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/531.21.8+(KHTML, like Gecko, Safari/528.16) OmniWeb/v622.11.0,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:13886 Date: 2010-08-31T17:05:56-07:00 List-Id: On Aug 31, 1:39=A0am, "J-P. Rosen" wrote: > Le 31/08/2010 10:24, Jerry a =E9crit : > > > > > This is probably going to be confusing... > > > I have a problem with the PLplot bindings to which I can't figure out > > a decent solution. > > > The Ada bindings use vectors and matrices defined like this: > > > =A0 =A0 type Real_Vector is array (Integer range <>) of Long_Float; > > =A0 =A0 type Real_Matrix is array (Integer range <>, Integer range <>) = of > > Long_Float; > > > These can be either defined exactly like the above in the bindings > > proper or, in the case of Ada 2005, from the declarations from GNAT's > > a-nlrear.ads which are effectively exactly the same. For example, > > these subtypes work: (Subtyping makes distributing the declaration to > > the various packages easy.) > > > =A0 =A0 with Ada.Numerics.Long_Real_Arrays; > > =A0 =A0 subtype Real_Vector is Ada.Numerics.Long_Real_Arrays.Real_Vecto= r; > > =A0 =A0 subtype Real_Matrix is Ada.Numerics.Long_Real_Arrays.Real_Matri= x; > > > As long as the user program uses whichever of these types is specified > > in the bindings, the program will work OK. But there are two problems. > > > (1) (Compiler is Ada 2005.) [...] if > > the user simply wants to use the "official" types, the second method > > is the only way to go because the first declaration style will result > > in types that are incompatible with a-nlrear.ads. > > Not really, since they are convertible to the types in a-nlrear.ads. > That would require a bit of extra typing when calling the functions, but > likely zero run-time overhead. > > (Array conversions can be quite useful - but few people are aware of > this possibility). > -- > --------------------------------------------------------- > =A0 =A0 =A0 =A0 =A0 =A0J-P. Rosen (ro...@adalog.fr) > Visit Adalog's web site athttp://www.adalog.fr Good point. Thanks, J-P. That does give the user program another way to live with PLplot. Jerry