comp.lang.ada
 help / color / mirror / Atom feed
* generic with function procedure
@ 2020-06-05 14:35 Gilbert Gosseyn
  2020-06-05 14:52 ` gautier_niouzes
  2020-06-09 16:44 ` Shark8
  0 siblings, 2 replies; 12+ messages in thread
From: Gilbert Gosseyn @ 2020-06-05 14:35 UTC (permalink / raw)


Hi,
I would like to code the nelder-mead algorithm in Ada to solve the following problem:
-- minimize f(x)
-- subject to:  g(j,x) <= 0.0 for j in 1..q
--                     h(j,x) = 0.0   for j in q+1..n

My definition for the solving procedure is:

generic
with function f(v : Real_Vector) return Real;
with function g(j : Integer; v : Real_Vector) return Real;
with function h(j : Integer; v : Real_Vector) return Real;
procedure denm (np,q,n,m : Integer);

However when I try to instantiate after having defined f1,g1,h1 like

procedure nm is new denm(f=>f1,g=>g1,h=>h1);

the message is: no visible subprogram matches the specification for "g"
                           no visible subprogram matches the specification for "h"

It therefor seems to be OK for "f=>f1" only.

How to make it working?


         

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-06-12 18:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05 14:35 generic with function procedure Gilbert Gosseyn
2020-06-05 14:52 ` gautier_niouzes
2020-06-05 15:45   ` Gilbert Gosseyn
2020-06-05 15:59     ` Dmitry A. Kazakov
2020-06-05 16:09       ` Anh Vo
2020-06-05 20:28     ` Jeffrey R. Carter
2020-06-09 16:44 ` Shark8
2020-06-10  8:21   ` Gilbert Gosseyn
2020-06-10  8:45     ` AdaMagica
2020-06-12 14:29     ` Shark8
2020-06-12 16:45     ` Simon Wright
2020-06-12 18:49       ` Simon Wright

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