comp.lang.ada
 help / color / mirror / Atom feed
From: gautier_niouzes@hotmail.com
Subject: Re: Newton-Levenberg-Marquardt method in Ada?
Date: Thu, 9 Aug 2018 06:00:34 -0700 (PDT)
Date: 2018-08-09T06:00:34-07:00	[thread overview]
Message-ID: <ca0dc58a-9866-4dbb-8a3e-63249e8990be@googlegroups.com> (raw)
In-Reply-To: <e9de8880-8b97-4aeb-8974-673584520076@googlegroups.com>

Le jeudi 9 août 2018 01:35:56 UTC+2, van.s...@jpl.nasa.gov a écrit :
> A colleague is developing an instrument to measure CO2 and oxygen concentration in the International Space Station.
> 
> 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 Pascal using an automatic translator, then reviewing manually):
  - often they contain magic numbers, typically epsilon's for floating point 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 switched, sometimes not in a smooth way...
  - you sometimes find that cannot be detected by Fortran or C, like indexes going outside their intended range
And don't forget to test extensively these numerical algorithms (in whichever language). Even code that seems to be "safe" because it is in a famous decades-old library can contain awful bugs - used by everybody, tested by nobody!

      parent reply	other threads:[~2018-08-09 13:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 23:35 Newton-Levenberg-Marquardt method in Ada? van.snyder@jpl.nasa.gov
2018-08-09  1:23 ` Lucretia
2018-08-09 13:00 ` gautier_niouzes [this message]
replies disabled

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