From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:aed:206c:: with SMTP id 99mr10182249qta.87.1591367731725; Fri, 05 Jun 2020 07:35:31 -0700 (PDT) X-Received: by 2002:aca:57d7:: with SMTP id l206mr2011197oib.84.1591367731454; Fri, 05 Jun 2020 07:35:31 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!news.muarf.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 5 Jun 2020 07:35:31 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=2a02:6d40:37c2:c301:a002:bb03:d92f:7eb; posting-account=3Fg1FgoAAACfsmWScNfMD1tGFhR4DU0o NNTP-Posting-Host: 2a02:6d40:37c2:c301:a002:bb03:d92f:7eb User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: generic with function procedure From: Gilbert Gosseyn Injection-Date: Fri, 05 Jun 2020 14:35:31 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:58968 Date: 2020-06-05T07:35:31-07:00 List-Id: 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?