Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!math.fu-berlin.de!fub!kirste From: kirste@methan.chemie.fu-berlin.de (Burkhard Kirste) Newsgroups: comp.sys.atari.st Subject: Re: Numerical Recipes Message-ID: Date: 27 Feb 91 13:57:20 GMT References: <1991Feb13.1113.5265@canrem.uucp> <1991Feb22.210921.28469@jato.jpl.nasa.gov> <1991Feb23.174459.4432@mailer.cc.fsu.edu> <1991Feb26.195253.12293@jato.jpl.nasa.gov> Distribution: comp Organization: Free University of Berlin, Organic Chemistry Lines: 37 vsnyder@jato.jpl.nasa.gov (Van Snyder) writes: >In article <1991Feb23.174459.4432@mailer.cc.fsu.edu> boyd@nu.cs.fsu.edu (Mickey Boyd) writes: >>In article <1991Feb22.210921.28469@jato.jpl.nasa.gov>, vsnyder@jato.Jpl.Nasa.Gov (Van Snyder) writes: >>>In article <1991Feb13.1113.5265@canrem.uucp> "tellabs canada" writes: >>>>-> - spline algorithms >>>> >>>>Look for Numerical Recipes in C (mathematicians programming bible), [stuff deleted] > >As far as we can tell, the C algorithms are just a straight translation of the >Fortran algorithms. No improvements. Aside: C compilers that aren't ANSI-C Yes, for the most part it looks like an automatic translation; in most instance, e.g., they kept the array numbering starting with 1, not 0. A few routines have experienced major rewriting. >will have some problems (i.e. require you to do some gymnastics) with numerical >analysis that won't happen in Fortran. Even ANSI C has trouble with matrices, >since arrays don't really exist in C (they're bogus pointers). Tha main problem >in porting linear algebra codes from Fortran to C is in the transposition from >column major storage order to row major storage order. I don't see serious problems in the internals of storage (column or row major), as long as one would not like to exchange the binary output. Arrays DO exist in C, of course; the only problem might be with range checking. Regarding two-dimensional arrays, one might use either true arrays twodim[][fixed] (only the first bound may left open) or the pointer to pointer method, **twodim. NR uses the second method and provides routines matrix and free_matrix for storage allocation and deallocation (as well as vector and free_vector for 1D arrays with arbitrary bounds, to keep compatibility with Fortran ...). -- |~| Freie Universitaet Berlin, Institut fuer Organische Chemie / \ Burkhard Kirste kirste@kristall.chemie.fu-berlin.dbp.de /FUB\ Takustrasse 3, D-1000 Berlin 33 UUCP: kirste@fub.uucp `---' Telefon: (030)838-6484 Telefax: (030)838-5163