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:a24:61c1:: with SMTP id s184-v6mr1059230itc.4.1533819635319; Thu, 09 Aug 2018 06:00:35 -0700 (PDT) X-Received: by 2002:aca:f495:: with SMTP id s143-v6mr76229oih.7.1533819634760; Thu, 09 Aug 2018 06:00:34 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.albasani.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!g24-v6no2939771iti.0!news-out.google.com!k71-v6ni3710itk.0!nntp.google.com!g24-v6no2939768iti.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 9 Aug 2018 06:00:34 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=217.63.105.50; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG NNTP-Posting-Host: 217.63.105.50 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Newton-Levenberg-Marquardt method in Ada? From: gautier_niouzes@hotmail.com Injection-Date: Thu, 09 Aug 2018 13:00:35 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2670 X-Received-Body-CRC: 3154842418 Xref: reader02.eternal-september.org comp.lang.ada:54103 Date: 2018-08-09T06:00:34-07:00 List-Id: Le jeudi 9 ao=C3=BBt 2018 01:35:56 UTC+2, van.s...@jpl.nasa.gov a =C3=A9cri= t=C2=A0: > A colleague is developing an instrument to measure CO2 and oxygen concent= ration in the International Space Station. >=20 > In order to do that, he needs to invert a nonlinear function. > The usual way to do that is a Newton-Levenberg-Marquardt iteration. > Many numerical libraries have software for it in Fortran or C. > Does anybody have a highly-reliable Newton-Levenberg-Marquardt method in = Ada? Hi, As suggested, you can use the pragma Import for your C or Fortran code. Often I prefer to translate these algorithms (preferably from Fortran or Pa= scal using an automatic translator, then reviewing manually): - often they contain magic numbers, typically epsilon's for floating poin= t types of some VAX machine that won't match the floating point type(s) you= are actually using - you can spot border-line cases where variants of algorithms are switche= d, sometimes not in a smooth way... - you sometimes find that cannot be detected by Fortran or C, like indexe= s going outside their intended range And don't forget to test extensively these numerical algorithms (in whichev= er language). Even code that seems to be "safe" because it is in a famous d= ecades-old library can contain awful bugs - used by everybody, tested by no= body!