comp.lang.ada
 help / color / mirror / Atom feed
From: "Jerry" <lanceboyle@qwest.net>
Subject: Re: How to use Annex G.3 Vectors and Matrices in bindings to C arrays
Date: 13 Nov 2006 23:31:01 -0800
Date: 2006-11-13T23:31:01-08:00	[thread overview]
Message-ID: <1163489461.168887.7540@m7g2000cwm.googlegroups.com> (raw)
In-Reply-To: <qp36h.278689$1i1.164466@attbi_s72>

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




  reply	other threads:[~2006-11-14  7:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-12  3:45 How to use Annex G.3 Vectors and Matrices in bindings to C arrays Jerry
2006-11-12  8:45 ` Yves Bailly
2006-11-13 10:48   ` Jerry
2006-11-12 19:39 ` Jeffrey R. Carter
2006-11-13  7:09   ` tmoran
2006-11-13 11:20   ` Jerry
2006-11-13 17:42     ` Yves Bailly
2006-11-13 19:50       ` Gautier
2006-11-14  5:28         ` Jerry
2006-11-14  5:18       ` Jerry
2006-11-13 19:09     ` Jeffrey R. Carter
2006-11-14  7:31       ` Jerry [this message]
2006-11-14  7:54       ` Jerry
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox