comp.lang.ada
 help / color / mirror / Atom feed
From: hnptz@yahoo.de
Subject: Re: Ada.Numerics.Long_Real_Arrays
Date: Thu, 26 Jan 2017 03:54:07 -0800 (PST)
Date: 2017-01-26T03:54:07-08:00	[thread overview]
Message-ID: <712de11c-94ae-4703-8cfb-9ff2decccaeb@googlegroups.com> (raw)
In-Reply-To: <88df1d97-6f7a-410f-8d1b-fa1d3ee44ea7@googlegroups.com>

On Thursday, January 26, 2017 at 8:47:07 AM UTC+1, Simon Wright wrote:
> hnptz@yahoo.de writes:
> 
> > I have nm_G.ads, nm.ads, nm.adb and test_nm.adb, and I want to specify
> > Np in test_nm.adb only, How can it be made possible ?
> 
> The thing is, you've supplied code examples that wouldn't even begin to
> compile because you've cut out so much and replaced with
> english-language text. The result is that we have no real idea what
> you're talking about.

I have conducted four files:

1. file nm_g.ads:

with Ada.Numerics.Long_Real_Arrays; 
generic 
  Np : Positive; 
package Nm_G is 
   subtype R_Vector 
     is Ada.Numerics.Long_Real_Arrays.Real_Vector (1 .. Np); 
   type R_Matrix is array (1 ..Np+1) of R_Vector; 
end Nm_G; 

2. file nm.ads:

with Ada.Numerics.Long_Real_Arrays; use Ada.Numerics.Long_Real_Arrays;
with nm_g;
package nm is
…
generic
with function f(R : R_Vector) return Long_Float;
procedure fnm ( P : in out R_Matrix);
…
end nm;

result: R_Matrix is not visible. But I don’t know Np at this moment.

3. file nm.adb:

package body nm is
…
procedure fnm ( P : in out R_Matrix) is
…
end fnm;
end nm;

result: R_Matrix is not visible. But I still don’t know Nt at this moment.

4. file test_nm.adb

with nm; use nm;
procedure test_nm is
Np : Positive := 2;
P : R_Matrix := ((1.0,2.0),(3.0,4.0),(5.0,6.0));
begin
fnm(P);
end test_nm;

result: cannot work

I admit this is only the way, I would like to set up the project. However, using an array of Real_Vectors may require a different approach.


  reply	other threads:[~2017-01-26 11:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 12:25 Ada.Numerics.Long_Real_Arrays hnptz
2017-01-25 13:50 ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-25 14:11 ` Ada.Numerics.Long_Real_Arrays hnptz
2017-01-25 16:17   ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-25 18:35 ` Ada.Numerics.Long_Real_Arrays hnptz
2017-01-25 21:29 ` Ada.Numerics.Long_Real_Arrays hnptz
2017-01-26  7:47   ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-26 11:54     ` hnptz [this message]
2017-01-26 14:52       ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-26 15:03         ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-26  7:49   ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-26  7:55     ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-27 16:51 ` Ada.Numerics.Long_Real_Arrays hnptz
2017-01-27 18:39   ` Ada.Numerics.Long_Real_Arrays Simon Wright
replies disabled

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