comp.lang.ada
 help / color / mirror / Atom feed
From: Jerry <lanceboyle@qwest.net>
Subject: Re: How do I "with" Numerics without linking BLAS, LAPACK? (and more)
Date: Tue, 31 Aug 2010 17:05:56 -0700 (PDT)
Date: 2010-08-31T17:05:56-07:00	[thread overview]
Message-ID: <16c85eec-213d-4a90-8338-058b4ceff2df@l38g2000pro.googlegroups.com> (raw)
In-Reply-To: i5if4m$v54$1@news.eternal-september.org

On Aug 31, 1:39 am, "J-P. Rosen" <ro...@adalog.fr> wrote:
> 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 (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



      reply	other threads:[~2010-09-01  0:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-31  8:24 How do I "with" Numerics without linking BLAS, LAPACK? (and more) Jerry
2010-08-31  8:39 ` J-P. Rosen
2010-09-01  0:05   ` Jerry [this message]
replies disabled

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