4 ms·
The code in the c edition uses 1 for the index origin, via a utility library that provides vectors and matrices that provide Fortran-like indexing.
by vibrolax 10y ago
The code in the c edition uses 1 for the index origin, via a utility library that provides vectors and matrices that provide Fortran-like indexing.
- jabl 10y ago"Besides, the determined Real Programmer can write Fortran programs in any language." - Ed Post, Real Programmers Don't Use Pascal
- weinzierl 10y agoPage 18 and 19 of the second edition of Numerical Recipes in C [1] support your comment. There is also a discussion on the books forum [2] that suggests that all C editions are 1-based and the current C++ editions are 0-based. This doesn't fit my recollection of having the C edition with a foreword that described how hard and error prone it was to convert everything from 1-based to 0-based. Maybe my memory plays tricks on me. I'm sure I had the C edition and not the C++ edition and this was before 2000. [1] http://apps.nrbook.com/c/index.html http://apps.nrbook.com/c/index.html [2] http://numerical.recipes/forum/showthread.php?t=65&highlight=0-based http://numerical.recipes/forum/showthread.php?t=65&highlight...
- vibrolax 10y agoMy experience with "NR in C" is 2e. There were a number of routines I wanted to run on data stored in native C arrays, so I painstakingly re-wrote the NR functions to use 0-index single dimension C arrays.