comp.lang.ada
 help / color / mirror / Atom feed
From: Gilbert Gosseyn <hnptz@yahoo.de>
Subject: generic with function procedure
Date: Fri, 5 Jun 2020 07:35:31 -0700 (PDT)
Date: 2020-06-05T07:35:31-07:00	[thread overview]
Message-ID: <d10989b4-ed2f-47c8-8f95-4d2f0d9cdafdo@googlegroups.com> (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?


         

             reply	other threads:[~2020-06-05 14:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05 14:35 Gilbert Gosseyn [this message]
2020-06-05 14:52 ` generic with function procedure 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
replies disabled

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