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!news3.google.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.71.MISMATCH!xlned.com!feeder3.xlned.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: How do I "with" Numerics without linking BLAS, LAPACK? (and more) Date: Tue, 31 Aug 2010 10:39:35 +0200 Organization: Adalog Message-ID: References: <4ac95d41-5d82-4d77-ae4a-a02331170f1f@k17g2000prf.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 31 Aug 2010 08:39:50 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="Dn22F68J9CHYFQQlT81DGA"; logging-data="31908"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JdCbbltapq72JpxtvllaT" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 In-Reply-To: <4ac95d41-5d82-4d77-ae4a-a02331170f1f@k17g2000prf.googlegroups.com> Cancel-Lock: sha1:5GQeYSJ+7aj+ghK+0GpCmae82Uc= Xref: g2news1.google.com comp.lang.ada:13866 Date: 2010-08-31T10:39:35+02:00 List-Id: Le 31/08/2010 10:24, Jerry a �crit : > 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: > > type Real_Vector is array (Integer range <>) of Long_Float; > 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.) > > with Ada.Numerics.Long_Real_Arrays; > subtype Real_Vector is Ada.Numerics.Long_Real_Arrays.Real_Vector; > subtype Real_Matrix is Ada.Numerics.Long_Real_Arrays.Real_Matrix; > > 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). -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr