nr.h???


sverregu
04-09-2002, 10:11 AM
In NR in C++ it says in Appendix A that the file nr.h may be downloaded from the internet. Where can I find this file, and how much do I have to pay?

William Vetterling
04-09-2002, 06:03 PM
Thanks for your question.

The statement in Appendix A is actually that the the contents of Appendix A are contained in a file named nr.h in the Numerical Recipes machine-readable distribution, which is available on CDROM or by immediate download from the Internet. Current prices may be found by visiting the On-Line Software Store at www.nr.com (http://www.nr.com) (for the downloadable version), or by following the link to Cambridge University Press or Amazon Books (for the CDROMs).

Bill Press
04-10-2002, 09:06 AM
Let me add an additional clarification.

The file nr.h, printed in Appendix A of the NR in C++ book, is the interface file to all the NR routines. Its important part looks something like this:

namespace NR {
void addint(Mat_O_DP &uf, Mat_I_DP &uc, Mat_O_DP &res);
void airy(const DP x, DP &ai, DP &bi, DP &aip, DP &bip);
...
void zroots(Vec_I_CPLX_DP &a, Vec_O_CPLX_DP &roots, const bool &polish);
}

This file is an integral part of the NR in C++ machine-readable code product, so it is licensed as part of that product and included in the product downloads. It is not in the public domain. Purchase and download are available at http://www.nr.com/com/storefront.html .

There are several useful files in Appendix B of the NR in C++ book that are in the public domain and freely available at http://www.nr.com/public-domain.html . These are the files necessary for using the NR in C++ data types (including defining those above like Mat_I_DP) in user-written programs with or without the NR routines, and for using NR routines with 3rd party vector/matrix class libraries.

Hope this helps.

sverregu
04-11-2002, 02:12 AM
So, if I understand you right, I don't actually need nr.h to get the codes in NR to work.
If I want to make use of a NR-application in one of my programs, I just have to include for instance nrtypes.h instead og nr.h.

As you may have understood, I have only purchased your book, not the machine-readable stuff.

Bill Press
04-11-2002, 09:41 PM
Correct. You might need some of the #include's that are the first few lines of nr.h (see book), and then the relevant few lines inside the NR namespace that define the interface for the NR routines that you are using. Other than that, it is all in nrtypes.h and nrutil.h, both of which you can get at the link given in the previous reply (and are in the public domain). Good luck!