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,3332d83c4f455808 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!m7g2000cwm.googlegroups.com!not-for-mail From: "Jerry" Newsgroups: comp.lang.ada Subject: Re: How to use Annex G.3 Vectors and Matrices in bindings to C arrays Date: 13 Nov 2006 23:31:01 -0800 Organization: http://groups.google.com Message-ID: <1163489461.168887.7540@m7g2000cwm.googlegroups.com> References: <1163303134.998680.268570@h54g2000cwb.googlegroups.com> <1163416802.221321.170270@f16g2000cwb.googlegroups.com> NNTP-Posting-Host: 67.40.87.12 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1163489466 14680 127.0.0.1 (14 Nov 2006 07:31:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 14 Nov 2006 07:31:06 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/420+ (KHTML, like Gecko, Safari/420) OmniWeb/v607.5,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: m7g2000cwm.googlegroups.com; posting-host=67.40.87.12; posting-account=Ax24hA0AAABV39UFqUVhb0kauOuAbI3T Xref: g2news2.google.com comp.lang.ada:7444 Date: 2006-11-13T23:31:01-08:00 List-Id: Jeffrey R. Carter wrote: > > > The related array definitions are: > > type Long_Float_Array_1D is array (Integer range <>) of aliased > > Long_Float; > > type Long_Float_Array_2D is array (Integer range <>, Integer range > > <>) of aliased Long_Float; > > > > The "thin" binding Ada procedure plmeshc is defined: > > procedure plmeshc(x : PL_Float_Array; y : PL_Float_Array; z : > > PL_Float_Array_2D; nx : PLINT; ny : PLINT; opt : PLINT; > > clevel : PL_Float_Array; nlevel : PLINT); > > pragma Import(C, plmeshc, "c_plmeshc"); > > The declarations of the PL_... types would be useful, too, though we can > make a good guess from the C. > They are: subtype PL_Float_Array is My_Common.Long_Float_Array_1D; My_Common is with-ed and defines Long_Float_Array_1D as above. subtype PLINT is Integer; I'm still chewing on the address-to-access idea. It may not be elegant or Ada-like but I want to get a general solution to this 2D array - to - C problem that doesn't have such a speed hit as copying things. For plotting it might not be too much of an issue but I suspect that I'll have to face this again in the GNU Scientific Library binding and the speed issue is more important there. Thanks, Jerry