Path: news.mathworks.com!newsfeed-00.mathworks.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Scott Seidman <namdiesttocs@mindspring.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Numerical recipes in Matlab
Date: 19 Jan 2005 21:30:34 GMT
Organization: Your Company
Lines: 50
Message-ID: <Xns95E3A7F25A389scottseidmanmindspri@130.133.1.4>
References: <eef9109.-1@webx.raydaftYaTP> <4azHd.2457$Ny6.4062@mencken.net.nih.gov>
X-Trace: individual.net /nQLUuzIS0Z+Mg/t2IJUJQqycg5eauoiWUsexhys9QHC59hr4=
User-Agent: Xnews/5.04.25
Xref: news.mathworks.com comp.soft-sys.matlab:255308



"Brett Shoelson" <shoelson.no.spam@removethis.helix.nih.gov> wrote in
news:4azHd.2457$Ny6.4062@mencken.net.nih.gov: 

> 
> "Navin" <gnavin1@gmail.com> wrote in message 
> news:eef9109.-1@webx.raydaftYaTP...
>>I understand that there is no book as such for numerical recipes in
>> matlab. Did anyone of you ever converted the Codes of Numerical
>> recipes in C into Matlab using MEX functions (External/API
>> interfaces). If yes please let me know.
> 
> I guess I have to come down on the side of the dissenters here. I've
> found NR (in C/C++, FORTRAN) to be very useful over the years, and
> while I have heard of the occasional bug, I have not experienced any
> myself. My code for Lomb-Scargle periodogram analysis (on the FEX) is
> a direct translation from NR/FORTRAN into ML. And while writing
> _efficient_ code in ML might not always be trivial, translating
> directly (including lots of unnecessary nested for loops, etc.) into
> mcode is pretty easy. So do as Scott recommends: use the NR in your
> favorite non-ML language as a coding guide and translate away!
> Cheers,
> Brett 
> 
> 

I'm sure that most of the bugs are resolved.  If you google up "Numerical 
Recipes bugs" you'll see that the NR folks dismiss them as "distressing 
rumors", but pages like http://www.uwyo.edu/buerkle/misc/wnotnr.html go 
into some detail about the nature of some of the problems.  

Push comes to shove, when using any sort of numerical libraries, try to 
use something with a huge user base and many reviews.  IMSL and netlib 
come to mind, as does (of course) matlab.

I'm a big fan, though, of the idea that to use an algorithm correctly, it 
really can help to have an idea of what is in the algorithm.  In terms of 
reviewing bunches of algorithms in a way that people can understand them, 
NR is fantastic.  Of course, this idea has its limits-- NL2SOL is one of 
my favorite nonlinear optimizers, and it can use many different 
optimization routines, choosing which one it will use for any given 
iteration based on the nature of the problem.  I don't really have any 
interest in learning what lies under the hood of each and every 
algorithm.

BTW, has anyone written a matlab wrapper for NL2??  Fortran has its 
proponents (myself included), but if any update of the language actually 
made I/O easy, then it wouldn't be Fortran anymore!  I'd much rather work 
from the matlab side.

Scott