comp.lang.ada
 help / color / mirror / Atom feed
From: hnptz@yahoo.de
Subject: Re: Ada.Numerics.Long_Real_Arrays
Date: Wed, 25 Jan 2017 13:29:41 -0800 (PST)
Date: 2017-01-25T13:29:41-08:00	[thread overview]
Message-ID: <23d8f4a2-867e-4fae-b056-952039ab0732@googlegroups.com> (raw)
In-Reply-To: <5a19787c-a11c-470e-8cef-2c5dc4897bf7@googlegroups.com>

On Wednesday, January 25, 2017 at 1:25:18 PM UTC+1, hn...@yahoo.de wrote:
> Hi,
> 
> these are my definitions:
> 
> with Ada.Numerics.Long_Real_Arrays; use Ada.Numerics.Long_Real_Arrays;
> package nm is
> 
> Np : Positive;
> Type R_Vector is new Real_Vector (1..Np);
> Type R_Matrix is array (Positive range <>) of R_Vector;
> 
> procedure nm1 (P : in out R_Matrix);
> 
> end nm;
> 
> -- definition of procedure nm1 in package body nm done.
> 
> now in procedure test_nm.adb (only definitions):
> 
> Np : Positive := 2;
> Mp : Positive := Np+1;
> 
> 24  P : R_Matrix(1..Mp) := ((x,x),(y,y),(z,z));
> 
> no "build all" error or warning
> 
> result when running:
> 
> raised CONSTRAINT_ERROR : test_nm.adb: 24 length check failed.
> 
> Can you help?

I have conducted the following:

nm_G.ads -- generic package as suggested -- value of Np not known

nm.ads  with nm_g
package nm is -- Np still not known
...
generic
with function f(R : R_Vector) return Long_Float;
procedure fnm(P : in out R_Matrix); -- R_Matrix is not visible
...
end nm;

nm.adb
package body nm is --Np still not known
Procedure fnm(P : in out R_Matrix) is
...
end fnm; -- R_Matrix not visible
end nm;

test_nm.adb
procedure test_nm is
-- Np known
-- instantiation of R_Matrix not possible as nm.ads has errors
Definitions for f;
call for fem;
end test_nm;

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 ?

  parent reply	other threads:[~2017-01-25 21:29 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 ` hnptz [this message]
2017-01-26  7:47   ` Ada.Numerics.Long_Real_Arrays Simon Wright
2017-01-26 11:54     ` Ada.Numerics.Long_Real_Arrays hnptz
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