Skip to content Accesskey=4Skip to sub-navigation Accesskey=3View our Accessibility Options MIT Information Systems Home About IS&T Contact IS&T Site Map Search Advanced Search
Getting StartedGetting Services by Topic or Alphabetically Getting Help

On This Page

[Help]

  

Quick Links

Top Level

Related Links

Ask OLC a question

Athena Consulting Homepage

Helpdesk Stock Answers (for Mac/PC questions)


How to access the NUMERICAL RECIPES library

The numerical subroutines from the book _Numerical Recipes_ by William Press,
et al. are installed on Project Athena.  There are approximately 200 routines,
which cover a large range of subjects.  The source code for the routines are
available, and the book documents and explains the mathematics behind the
routines.

Both C and Fortran versions are available in the "recipes" locker.  The source
code is in the directory

	/mit/recipes/src

To use the libraries from your C program, you'd type:

	attach recipes
	cc filename `athdir /mit/recipes lib`

To use the libraries from your Fortran program, you'd type:

	attach recipes
	add -f gnu
	g77 -o file file.f -L`athdir /mit/recipes lib` -lrecipes_f	

The layout of the recipes locker is as follows:
The src directory has 2 subdirectories, one for C and one for fortran:

      src/recipes_c-ansi       ----->   The Ansi-C version
      src/recipes_c-kr	       ----->   The K&R C version
      src/recipes_f            ----->   The fortran version

Each of these subdirectories contain the source for Numerical Recipes and the
source for the demo/example programs. The NR sources are in

      src/recipes_{c,f}/recipes

The demo/example sources are in

     src/recipes_{c,f}/demo/src

Due to a conflict with libm.a, there were 2 changes made in the Numerical
Recipes "C" sources:

    1.    erf   has been renamed erf_nr
    2.    erfc  has been renamed erfc_nr


MIT Home | Getting Started | Getting Services | Getting Help | About IS&T | Accessibility
Ask a technology question or send a comment about this web page.