Monday, January 26, 2009

Install LEVMAR on Cygwin

I would like to use LEVMAR on Cygwin.
LEVMAR is abbreviation of Levenberg-Marquardt nonlinear least squares algorithms in C/C++,

First of all, you will be suggested by the author of LEVMAR to install LPACK packages,
Install LApack package from Cygwin Math category.

You also need f2c first before install levmar.

I prefer the source code from 2nd URL. There are few problem when making.
Then copy the /libf2c/libf2c.a to lib, and copy /src/f2c to bin, as the instructions of 1st URL.

Then type make under levmar-2.3. You should be make succesfully. If no, watch out the error message and install what package you miss.

If succesfully, you can type ./lmdemo.exe to run the demo execution to test and get the results following,
===================================================
$ ./lmdemo.exe
Covariance of the fit:
0.00483514 -0.00162445 -0.000548114
-0.00162445 0.000546079 0.000184356
-0.000548114 0.000184356 6.22705e-05

Results for Meyer's (reformulated) problem:
Levenberg-Marquardt returned 209 in 209 iter, reason 2
Solution: 2.481778 6.181346 3.502236

Minimization info:
1308.25 8.79459e-05 1.10765e-07 2.65846e-34 129559 209 2 273 21
===================================================
There are another two useful math packages.
There is a good tutorial webpage to show how to install the 2 packages.


No comments:

Clicky

Clicky Web Analytics