?? nrhelp.txt
字號:
This file contains the complete plain text version of the material
displayed by the NRHELP program. Obviously, in this listing,
you should ignore instructions asking you to press function keys.
Instead, simply read, or print out, this file in a linear manner.
Main Menu
Press a function key (F1-F10) to jump to the following topics:
F1 - How to INSTALL the Numerical Recipes archives
F2 - License Information and WARRANTY DISCLAIMER
F3 - ANSI C vs. traditional K&R C files
F4 - How to use NRCOPY (accessing the files)
F5 - How to use the Example programs
F6 - How to order Numerical Recipes books
F7 - Compiler hints, troubleshooting, and common questions
F8 - List of the Numerical Recipes (REC archives)
F9 - List of the Example programs (EXA archives)
F10 - List of other supplied files (OTH archives)
You can also press these function keys from anywhere within
NRHELP. You can return to this menu by pressing Home.
The contents of this Numerical Recipes C Diskette are
Copyright (C) 1986-1994 Numerical Recipes Software.
All About INSTALL
The ONLY way to access the programs on your Numerical Recipes
diskette is to install them with the INSTALL program that is
provided. To use the INSTALL program, place the original diskette
into an appropriate drive (e.g., A:) and type A:INSTALL followed
by the <Enter> key. Then, follow the directions as indicated.
The Numerical Recipes routines consist of more than 600 individual
files (including both the recipes and the sample driver routines).
Fully unpacked, this large number of files requires excessive disk
space, and degrades the performance of programs that scan the full
directory tree. Furthermore, few users ever want to use more than
a small number of the routines at any one time.
We therefore supply the routines in the form of a small number of
compressed archive files, and a special dearchiving program called
NRCOPY. When properly installed, NRCOPY becomes a command that is
available from any working directory. On request, it creates a copy
of any desired routine. You can use, modify, or delete this copy:
a fresh copy can always be obtained by the NRCOPY command.
more...
Here is an overview of the INSTALL process: (If you have already
completed the installation, you might wish to verify that you went
through all these steps.)
1. You are asked to select a drive and subdirectory that are in
your DOS path. (Your current DOS path is displayed.) You can
choose an existing subdirectory or a new one. The archive
files must be somewhere in your path so that the NRCOPY command
is able to find them.
2. You are asked to enter your name, or the name of the person or
organization to whom the diskette is licensed. This name is
used to construct a short license validation file with a name
like NR20KEY.AR. This file must be kept in the same directory
as the archive files, otherwise NRCOPY will not be able to work.
3. The following files are copied to the subdirectory that you
chose: the archives NRC20REC.AR, NRC20EXA.AR, NRC20OTH.AR,
NRK20REC.AR, NRK20EXA.AR, and the executable commands NRCOPY.EXE
and NRHELP.COM (this file). The validation file NR20KEY.AR is
also put in place.
4. If (and only if) you requested that your AUTOEXEC.BAT file be
modified to include your chosen subdirectory in your DOS path,
this modification is made.
When the INSTALL process is complete, and after you have rebooted
your machine so that the PATH is reset, you will be able to use the
commands NRCOPY and NRHELP from any working directory. Press F4
now to get instructions for using NRCOPY. (For short instructions
at any time, just type NRCOPY at a DOS prompt.)
About ANSI C and K&R C
There are two dialects of the C language commonly in use. The older
one is called Kernighan and Ritchie (K&R) C or "traditional" C. The
newer one, which is fast replacing K&R C, is called ANSI C. The
program listings in the Numerical Recipes books are all in ANSI C.
We recommend that you use ANSI C if at all possible. Microsoft C/C++
version 7.0 and later is fully ANSI C compatible, as are current
versions of Borland C++ and Turbo C.
If you do use ANSI C, you should use the "C", not the "KRC" archives
on this diskette. Press F4 for information on how to use the
NRCOPY command to specify which archives are used. You must also be
aware that the header files nr.h and nrutil.h, and the utility files
nrutil.c and complex.c, all supplied in the "OTHER" archive, incorporate
both ANSI C and K&R C versions. To make the ANSI version active, you
must be sure that one of the following macros is defined at compile
time: ANSI, __STDC__, NRANSI.
Most ANSI compilers will automatically define __STDC__ if you specify
that you want ANSI C conformity. In Microsoft C, the command line
switch for this is "/Za". In Borland C, the switch is "-A". These
and most other compilers also allow you to define macros directly
on the command line. In Microsoft C, you would define ANSI by the
command line switch "/DANSI". In Borland C, the switch would be
"-DANSI". Consult your compiler documentation for more details.
As further backup, all the ANSI C files on this diskette themselves
internally #define NRANSI before accessing the header files nr.h or
nrutil.h. If you run into trouble, it is probably because you have
referenced one of these header files in your own program (or compiled
nrutil.c or complex.c) without the required #define NRANSI or command
line switch.
If you have a traditional or K&R C compiler, be sure to unpack your
files from the "KRC" archives. You need not (in fact, must not)
define any special macros at compile time.
Press F5 for sample command lines to unpack, compile, and
run programs from this diskette.
All About NRCOPY
The NRCOPY command can be executed at any DOS prompt, from any working
directory. It locates any desired Numerical Recipes files in the
archives, and makes useable copies in the directory of your choice.
It can also be used to list the contents of an archive (names of
the files) or to view on the screen, rather than copy, selected files.
The complete syntax of the command is:
NRCOPY C|KRC|FOR RECIPES|EXAMPLES|OTHER [files] [LIST|VIEW|TO path]
Here, arguments with bars, like "a|b|c", signify that you must
choose exactly one of a,b, or c, while square brackets like "[ ]"
signify that an argument is optional.
All arguments are case insensitive (you can type them in upper case,
lower case or any combination). The keywords C, KRC, FOR, RECIPES,
EXAMPLES, and OTHER, can be abbreviated down to a single letter,
C, K, F, R, E, and O, respectively.
The action of the command is as follows:
The C, K&R C, or FORTRAN archive (depending on the first argument)
that contains RECIPES, EXAMPLES or OTHER files (depending on the
second argument) is opened. (Only C and K&R C are included with this
diskette; if you also install the Numerical Recipes FORTRAN diskette,
the same NRCOPY command will manage both sets of archives.) Note that
"C" always means ANSI C, while "K" is used for K&R C.
The optional next argument(s) are scanned. If specific files are
named, then processing of the opened archive is limited to these.
(You need only enter the main part of the file name, not
the extension like .FOR or .DAT.) If there is no third argument,
or if the third argument is *, then all files are processed.
Wild cards, like "LU*" are also allowed in the third argument.
Note that the file names are separated by spaces, not by commas!
If there is no additional argument, then copies of the selected
files are made to the current directory. If the next argument
is TO followed by a final argument that is a valid path, then
copies are made in that path. (TO can be omitted if path contains
a \ or : character.) If the last argument is LIST, then only
filenames are listed to the screen, and no copies are made. If
the last argument is VIEW, then the selected files are listed
to the screen, and no copies are made. (You will generally want
to follow the VIEW argument by "| MORE" so that the file does not
run off the screen.)
NRCOPY appends a copyright notice at the end of each unpacked
.FOR or .C file. The notice is formatted so as to be a valid
program comment in the appropriate language. If you combine
several routines in a single file, you may delete all but one of
these lines. (We request that you leave one in each file that
contains copyrighted material.) There is a string of printable
characters at the end of the copyright notice that contains
information about the routine version number and your license.
Please include this string if you need to write us about a routine.
Some examples will clarify use of the NRCOPY command:
NRCOPY C RECIPES TO C:\MYDIR
(copy all ANSI C Recipes files to directory MYDIR on disk C:)
NRCOPY K EXAMP TO c:\MYDIR
(copy all K&R C examples files to directory mydir on disk C:)
NRCOPY F R LUDCMP LUBKSB
(copy FORTRAN routines LUDCMP and LUBKSB to the current directory)
NRCOPY c rec ludcmp lubksb g:
(create G:\LUDCMP.C and G:\LUBKSB.C on disk G:)
NRCOPY C other * LIST
(list to screen names of all files in C OTHER archive)
NRCOPY C EX xlubksb VIEW | MORE
(view on screen the routine XLUBKSB.C, pause each page)
If you ever need a quick review of the NRCOPY command, just type
NRCOPY (with no arguments) at any DOS prompt.
NRCOPY is based on the AR compression archiver of Haruhiko Okumura,
used by permission.
Numerical Recipes Examples
The Numerical Recipes Example Books (in C and FORTRAN),
published by Cambridge University Press, contain descriptions and
listings of sample programs that demonstrate and exercise all of the
Numerical Recipes routines. In previous editions, these demonstration
programs were available, machine-readable, only as a separate diskette.
Now, they are included, free, on this diskette. You can try out these
demonstration programs without having the Example Book itself. However,
to get the maximum benefit of these examples, you will want to read
the Example Book's additional descriptions and see the sample output.
You can get information on ordering the the Example Book by pressing F6.
The Example programs all have names beginning with "X". They must be
compiled with, or linked to, the routines that they demonstrate. Some
of the Example programs also use data files that are supplied on this
diskette in the "Other" archive. (Press F10 for a list of these
files. Press F9 for a list of all the Example programs.) To find
out what routines and/or data files are required by an Example program,
read its program listing.
Here are examples of how to unpack, compile and run a demonstration
program, in this case the demonstration of svdcmp.c.
Using Microsoft C/C++ compiler (assuming that include, library, and
initialization directories are specified in INCLUDE, LIB, and INIT
environment variables):
> NRCOPY C O nr.h nrutil.h nrutil.c [get utility files]
> CL /AH /F 8000 /DANSI /c nrutil.c [compile utility files]
> NRCOPY C E xsvdcmp [unpack the ANSI C example file]
> NRCOPY C R svdcmp pythag [unpack the necessary Recipes]
> NRCOPY C O matrx3 [unpack the data file]
> CL /AH /F 8000 /DANSI xsvdcmp.c svdcmp.c pythag.c nrutil.obj
[invoke the compiler]
> xsvdcmp [run the demonstration]
Using Borland C++ compiler (assuming that include and library
directories are specified in the default configuration file TURBOC.CFG):
> NRCOPY C O nr.h nrutil.h nrutil.c [get utility files]
> BCC -DANSI -K -mh -w- -c nrutil.c [compile utility files]
(The -w- option suppresses some unnecessary warning messages.)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -