# HG changeset patch # User jwe # Date 857424513 0 # Node ID c15eee2a86e1fee79da06091b55f027143b5b2cc # Parent fe0c14d48a813448b81e266d569e2faa6f8c30fb [project @ 1997-03-03 21:23:47 by jwe] diff --git a/cxxlibs.sh b/cxxlibs.sh deleted file mode 100755 --- a/cxxlibs.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -# -# cxxlibs -- try to get the C++ compiler to tell us what libraries -# it expects to link to, and echo the result to the standard output. -# -# John W. Eaton -# jwe@che.utexas.edu -# Department of Chemical Engineering -# The University of Texas at Austin - -trap 'rm -f conftest* core; exit 1' 1 3 15 - -# Write a minimal program and compile it with -v. I don't know what -# to do if your compiler doesn't have -v... - -echo "int main (void) { return 0; }" > conftest.c - -# I don't think that stripping commas out of this will ever hurt. - -coutput=`${CXX-c++} -v -o conftest conftest.c 2>&1 | sed 's/,/ /g'` - -clibs= -lflags= -want_arg= - -for arg in $coutput -do - if test x$want_arg = x - then - want_arg= - case $arg in - /*.a) - exists=false - for f in $lflags - do - if test x$arg = x$f - then - exists=true - fi - done - if $exists - then - arg= - else - lflags="$lflags $arg" - fi - ;; - -[LR]*) - exists=false - for f in $lflags - do - if test x$arg = x$f - then - exists=true - fi - done - ;; - -l*) - if test x$arg = x-lang-c++ - then - arg= - else - lflags="$lflags $arg" - fi - ;; - -u) - want_arg=$arg - ;; - *) - arg= - ;; - esac - else - want_arg= - fi - if test x$arg != x - then - clibs="$clibs $arg" - fi -done - -echo "$clibs" - -rm -f conftest* core - -# Bye-bye. - -exit 0 diff --git a/doc/interpreter/amuse.texi b/doc/interpreter/amuse.texi deleted file mode 100644 --- a/doc/interpreter/amuse.texi +++ /dev/null @@ -1,29 +0,0 @@ -@c Copyright (C) 1996, 1997 John W. Eaton -@c This is part of the Octave manual. -@c For copying conditions, see the file gpl.texi. - -@cindex amusements -@node Amusements, Tips, Programming Utilities, Top -@chapter Amusements - -@cindex lottery numbers -@cindex numbers, lottery -@deftypefn {Function File} {} texas_lotto () -Octave cannot promise that you will actually win the lotto, but it can -pick your numbers for you. The function @code{texas_lotto} will select -six numbers between 1 and 50. -@end deftypefn - -@cindex prime numbers -@cindex numbers, prime -@deftypefn {Function File} {} list_primes (@var{n}) -Computes the first @var{n} primes using a brute-force algorithm. -@end deftypefn - -@findex casesen -@findex flops -@findex exit -@findex quit -@findex warranty -Other amusing functions include @code{casesen}, @code{flops}, -@code{sombrero}, @code{exit}, @code{quit}, and @code{warranty}. diff --git a/doc/interpreter/extend.texi b/doc/interpreter/extend.texi deleted file mode 100644 --- a/doc/interpreter/extend.texi +++ /dev/null @@ -1,156 +0,0 @@ -@c Copyright (C) 1996, 1997 John W. Eaton -@c This is part of the Octave manual. -@c For copying conditions, see the file gpl.texi. - -@node Adding New Functions -@chapter Adding New Functions -@cindex Functions - -The following is not complete -give you some idea about why things are they way they are. - -Here's what you need to do to add a new function (I'll use svd() as an -example): - - 1. Add the name of the new function to the general_functions list in - builtins.cc: - - static builtin_general_functions general_functions[] = - { - ... - - { "svd", 2, 3, builtin_svd, - "[U, S, V] = svd (X): return SVD of X\n", }, - - ... - }; - - The builtin_general_functions struct is defined in builtns.h: - - struct builtin_general_functions - { - char *name; - int nargin_max; - int nargout_max; - General_fcn general_fcn; - char *help_string; - }; - - name is what the user types (e.g. `svd'); - - nargin_max and nargout_max are the maximum number of input and - output arguments. These are not really important. I had - originally planned to use them to allow Octave to do some - checking to see if the user had supplied the correct number of - arguments, but that doesn't really work very well. It seems - better to have each function check (since different numbers of - input arguments may mean different things). - - Note: nargin == 1 means that the function takes no arguments (just - like C, the first argument is (or should be, anyway) the function - name). Also, -1 is shorthand for infinity. - - general_fcn is the function you need to define to do the real - work. Usually called builtin_foo, for function foo. More about - the form of this function is given below. - - help_string is the message that the user will get if he types - `help svd'. - - Yes, the initialization of this structure is a bit clumsy. I'm - probably going to try to fix that at some point, but don't really - know exactly how and haven't had time to do it right yet. - - 2. Write the function that does all the work. I've adopted the - following convention: - - * Declare the function in g-builtins.h. All `general' - functions take the same arguments: - - builtin_svd (const tree_constant *args, int nargin, int nargout) - - - args: a vector of tree_constants, which is the basic - data structure for values in Octave. Currently, a - tree_constant can be a real or complex scalar or matrix, - a range, or a string. - - - nargin: the number of arguments the user provided plus - one. args[0] is supposed to hold the function name, but - I'm not sure that that's always true yet. - - - nargout: the number of arguments the user provided on - the left side of an assignment, or one if no assignment - is being done (because of the implicit assignment to ans - that will occur). - - * Define the function in g-builtins.cc. Usually, the function - in g-builtins.cc only contains simple checks to see if the - correct number of arguments have been supplied and then a - call to the function that REALLY :-) does all the work. - - If the function is small, it's probably reasonable to define - it in tc-extras.cc. - - If the function is not small, or if it depends on external - fortran code, it is probably best to put it in its own file - (for example, f-svd.cc). If dynamic linking is ever really - made to work, it will be important for functions to be - implemented this way. - - To make it easier to make all of this work in the future, - calls are written using the DLD_FUNC macro defined at the top - of g-builtins.cc. For example: - - DLD_BUILTIN (args, nargin, nargout, svd, - retval = svd (args, nargin, nargout);) - - If dynamic linking is being used, this expands to - - return octave_dld_tc2_and_go (args, nargin, nargout, "svd", \ - "builtin_svd_2", "f-svd.o")); - - which is a call to a function that will take care of patching - in the function builtin_svd_2, which is defined in the file - f-svd.cc (corresponding to the object file f-svd.o). - - Otherwise, it simply expands to - - retval = svd (args, nargin, nargout); - - (a function that is also defined in f-svd.cc). - - * If the function is defined in a separate file, like f-svd.cc, - it should be implemented like the others that already exist. - The code like - - #ifdef WITH_DLD - tree_constant * - builtin_svd_2 (tree_constant *args, int nargin, int nargout) - { - return svd (args, nargin, nargout); - } - #endif - - is just a hook for dynamic loading. It was implemented this - way so that the names of all the functions that are to be - loaded dynamically would have consistent form (so that they - could easily be constructed from the name that the user - types). - - The rest of the code defined in this file does the real - work. In the case of svd, it uses some C++ classes to call - the required Fortran subroutines. The class interfaces are - defined in liboctave/Matrix.h, and the class definitions are - (for things like SVD, HESS, LU, EIG, etc.) are in - Matrix-ext.cc. - - 3. If you add a new file (like f-svd.cc), don't forget to add it to - the list of files in Makefile.in, then use configure to update - the Makefile. - - -You should use the error reporting functions defined in error.{h,cc} -instead of writing messages directly to cout or cerr. - -That way, it will be easier to maintain a consistent look to the -warning and error messages. diff --git a/doc/interpreter/intro-fig.tex b/doc/interpreter/intro-fig.tex deleted file mode 100644 --- a/doc/interpreter/intro-fig.tex +++ /dev/null @@ -1,594 +0,0 @@ -% GNUPLOT: LaTeX picture with Postscript -\setlength{\unitlength}{0.1bp} -\special{! -%!PS-Adobe-2.0 -%%Creator: gnuplot -%%DocumentFonts: Helvetica -%%BoundingBox: 50 50 770 554 -%%Pages: (atend) -%%EndComments -/gnudict 40 dict def -gnudict begin -/Color false def -/Solid false def -/gnulinewidth 5.000 def -/vshift -33 def -/dl {10 mul} def -/hpt 31.5 def -/vpt 31.5 def -/M {moveto} bind def -/L {lineto} bind def -/R {rmoveto} bind def -/V {rlineto} bind def -/vpt2 vpt 2 mul def -/hpt2 hpt 2 mul def -/Lshow { currentpoint stroke M - 0 vshift R show } def -/Rshow { currentpoint stroke M - dup stringwidth pop neg vshift R show } def -/Cshow { currentpoint stroke M - dup stringwidth pop -2 div vshift R show } def -/DL { Color {setrgbcolor Solid {pop []} if 0 setdash } - {pop pop pop Solid {pop []} if 0 setdash} ifelse } def -/BL { stroke gnulinewidth 2 mul setlinewidth } def -/AL { stroke gnulinewidth 2 div setlinewidth } def -/PL { stroke gnulinewidth setlinewidth } def -/LTb { BL [] 0 0 0 DL } def -/LTa { AL [1 dl 2 dl] 0 setdash 0 0 0 setrgbcolor } def -/LT0 { PL [] 0 1 0 DL } def -/LT1 { PL [4 dl 2 dl] 0 0 1 DL } def -/LT2 { PL [2 dl 3 dl] 1 0 0 DL } def -/LT3 { PL [1 dl 1.5 dl] 1 0 1 DL } def -/LT4 { PL [5 dl 2 dl 1 dl 2 dl] 0 1 1 DL } def -/LT5 { PL [4 dl 3 dl 1 dl 3 dl] 1 1 0 DL } def -/LT6 { PL [2 dl 2 dl 2 dl 4 dl] 0 0 0 DL } def -/LT7 { PL [2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 1 0.3 0 DL } def -/LT8 { PL [2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 2 dl 4 dl] 0.5 0.5 0.5 DL } def -/P { stroke [] 0 setdash - currentlinewidth 2 div sub M - 0 currentlinewidth V stroke } def -/D { stroke [] 0 setdash 2 copy vpt add M - hpt neg vpt neg V hpt vpt neg V - hpt vpt V hpt neg vpt V closepath stroke - P } def -/A { stroke [] 0 setdash vpt sub M 0 vpt2 V - currentpoint stroke M - hpt neg vpt neg R hpt2 0 V stroke - } def -/B { stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M - 0 vpt2 neg V hpt2 0 V 0 vpt2 V - hpt2 neg 0 V closepath stroke - P } def -/C { stroke [] 0 setdash exch hpt sub exch vpt add M - hpt2 vpt2 neg V currentpoint stroke M - hpt2 neg 0 R hpt2 vpt2 V stroke } def -/T { stroke [] 0 setdash 2 copy vpt 1.12 mul add M - hpt neg vpt -1.62 mul V - hpt 2 mul 0 V - hpt neg vpt 1.62 mul V closepath stroke - P } def -/S { 2 copy A C} def -end -%%EndProlog -} -\begin{picture}(3600,2160)(0,0) -\special{" -%%Page: 1 1 -gnudict begin -gsave -50 50 translate -0.100 0.100 scale -0 setgray -/Helvetica findfont 100 scalefont setfont -newpath --500.000000 -500.000000 translate -LTa -480 151 M -2937 0 V -480 151 M -0 1958 V -LTb -480 151 M -63 0 V -2874 0 R --63 0 V -480 543 M -63 0 V -2874 0 R --63 0 V -480 934 M -63 0 V -2874 0 R --63 0 V -480 1326 M -63 0 V -2874 0 R --63 0 V -480 1717 M -63 0 V -2874 0 R --63 0 V -480 2109 M -63 0 V -2874 0 R --63 0 V -480 151 M -0 63 V -0 1895 R -0 -63 V -774 151 M -0 63 V -0 1895 R -0 -63 V -1067 151 M -0 63 V -0 1895 R -0 -63 V -1361 151 M -0 63 V -0 1895 R -0 -63 V -1655 151 M -0 63 V -0 1895 R -0 -63 V -1949 151 M -0 63 V -0 1895 R -0 -63 V -2242 151 M -0 63 V -0 1895 R -0 -63 V -2536 151 M -0 63 V -0 1895 R -0 -63 V -2830 151 M -0 63 V -0 1895 R -0 -63 V -3123 151 M -0 63 V -0 1895 R -0 -63 V -3417 151 M -0 63 V -0 1895 R -0 -63 V -480 151 M -2937 0 V -0 1958 V --2937 0 V -480 151 L -LT0 -3114 1946 M -180 0 V -480 934 M -495 556 L -510 361 L -14 -94 V -15 -46 V -15 -24 V -15 -13 V -14 -8 V -15 -5 V -15 -3 V -15 -2 V -14 -1 V -15 -1 V -15 -1 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 1 V -15 0 V -15 1 V -15 0 V -14 1 V -15 1 V -15 1 V -15 1 V -14 1 V -15 1 V -15 1 V -15 1 V -15 1 V -14 2 V -15 1 V -15 2 V -15 2 V -14 2 V -15 2 V -15 2 V -15 2 V -14 2 V -15 3 V -15 2 V -15 3 V -14 3 V -15 3 V -15 3 V -15 4 V -14 4 V -15 4 V -15 4 V -15 4 V -14 5 V -15 5 V -15 5 V -15 5 V -14 6 V -15 6 V -15 6 V -15 7 V -15 7 V -14 7 V -15 8 V -15 8 V -15 8 V -14 9 V -15 9 V -15 10 V -15 10 V -14 10 V -15 11 V -15 11 V -15 12 V -14 12 V -15 12 V -15 13 V -15 13 V -14 14 V -15 14 V -15 14 V -15 15 V -14 15 V -15 16 V -15 16 V -15 16 V -14 16 V -15 16 V -15 17 V -15 17 V -15 17 V -14 17 V -15 17 V -15 17 V -15 18 V -14 17 V -15 17 V -15 17 V -15 17 V -14 16 V -15 17 V -15 16 V -15 16 V -14 16 V -15 16 V -15 15 V -15 15 V -14 14 V -15 14 V -15 14 V -15 13 V -14 13 V -15 13 V -15 12 V -15 12 V -15 11 V -14 11 V -15 10 V -15 11 V -15 9 V -14 9 V -15 9 V -15 9 V -15 8 V -14 8 V -15 7 V -15 7 V -15 7 V -14 6 V -15 6 V -15 6 V -15 5 V -14 5 V -15 5 V -15 5 V -15 4 V -14 4 V -15 4 V -15 4 V -15 3 V -14 3 V -15 3 V -15 3 V -15 3 V -15 2 V -14 2 V -15 2 V -15 1 V -15 2 V -14 1 V -15 1 V -15 0 V -15 0 V -14 0 V -15 -1 V -15 -1 V -15 -2 V -14 -3 V -15 -3 V -15 -4 V -15 -6 V -14 -6 V -15 -8 V -15 -10 V -15 -11 V -14 -13 V -15 -15 V -15 -18 V -15 -21 V -14 -23 V -15 -25 V -15 -29 V -15 -31 V -15 -33 V -14 -35 V -15 -36 V -15 -37 V -15 -37 V -14 -37 V -15 -35 V -15 -34 V -15 -32 V -14 -29 V -15 -27 V -15 -24 V -15 -21 V -14 -19 V -15 -16 V -15 -14 V -15 -12 V -14 -9 V -15 -8 V -15 -6 V -15 -5 V -14 -4 V -15 -2 V -15 -1 V -15 1 V -14 1 V -15 2 V -15 3 V -LT1 -3114 1846 M -180 0 V -480 1717 M -15 34 V -15 -124 V -14 -186 V -15 -193 V -15 -178 V -569 915 L -583 784 L -598 674 L -15 -92 V -15 -76 V -14 -63 V -15 -52 V -15 -42 V -15 -36 V -14 -28 V -15 -24 V -15 -20 V -15 -16 V -14 -13 V -15 -11 V -15 -9 V -15 -7 V -14 -6 V -15 -5 V -15 -4 V -15 -3 V -14 -3 V -15 -2 V -15 -2 V -15 -2 V -15 -1 V -14 -1 V -15 -1 V -15 -1 V -15 0 V -14 -1 V -15 0 V -15 0 V -15 -1 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 -1 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 0 V -14 0 V -15 0 V -15 0 V -15 1 V -14 0 V -15 0 V -15 0 V -15 0 V -15 0 V -14 1 V -15 0 V -15 0 V -15 1 V -14 0 V -15 1 V -15 1 V -15 1 V -14 1 V -15 1 V -15 1 V -15 2 V -14 2 V -15 3 V -15 3 V -15 3 V -14 5 V -15 4 V -15 6 V -15 6 V -14 8 V -15 8 V -15 10 V -15 11 V -14 11 V -15 13 V -15 13 V -15 14 V -15 14 V -14 14 V -15 13 V -15 11 V -15 11 V -14 8 V -15 6 V -15 4 V -15 1 V -14 -1 V -15 -3 V -15 -5 V -15 -7 V -14 -7 V -15 -9 V -15 -9 V -15 -9 V -14 -10 V -15 -9 V -15 -10 V -15 -9 V -14 -8 V -15 -8 V -15 -8 V -15 -7 V -14 -6 V -15 -6 V -15 -6 V -stroke -grestore -end -showpage -} -\put(3054,1846){\makebox(0,0)[r]{line 2}} -\put(3054,1946){\makebox(0,0)[r]{line 1}} -\put(3417,51){\makebox(0,0){50}} -\put(3123,51){\makebox(0,0){45}} -\put(2830,51){\makebox(0,0){40}} -\put(2536,51){\makebox(0,0){35}} -\put(2242,51){\makebox(0,0){30}} -\put(1949,51){\makebox(0,0){25}} -\put(1655,51){\makebox(0,0){20}} -\put(1361,51){\makebox(0,0){15}} -\put(1067,51){\makebox(0,0){10}} -\put(774,51){\makebox(0,0){5}} -\put(480,51){\makebox(0,0){0}} -\put(420,2109){\makebox(0,0)[r]{2.5}} -\put(420,1717){\makebox(0,0)[r]{2}} -\put(420,1326){\makebox(0,0)[r]{1.5}} -\put(420,934){\makebox(0,0)[r]{1}} -\put(420,543){\makebox(0,0)[r]{0.5}} -\put(420,151){\makebox(0,0)[r]{0}} -\end{picture} diff --git a/doc/interpreter/invoke.texi b/doc/interpreter/invoke.texi deleted file mode 100644 --- a/doc/interpreter/invoke.texi +++ /dev/null @@ -1,283 +0,0 @@ -@c Copyright (C) 1996, 1997 John W. Eaton -@c This is part of the Octave manual. -@c For copying conditions, see the file gpl.texi. - -@node Invoking Octave, Getting Started, Introduction, Top -@chapter Invoking Octave - -Normally, Octave is used interactively by running the program -@samp{octave} without any arguments. Once started, Octave reads -commands from the terminal until you tell it to exit. - -You can also specify the name of a file on the command line, and Octave -will read and execute the commands from the named file and then exit -when it is finished. - -You can further control how Octave starts by using the command-line -options described in the next section, and Octave itself can remind you -of the options available. Type - -@example -octave --help -@end example - -@noindent -to display all available options and briefly describe their use -(@samp{octave -h} is a shorter equivalent). - -@menu -* Command Line Options:: -* Startup Files:: -@end menu - -@node Command Line Options, Startup Files, Invoking Octave, Invoking Octave -@section Command Line Options -@cindex Octave command options -@cindex command options -@cindex options, Octave command - -Here is a complete list of all the command line options that Octave -accepts. - -@table @code -@item --debug -@itemx -d -@cindex @code{--debug} -@cindex @code{-d} -Enter parser debugging mode. Using this option will cause Octave's -parser to print a lot of information about the commands it reads, and is -probably only useful if you are actually trying to debug the parser. - -@item --echo-commands -@itemx -x -@cindex @code{--echo-commands} -@cindex @code{-x} -Echo commands as they are executed. - -@item --exec-path @var{path} -@cindex @code{--exec-path @var{path}} -Specify the path to search for programs to run. The value of @var{path} -specified on the command line will override any value of -@samp{OCTAVE_EXEC_PATH} found in the environment, but not any -@samp{EXEC_PATH = "path"} commands found in the system or user startup -files. - -@item --help -@itemx -h -@itemx -? -@cindex @code{--help} -@cindex @code{-h} -@cindex @code{-?} -Print short help message and exit. - -@item --info-file @var{filename} -@cindex @code{--info-file @var{filename}} -Specify the name of the info file to use. The value of @var{filename} -specified on the command line will override any value of -@samp{OCTAVE_INFO_FILE} found in the environment, but not any -@samp{INFO_FILE = "filename"} commands found in the system or user -startup files. - -@item --info-program @var{program} -@cindex @code{--info-program @var{program}} -Specify the name of the info program to use. The value of @var{program} -specified on the command line will override any value of -@samp{OCTAVE_INFO_PROGRAM} found in the environment, but not any -@samp{INFO_PROGRAM = "program"} commands found in the system or user -startup files. - -@item --interactive -@itemx -i -@cindex @code{--interactive} -@cindex @code{-i} -Force interactive behavior. - -@item --no-init-file -@cindex @code{--no-init-file} -Don't read the @file{~/.octaverc} or @file{.octaverc} files. - -@item --no-line-editing -@cindex @code{--no-line-editing} -Disable command-line editing and history. - -@item --no-site-file -@cindex @code{--no-site-file} -Don't read the site-wide @file{octaverc} file. - -@item --norc -@itemx -f -@cindex @code{--norc} -@cindex @code{-f} -Don't read any of the system or user initialization files at startup. -This is equivalent to using both of the options @code{--no-init-file} -and @code{--no-site-file}. - -@item --path @var{path} -@itemx -p @var{path} -@cindex @code{--path @var{path}} -@cindex @code{-p @var{path}} -Specify the path to search for function files. The value of @var{path} -specified on the command line will override any value of -@samp{OCTAVE_PATH} found in the environment, but not any -@samp{LOADPATH = "path"} commands found in the system or user startup -files. - -@item --silent -@itemx --quiet -@itemx -q -@cindex @code{--silent} -@cindex @code{--quiet} -@cindex @code{-q} -Don't print message at startup. - -@item --traditional -@itemx --braindead -@cindex @code{--traditional} -@cindex @code{--braindead} -Set initial values for user-preference variables to the following -values for compatibility with @sc{Matlab}. - -@example -PS1 = ">> " -PS2 = "" -beep_on_error = 1 -default_save_format = "mat-binary" -define_all_return_values = 1 -do_fortran_indexing = 1 -empty_list_elements_ok = 1 -implicit_str_to_num_ok = 1 -ok_to_lose_imaginary_part = 1 -page_screen_output = 0 -prefer_column_vectors = 0 -prefer_zero_one_indexing = 1 -print_empty_dimensions = 0 -treat_neg_dim_as_zero = 1 -warn_function_name_clash = 0 -whitespace_in_literal_matrix = "traditional" -@end example - -@item --verbose -@itemx -V -@cindex @code{--verbose} -@cindex @code{-V} -Turn on verbose output. - -@item --version -@itemx -v -@cindex @code{--version} -@cindex @code{-v} -Print the program version number and exit. - -@item @var{file} -Execute commands from @var{file}. -@end table - -Octave also includes several built-in variables that contain information -about the command line, including the number of arguments and all of the -options. - -@defvr {Built-in Variable} argv -The command line arguments passed to Octave are available in this -variable. For example, if you invoked Octave using the command - -@example -octave --no-line-editing --silent -@end example - -@noindent -@code{argv} would be a string vector with the elements -@code{--no-line-editing} and @code{--silent}. - -If you write an executable Octave script, @var{argv} will contain the -list of arguments passed to the script. @pxref{Executable Octave Programs}. -@end defvr - -@defvr {Built-in Variable} nargin -At the top level, this variable is defined as the number of command line -arguments that were passed to Octave. -@end defvr - -@defvr {Built-in Variable} program_invocation_name -@defvrx {Built-in Variable} program_name -When Octave starts, the value of the built-in variable -@code{program_invocation_name} is automatically set to the name that was -typed at the shell prompt to run Octave, and the value of -@code{program_name} is automatically set to the final component of -@code{program_invocation_name}. For example, if you typed -@file{@value{OCTAVEHOME}/bin/octave} to start Octave, -@code{program_invocation_name} would have the value -@file{@value{OCTAVEHOME}/bin/octave}, and @code{program_name} would have -the value @code{octave}. - -If executing a script from the command line (e.g., @code{octave foo.m} -or using an executable Octave script, the program name is set to the -name of the script. @xref{Executable Octave Programs} for an example of -how to create an executable Octave script. -@end defvr - -Here is an example of using these variables to reproduce Octave's -command line. - -@example -printf ("%s", program_name); -for i = 1:nargin - printf (" %s", argv(i,:)); -endfor -printf ("\n"); -@end example - -@noindent -@xref{Index Expressions} for an explanation of how to properly index -arrays of strings and substrings in Octave. - -@node Startup Files, , Command Line Options, Invoking Octave -@section Startup Files -@cindex initialization -@cindex startup - -When Octave starts, it looks for commands to execute from the following -files: - -@cindex startup files - -@table @code -@item @var{OCTAVE_HOME}/share/octave/site/m/startup/octaverc -Where @var{OCTAVE_HOME} is the directory in which all of Octave is -installed (the default is @file{@value{OCTAVEHOME}}). This file is -provided so that changes to the default Octave environment can be made -globally for all users at your site for all versions of Octave you have -installed. Some care should be taken when making changes to this file, -since all users of Octave at your site will be affected. - -@item @var{OCTAVE_HOME}/share/octave/@var{VERSION}/m/startup/octaverc -Where @code{OCTAVE_HOME} is the directory in which all of Octave is -installed (the default is @file{@value{OCTAVE_HOME}}), and -@var{VERSION} is the version number of Octave. This file is provided -so that changes to the default Octave environment can be made globally -for all users for a particular version of Octave. Some care should be -taken when making changes to this file, since all users of Octave at -your site will be affected. - -@item ~/.octaverc -@cindex @code{~/.octaverc} -This file is normally used to make personal changes to the default -Octave environment. - -@item .octaverc -@cindex @code{.octaverc} -This file can be used to make changes to the default Octave environment -for a particular project. Octave searches for this file in the current -directory after it reads @file{~/.octaverc}. Any use of the @code{cd} -command in the @file{~/.octaverc} file will affect the directory that -Octave searches for the file @file{.octaverc}. - -If you start Octave in your home directory, commands from from the file -@file{~/.octaverc} will only be executed once. -@end table - -A message will be displayed as each of the startup files is read if you -invoke Octave with the @code{--verbose} option but without the -@code{--silent} option. - -Startup files may contain any valid Octave commands, including function -definitions. diff --git a/doc/interpreter/lp-foo.texi b/doc/interpreter/lp-foo.texi deleted file mode 100644 --- a/doc/interpreter/lp-foo.texi +++ /dev/null @@ -1,35 +0,0 @@ -@c ------------------------------------------------------------------------ - -@node Linear Programming -@chapter Linear Programming -@cindex LP -@cindex linear programming - -@example -class LP - LP (void) - LP (const ColumnVector& c) - LP (const ColumnVector& c, const Bounds& b) - LP (const ColumnVector& c, const Bounds& b, const LinConst& lc) - LP (const ColumnVector& c, const LinConst& lc) - - virtual ColumnVector minimize (void) - virtual ColumnVector minimize (double& objf) - virtual ColumnVector minimize (double& objf, int& inform) - virtual ColumnVector minimize (double& objf, int& inform, ColumnVector& lambda) = 0 - -class LPsolve : public LP - LPsolve (void) : LP () - - LPsolve (const ColumnVector& c) : LP (c) - - LPsolve (const ColumnVector& c, const Bounds& b) : LP (c, b) - - LPsolve (const ColumnVector& c, const Bounds& b, const LinConst& lc) - : LP (c, b, lc) - - LPsolve (const ColumnVector& c, const LinConst& lc) : LP (c, lc) - - virtual ColumnVector minimize (double& objf, int& inform, ColumnVector& lambda) -@end example - diff --git a/doc/interpreter/psfig.tex b/doc/interpreter/psfig.tex deleted file mode 100644 --- a/doc/interpreter/psfig.tex +++ /dev/null @@ -1,778 +0,0 @@ -% Psfig/TeX Release 1.6b -% dvips version -% -% All psfig/tex software, documentation, and related files -% in this distribution of psfig/tex are -% Copyright 1987, 1988, 1991 Trevor J. Darrell -% -% Permission is granted for use and non-profit distribution of psfig/tex -% providing that this notice be clearly maintained. The right to -% distribute any portion of psfig/tex for profit or as part of any commercial -% product is specifically reserved for the author(s) of that portion. -% -% Thanks to Greg Hager (GDH) and Ned Batchelder for their contributions -% to this project. -% -% Modified by J. Daniel Smith on 9 October 1990 to accept the -% %%BoundingBox: comment with or without a space after the colon. Stole -% file reading code from Tom Rokicki's EPSF.TEX file (see below). -% -% More modifications by J. Daniel Smith on 29 March 1991 to allow the -% the included PostScript figure to be rotated. The amount of -% rotation is specified by the "angle=" parameter of the \psfig command. -% -% Modified by Robert Russell on June 25, 1991 to allow users to specify -% .ps filenames which don't yet exist, provided they explicitly provide -% boundingbox information via the \psfig command. Note: This will only work -% if the "file=" parameter follows all four "bb???=" parameters in the -% command. This is due to the order in which psfig interprets these params. -% -% 3 Jul 1991 JDS check if file already read in once -% 4 Sep 1991 JDS fixed incorrect computation of rotated -% bounding box -% - -% check to see if macros already loaded in (maybe some other file says -% "\input psfig") ... -\ifx\undefined\psfig\else\endinput\fi - -% -% from a suggestion by eijkhout@csrd.uiuc.edu to allow -% loading as a style file: -\edef\psfigRestoreAt{\catcode`@=\number\catcode`@\relax} -\catcode`\@=11\relax -\newwrite\@unused -\def\typeout#1{{\let\protect\string\immediate\write\@unused{#1}}} -\typeout{psfig/tex 1.6b} - - -%% Here's how you define your figure path. Should be set up with null -%% default and a user useable definition. -%\def\figurepath{./} -% The above definition for \figurepath is stupid. It restricts .ps -% files to existing only in the current directory or below. We -% redefine it properly. -\def\figurepath{} -\def\psfigurepath#1{\edef\figurepath{#1}} - -% -% @psdo control structure -- similar to Latex @for. -% I redefined these with different names so that psfig can -% be used with TeX as well as LaTeX, and so that it will not -% be vunerable to future changes in LaTeX's internal -% control structure, -% -\def\@nnil{\@nil} -\def\@empty{} -\def\@psdonoop#1\@@#2#3{} -\def\@psdo#1:=#2\do#3{\edef\@psdotmp{#2}\ifx\@psdotmp\@empty \else - \expandafter\@psdoloop#2,\@nil,\@nil\@@#1{#3}\fi} -\def\@psdoloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else - #5\def#4{#2}\ifx #4\@nnil \else#5\@ipsdoloop #3\@@#4{#5}\fi\fi} -\def\@ipsdoloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil - \let\@nextwhile=\@psdonoop \else - #4\relax\let\@nextwhile=\@ipsdoloop\fi\@nextwhile#2\@@#3{#4}} -\def\@tpsdo#1:=#2\do#3{\xdef\@psdotmp{#2}\ifx\@psdotmp\@empty \else - \@tpsdoloop#2\@nil\@nil\@@#1{#3}\fi} -\def\@tpsdoloop#1#2\@@#3#4{\def#3{#1}\ifx #3\@nnil - \let\@nextwhile=\@psdonoop \else - #4\relax\let\@nextwhile=\@tpsdoloop\fi\@nextwhile#2\@@#3{#4}} -% -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% file reading stuff from epsf.tex -% EPSF.TEX macro file: -% Written by Tomas Rokicki of Radical Eye Software, 29 Mar 1989. -% Revised by Don Knuth, 3 Jan 1990. -% Revised by Tomas Rokicki to accept bounding boxes with no -% space after the colon, 18 Jul 1990. -% Portions modified/removed for use in PSFIG package by -% J. Daniel Smith, 9 October 1990. -% -\newread\ps@stream -\newif\ifnot@eof % continue looking for the bounding box? -\newif\if@noisy % report what you're making? -\newif\if@atend % %%BoundingBox: has (at end) specification -\newif\if@psfile % does this look like a PostScript file? -% -% PostScript files should start with `%!' -% -{\catcode`\%=12\global\gdef\epsf@start{%!}} -\def\epsf@PS{PS} -% -\def\epsf@getbb#1{% -% -% The first thing we need to do is to open the -% PostScript file, if possible. -% -\openin\ps@stream=#1 -\ifeof\ps@stream\typeout{Error, File #1 not found}\else -% -% Okay, we got it. Now we'll scan lines until we find one that doesn't -% start with %. We're looking for the bounding box comment. -% - {\not@eoftrue \chardef\other=12 - \def\do##1{\catcode`##1=\other}\dospecials \catcode`\ =10 - \loop - \if@psfile - \read\ps@stream to \epsf@fileline - \else{ - \obeyspaces - \read\ps@stream to \epsf@tmp\global\let\epsf@fileline\epsf@tmp} - \fi - \ifeof\ps@stream\not@eoffalse\else -% -% Check the first line for `%!'. Issue a warning message if its not -% there, since the file might not be a PostScript file. -% - \if@psfile\else - \expandafter\epsf@test\epsf@fileline:. \\% - \fi -% -% We check to see if the first character is a % sign; -% if so, we look further and stop only if the line begins with -% `%%BoundingBox:' and the `(atend)' specification was not found. -% That is, the only way to stop is when the end of file is reached, -% or a `%%BoundingBox: llx lly urx ury' line is found. -% - \expandafter\epsf@aux\epsf@fileline:. \\% - \fi - \ifnot@eof\repeat - }\closein\ps@stream\fi}% -% -% This tests if the file we are reading looks like a PostScript file. -% -\long\def\epsf@test#1#2#3:#4\\{\def\epsf@testit{#1#2} - \ifx\epsf@testit\epsf@start\else -\typeout{Warning! File does not start with `\epsf@start'. It may not be a PostScript file.} - \fi - \@psfiletrue} % don't test after 1st line -% -% We still need to define the tricky \epsf@aux macro. This requires -% a couple of magic constants for comparison purposes. -% -{\catcode`\%=12\global\let\epsf@percent=%\global\def\epsf@bblit{%BoundingBox}} -% -% -% So we're ready to check for `%BoundingBox:' and to grab the -% values if they are found. We continue searching if `(at end)' -% was found after the `%BoundingBox:'. -% -\long\def\epsf@aux#1#2:#3\\{\ifx#1\epsf@percent - \def\epsf@testit{#2}\ifx\epsf@testit\epsf@bblit - \@atendfalse - \epsf@atend #3 . \\% - \if@atend - \if@verbose{ - \typeout{psfig: found `(atend)'; continuing search} - }\fi - \else - \epsf@grab #3 . . . \\% - \not@eoffalse - \global\no@bbfalse - \fi - \fi\fi}% -% -% Here we grab the values and stuff them in the appropriate definitions. -% -\def\epsf@grab #1 #2 #3 #4 #5\\{% - \global\def\epsf@llx{#1}\ifx\epsf@llx\empty - \epsf@grab #2 #3 #4 #5 .\\\else - \global\def\epsf@lly{#2}% - \global\def\epsf@urx{#3}\global\def\epsf@ury{#4}\fi}% -% -% Determine if the stuff following the %%BoundingBox is `(atend)' -% J. Daniel Smith. Copied from \epsf@grab above. -% -\def\epsf@atendlit{(atend)} -\def\epsf@atend #1 #2 #3\\{% - \def\epsf@tmp{#1}\ifx\epsf@tmp\empty - \epsf@atend #2 #3 .\\\else - \ifx\epsf@tmp\epsf@atendlit\@atendtrue\fi\fi} - - -% End of file reading stuff from epsf.tex -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% trigonometry stuff from "trig.tex" -\chardef\letter = 11 -\chardef\other = 12 - -\newif \ifdebug %%% turn me on to see TeX hard at work ... -\newif\ifc@mpute %%% don't need to compute some values -\c@mputetrue % but assume that we do - -\let\then = \relax -\def\r@dian{pt } -\let\r@dians = \r@dian -\let\dimensionless@nit = \r@dian -\let\dimensionless@nits = \dimensionless@nit -\def\internal@nit{sp } -\let\internal@nits = \internal@nit -\newif\ifstillc@nverging -\def \Mess@ge #1{\ifdebug \then \message {#1} \fi} - -{ %%% Things that need abnormal catcodes %%% - \catcode `\@ = \letter - \gdef \nodimen {\expandafter \n@dimen \the \dimen} - \gdef \term #1 #2 #3% - {\edef \t@ {\the #1}%%% freeze parameter 1 (count, by value) - \edef \t@@ {\expandafter \n@dimen \the #2\r@dian}% - %%% freeze parameter 2 (dimen, by value) - \t@rm {\t@} {\t@@} {#3}% - } - \gdef \t@rm #1 #2 #3% - {{% - \count 0 = 0 - \dimen 0 = 1 \dimensionless@nit - \dimen 2 = #2\relax - \Mess@ge {Calculating term #1 of \nodimen 2}% - \loop - \ifnum \count 0 < #1 - \then \advance \count 0 by 1 - \Mess@ge {Iteration \the \count 0 \space}% - \Multiply \dimen 0 by {\dimen 2}% - \Mess@ge {After multiplication, term = \nodimen 0}% - \Divide \dimen 0 by {\count 0}% - \Mess@ge {After division, term = \nodimen 0}% - \repeat - \Mess@ge {Final value for term #1 of - \nodimen 2 \space is \nodimen 0}% - \xdef \Term {#3 = \nodimen 0 \r@dians}% - \aftergroup \Term - }} - \catcode `\p = \other - \catcode `\t = \other - \gdef \n@dimen #1pt{#1} %%% throw away the ``pt'' -} - -\def \Divide #1by #2{\divide #1 by #2} %%% just a synonym - -\def \Multiply #1by #2%%% allows division of a dimen by a dimen - {{%%% should really freeze parameter 2 (dimen, passed by value) - \count 0 = #1\relax - \count 2 = #2\relax - \count 4 = 65536 - \Mess@ge {Before scaling, count 0 = \the \count 0 \space and - count 2 = \the \count 2}% - \ifnum \count 0 > 32767 %%% do our best to avoid overflow - \then \divide \count 0 by 4 - \divide \count 4 by 4 - \else \ifnum \count 0 < -32767 - \then \divide \count 0 by 4 - \divide \count 4 by 4 - \else - \fi - \fi - \ifnum \count 2 > 32767 %%% while retaining reasonable accuracy - \then \divide \count 2 by 4 - \divide \count 4 by 4 - \else \ifnum \count 2 < -32767 - \then \divide \count 2 by 4 - \divide \count 4 by 4 - \else - \fi - \fi - \multiply \count 0 by \count 2 - \divide \count 0 by \count 4 - \xdef \product {#1 = \the \count 0 \internal@nits}% - \aftergroup \product - }} - -\def\r@duce{\ifdim\dimen0 > 90\r@dian \then % sin(x+90) = sin(180-x) - \multiply\dimen0 by -1 - \advance\dimen0 by 180\r@dian - \r@duce - \else \ifdim\dimen0 < -90\r@dian \then % sin(-x) = sin(360+x) - \advance\dimen0 by 360\r@dian - \r@duce - \fi - \fi} - -\def\Sine#1% - {{% - \dimen 0 = #1 \r@dian - \r@duce - \ifdim\dimen0 = -90\r@dian \then - \dimen4 = -1\r@dian - \c@mputefalse - \fi - \ifdim\dimen0 = 90\r@dian \then - \dimen4 = 1\r@dian - \c@mputefalse - \fi - \ifdim\dimen0 = 0\r@dian \then - \dimen4 = 0\r@dian - \c@mputefalse - \fi -% - \ifc@mpute \then - % convert degrees to radians - \divide\dimen0 by 180 - \dimen0=3.141592654\dimen0 -% - \dimen 2 = 3.1415926535897963\r@dian %%% a well-known constant - \divide\dimen 2 by 2 %%% we only deal with -pi/2 : pi/2 - \Mess@ge {Sin: calculating Sin of \nodimen 0}% - \count 0 = 1 %%% see power-series expansion for sine - \dimen 2 = 1 \r@dian %%% ditto - \dimen 4 = 0 \r@dian %%% ditto - \loop - \ifnum \dimen 2 = 0 %%% then we've done - \then \stillc@nvergingfalse - \else \stillc@nvergingtrue - \fi - \ifstillc@nverging %%% then calculate next term - \then \term {\count 0} {\dimen 0} {\dimen 2}% - \advance \count 0 by 2 - \count 2 = \count 0 - \divide \count 2 by 2 - \ifodd \count 2 %%% signs alternate - \then \advance \dimen 4 by \dimen 2 - \else \advance \dimen 4 by -\dimen 2 - \fi - \repeat - \fi - \xdef \sine {\nodimen 4}% - }} - -% Now the Cosine can be calculated easily by calling \Sine -\def\Cosine#1{\ifx\sine\UnDefined\edef\Savesine{\relax}\else - \edef\Savesine{\sine}\fi - {\dimen0=#1\r@dian\advance\dimen0 by 90\r@dian - \Sine{\nodimen 0} - \xdef\cosine{\sine} - \xdef\sine{\Savesine}}} -% end of trig stuff -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\def\psdraft{ - \def\@psdraft{0} - %\typeout{draft level now is \@psdraft \space . } -} -\def\psfull{ - \def\@psdraft{100} - %\typeout{draft level now is \@psdraft \space . } -} - -\psfull - -\newif\if@draftbox -\def\psnodraftbox{ - \@draftboxfalse -} -\def\psdraftbox{ - \@draftboxtrue -} -\@draftboxtrue - -\newif\if@prologfile -\newif\if@postlogfile -\def\pssilent{ - \@noisyfalse -} -\def\psnoisy{ - \@noisytrue -} -\psnoisy -%%% These are for the option list. -%%% A specification of the form a = b maps to calling \@p@@sa{b} -\newif\if@bbllx -\newif\if@bblly -\newif\if@bburx -\newif\if@bbury -\newif\if@height -\newif\if@width -\newif\if@rheight -\newif\if@rwidth -\newif\if@angle -\newif\if@clip -\newif\if@verbose -\def\@p@@sclip#1{\@cliptrue} - -%%% GDH 7/26/87 -- changed so that it first looks in the local directory, -%%% then in a specified global directory for the ps file. -%%% RPR 6/25/91 -- changed so that it defaults to user-supplied name if -%%% boundingbox info is specified, assuming graphic will be created by -%%% print time. - -\def\@p@@sfile#1{\def\@p@sfile{null}% - \openin1=#1 - \ifeof1\closein1% - \openin1=\figurepath#1 - \ifeof1\typeout{Error, File #1 not found} - \if@bbllx\if@bblly\if@bburx\if@bbury% added 6/91 Rob Russell - \def\@p@sfile{#1}% - \fi\fi\fi\fi - \else\closein1 - \edef\@p@sfile{\figurepath#1}% - \fi% - \else\closein1% - \def\@p@sfile{#1}% - \fi} -\def\@p@@sfigure#1{\def\@p@sfile{null}% - \openin1=#1 - \ifeof1\closein1% - \openin1=\figurepath#1 - \ifeof1\typeout{Error, File #1 not found} - \if@bbllx\if@bblly\if@bburx\if@bbury% added 6/91 Rob Russell - \def\@p@sfile{#1}% - \fi\fi\fi\fi - \else\closein1 - \def\@p@sfile{\figurepath#1}% - \fi% - \else\closein1% - \def\@p@sfile{#1}% - \fi} - -\def\@p@@sbbllx#1{ - %\typeout{bbllx is #1} - \@bbllxtrue - \dimen100=#1 - \edef\@p@sbbllx{\number\dimen100} -} -\def\@p@@sbblly#1{ - %\typeout{bblly is #1} - \@bbllytrue - \dimen100=#1 - \edef\@p@sbblly{\number\dimen100} -} -\def\@p@@sbburx#1{ - %\typeout{bburx is #1} - \@bburxtrue - \dimen100=#1 - \edef\@p@sbburx{\number\dimen100} -} -\def\@p@@sbbury#1{ - %\typeout{bbury is #1} - \@bburytrue - \dimen100=#1 - \edef\@p@sbbury{\number\dimen100} -} -\def\@p@@sheight#1{ - \@heighttrue - \dimen100=#1 - \edef\@p@sheight{\number\dimen100} - %\typeout{Height is \@p@sheight} -} -\def\@p@@swidth#1{ - %\typeout{Width is #1} - \@widthtrue - \dimen100=#1 - \edef\@p@swidth{\number\dimen100} -} -\def\@p@@srheight#1{ - %\typeout{Reserved height is #1} - \@rheighttrue - \dimen100=#1 - \edef\@p@srheight{\number\dimen100} -} -\def\@p@@srwidth#1{ - %\typeout{Reserved width is #1} - \@rwidthtrue - \dimen100=#1 - \edef\@p@srwidth{\number\dimen100} -} -\def\@p@@sangle#1{ - %\typeout{Rotation is #1} - \@angletrue -% \dimen100=#1 - \edef\@p@sangle{#1} %\number\dimen100} -} -\def\@p@@ssilent#1{ - \@verbosefalse -} -\def\@p@@sprolog#1{\@prologfiletrue\def\@prologfileval{#1}} -\def\@p@@spostlog#1{\@postlogfiletrue\def\@postlogfileval{#1}} -\def\@cs@name#1{\csname #1\endcsname} -\def\@setparms#1=#2,{\@cs@name{@p@@s#1}{#2}} -% -% initialize the defaults (size the size of the figure) -% -\def\ps@init@parms{ - \@bbllxfalse \@bbllyfalse - \@bburxfalse \@bburyfalse - \@heightfalse \@widthfalse - \@rheightfalse \@rwidthfalse - \def\@p@sbbllx{}\def\@p@sbblly{} - \def\@p@sbburx{}\def\@p@sbbury{} - \def\@p@sheight{}\def\@p@swidth{} - \def\@p@srheight{}\def\@p@srwidth{} - \def\@p@sangle{0} - \def\@p@sfile{} - \def\@p@scost{10} - \def\@sc{} - \@prologfilefalse - \@postlogfilefalse - \@clipfalse - \if@noisy - \@verbosetrue - \else - \@verbosefalse - \fi -} -% -% Go through the options setting things up. -% -\def\parse@ps@parms#1{ - \@psdo\@psfiga:=#1\do - {\expandafter\@setparms\@psfiga,}} -% -% Compute bb height and width -% -\newif\ifno@bb -\def\bb@missing{ - \if@verbose{ - \typeout{psfig: searching \@p@sfile \space for bounding box} - }\fi - \no@bbtrue - \epsf@getbb{\@p@sfile} - \ifno@bb \else \bb@cull\epsf@llx\epsf@lly\epsf@urx\epsf@ury\fi -} -\def\bb@cull#1#2#3#4{ - \dimen100=#1 bp\edef\@p@sbbllx{\number\dimen100} - \dimen100=#2 bp\edef\@p@sbblly{\number\dimen100} - \dimen100=#3 bp\edef\@p@sbburx{\number\dimen100} - \dimen100=#4 bp\edef\@p@sbbury{\number\dimen100} - \no@bbfalse -} -% rotate point (#1,#2) about (0,0). -% The sine and cosine of the angle are already stored in \sine and -% \cosine. The result is placed in (\p@intvaluex, \p@intvaluey). -\newdimen\p@intvaluex -\newdimen\p@intvaluey -\def\rotate@#1#2{{\dimen0=#1 sp\dimen1=#2 sp -% calculate x' = x \cos\theta - y \sin\theta - \global\p@intvaluex=\cosine\dimen0 - \dimen3=\sine\dimen1 - \global\advance\p@intvaluex by -\dimen3 -% calculate y' = x \sin\theta + y \cos\theta - \global\p@intvaluey=\sine\dimen0 - \dimen3=\cosine\dimen1 - \global\advance\p@intvaluey by \dimen3 - }} -% rotate point (#1,#2) about the point (#3,#4), finding the x value. -% The sine and cosine of the angle are already stored in \sine and -% \cosine. The result is placed in \p@intvaluex -%\def\rotate@x#1#2#3#4{{\dimen0=#1 sp -% \dimen1=#2 sp -% \dimen2=#3 sp -% \dimen4=#4 sp -% \advance\dimen0 by -\dimen3 -% \dimen0=\cosine\dimen0 -% \advance\dimen4 by -\dimen2 -% \dimen4=\sine\dimen4 -% \global\p@intvaluex=\dimen0 -% \global\advance\p@intvaluex by \dimen4 -% \global\advance\p@intvaluex by \dimen3 -% -%}} -\def\compute@bb{ - \no@bbfalse - \if@bbllx \else \no@bbtrue \fi - \if@bblly \else \no@bbtrue \fi - \if@bburx \else \no@bbtrue \fi - \if@bbury \else \no@bbtrue \fi - \ifno@bb \bb@missing \fi - \ifno@bb \typeout{FATAL ERROR: no bb supplied or found} - \no-bb-error - \fi - % -%\typeout{BB: \@p@sbbllx, \@p@sbblly, \@p@sbburx, \@p@sbbury} - \if@angle - \Sine{\@p@sangle}\Cosine{\@p@sangle} - {\dimen100=\maxdimen\xdef\r@p@sbbllx{\number\dimen100} - \xdef\r@p@sbblly{\number\dimen100} - \xdef\r@p@sbburx{-\number\dimen100} - \xdef\r@p@sbbury{-\number\dimen100}} -% -% Need to rotate all four points and take the X-Y extremes of the new -% points as the new bounding box. - \def\minmaxtest{ - \ifnum\number\p@intvaluex<\r@p@sbbllx - \xdef\r@p@sbbllx{\number\p@intvaluex}\fi - \ifnum\number\p@intvaluex>\r@p@sbburx - \xdef\r@p@sbburx{\number\p@intvaluex}\fi - \ifnum\number\p@intvaluey<\r@p@sbblly - \xdef\r@p@sbblly{\number\p@intvaluey}\fi - \ifnum\number\p@intvaluey>\r@p@sbbury - \xdef\r@p@sbbury{\number\p@intvaluey}\fi - } -% lower left - \rotate@{\@p@sbbllx}{\@p@sbblly} - \minmaxtest -% upper left - \rotate@{\@p@sbbllx}{\@p@sbbury} - \minmaxtest -% lower right - \rotate@{\@p@sbburx}{\@p@sbblly} - \minmaxtest -% upper right - \rotate@{\@p@sbburx}{\@p@sbbury} - \minmaxtest - \edef\@p@sbbllx{\r@p@sbbllx}\edef\@p@sbblly{\r@p@sbblly} - \edef\@p@sbburx{\r@p@sbburx}\edef\@p@sbbury{\r@p@sbbury} -%\typeout{rotated BB: \r@p@sbbllx, \r@p@sbblly, \r@p@sbburx, \r@p@sbbury} - \fi - \count203=\@p@sbburx - \count204=\@p@sbbury - \advance\count203 by -\@p@sbbllx - \advance\count204 by -\@p@sbblly - \edef\@bbw{\number\count203} - \edef\@bbh{\number\count204} - %\typeout{ bbh = \@bbh, bbw = \@bbw } -} -% -% \in@hundreds performs #1 * (#2 / #3) correct to the hundreds, -% then leaves the result in @result -% -\def\in@hundreds#1#2#3{\count240=#2 \count241=#3 - \count100=\count240 % 100 is first digit #2/#3 - \divide\count100 by \count241 - \count101=\count100 - \multiply\count101 by \count241 - \advance\count240 by -\count101 - \multiply\count240 by 10 - \count101=\count240 %101 is second digit of #2/#3 - \divide\count101 by \count241 - \count102=\count101 - \multiply\count102 by \count241 - \advance\count240 by -\count102 - \multiply\count240 by 10 - \count102=\count240 % 102 is the third digit - \divide\count102 by \count241 - \count200=#1\count205=0 - \count201=\count200 - \multiply\count201 by \count100 - \advance\count205 by \count201 - \count201=\count200 - \divide\count201 by 10 - \multiply\count201 by \count101 - \advance\count205 by \count201 - % - \count201=\count200 - \divide\count201 by 100 - \multiply\count201 by \count102 - \advance\count205 by \count201 - % - \edef\@result{\number\count205} -} -\def\compute@wfromh{ - % computing : width = height * (bbw / bbh) - \in@hundreds{\@p@sheight}{\@bbw}{\@bbh} - %\typeout{ \@p@sheight * \@bbw / \@bbh, = \@result } - \edef\@p@swidth{\@result} - %\typeout{w from h: width is \@p@swidth} -} -\def\compute@hfromw{ - % computing : height = width * (bbh / bbw) - \in@hundreds{\@p@swidth}{\@bbh}{\@bbw} - %\typeout{ \@p@swidth * \@bbh / \@bbw = \@result } - \edef\@p@sheight{\@result} - %\typeout{h from w : height is \@p@sheight} -} -\def\compute@handw{ - \if@height - \if@width - \else - \compute@wfromh - \fi - \else - \if@width - \compute@hfromw - \else - \edef\@p@sheight{\@bbh} - \edef\@p@swidth{\@bbw} - \fi - \fi -} -\def\compute@resv{ - \if@rheight \else \edef\@p@srheight{\@p@sheight} \fi - \if@rwidth \else \edef\@p@srwidth{\@p@swidth} \fi - %\typeout{rheight = \@p@srheight, rwidth = \@p@srwidth} -} -% -% Compute any missing values -\def\compute@sizes{ - \compute@bb - \compute@handw - \compute@resv -} -% -% \psfig -% usage : \psfig{file=, height=, width=, bbllx=, bblly=, bburx=, bbury=, -% rheight=, rwidth=, clip=} -% -% "clip=" is a switch and takes no value, but the `=' must be present. -% -% The \leavevmode\hbox stuff makes this do the right thing for figures -% when the horizontal size is specified. - -\def\psfig#1{\leavevmode\hbox{\vbox { - % do a zero width hard space so that a single - % \psfig in a centering enviornment will behave nicely - %{\setbox0=\hbox{\ }\ \hskip-\wd0} - % - \ps@init@parms - \parse@ps@parms{#1} - \compute@sizes - % - \ifnum\@p@scost<\@psdraft{ - \if@verbose{ - \typeout{psfig: including \@p@sfile \space } - }\fi - % - \special{ps::[begin] \@p@swidth \space \@p@sheight \space - \@p@sbbllx \space \@p@sbblly \space - \@p@sbburx \space \@p@sbbury \space - startTexFig \space } - \if@angle - \special {ps:: \@p@sangle \space rotate \space} - \fi - \if@clip{ - \if@verbose{ - \typeout{(clip)} - }\fi - \special{ps:: doclip \space } - }\fi - \if@prologfile - \special{ps: plotfile \@prologfileval \space } \fi - \special{ps: plotfile \@p@sfile \space } - \if@postlogfile - \special{ps: plotfile \@postlogfileval \space } \fi - \special{ps::[end] endTexFig \space } - % Create the vbox to reserve the space for the figure - \vbox to \@p@srheight true sp{ - \hbox to \@p@srwidth true sp{ - \hss - } - \vss - } - }\else{ - % draft figure, just reserve the space and print the - % path name. - \if@draftbox{ - % Verbose draft: print file name in box - % NOTE: fbox is a LaTeX command! - \hbox{\fbox{\vbox to \@p@srheight true sp{ - \vss - \hbox to \@p@srwidth true sp{ \hss \@p@sfile \hss } - \vss - }}} - }\else{ - % Non-verbose draft - \vbox to \@p@srheight true sp{ - \vss - \hbox to \@p@srwidth true sp{\hss} - \vss - } - }\fi - - - - }\fi -}}} -\def\psglobal{\typeout{psfig: PSGLOBAL is OBSOLETE; use psprint -m instead}} -\psfigRestoreAt - diff --git a/doc/interpreter/special.texi b/doc/interpreter/special.texi deleted file mode 100644 --- a/doc/interpreter/special.texi +++ /dev/null @@ -1,401 +0,0 @@ -@c Copyright (C) 1996, 1997 John W. Eaton -@c This is part of the Octave manual. -@c For copying conditions, see the file gpl.texi. - -@node Special Matrices, Arithmetic, Matrix Manipulation, Top -@chapter Special Matrices - -Octave provides a number of functions for creating special matrix forms. -In nearly all cases, it is best to use the built-in functions for this -purpose than to try to use other tricks to achieve the same effect. - -@menu -* Special Utility Matrices:: -* Famous Matrices:: -@end menu - -@node Special Utility Matrices, Famous Matrices, Special Matrices, Special Matrices -@section Special Utility Matrices - -@deftypefn {Built-in Function} {} eye (@var{x}) -@deftypefnx {Built-in Function} {} eye (@var{n}, @var{m}) -Return an identity matrix. If invoked with a single scalar argument, -@code{eye} returns a square matrix with the dimension specified. If you -supply two scalar arguments, @code{eye} takes them to be the number of -rows and columns. If given a vector with two elements, @code{eye} uses -the values of the elements as the number of rows and columns, -respectively. For example, - -@example -@group -eye (3) - - @result{} 1 0 0 - 0 1 0 - 0 0 1 -@end group -@end example - -The following expressions all produce the same result: - -@example -@group -eye (2) -@equiv{} -eye (2, 2) -@equiv{} -eye (size ([1, 2; 3, 4]) -@end group -@end example - -For compatibility with @sc{Matlab}, calling @code{eye} with no arguments -is equivalent to calling it with an argument of 1. -@end deftypefn - -@deftypefn {Built-in Function} {} ones (@var{x}) -@deftypefnx {Built-in Function} {} ones (@var{n}, @var{m}) -Return a matrix whose elements are all 1. The arguments are handled -the same as the arguments for @code{eye}. - -If you need to create a matrix whose values are all the same, you should -use an expression like - -@example -val_matrix = val * ones (n, m) -@end example -@end deftypefn - -@deftypefn {Built-in Function} {} zeros (@var{x}) -@deftypefnx {Built-in Function} {} zeros (@var{n}, @var{m}) -Return a matrix whose elements are all 0. The arguments are handled -the same as the arguments for @code{eye}. -@end deftypefn - -@deftypefn {Loadable Function} {} rand (@var{x}) -@deftypefnx {Loadable Function} {} rand (@var{n}, @var{m}) -@deftypefnx {Loadable Function} {} rand (@code{"seed"}, @var{x}) -Return a matrix with random elements uniformly distributed on the -interval (0, 1). The arguments are handled the same as the arguments -for @code{eye}. In -addition, you can set the seed for the random number generator using the -form - -@example -randn ("seed", @var{x}) -@end example - -@noindent -where @var{x} is a scalar value. If called as - -@example -rand ("seed") -@end example - -@noindent -@code{rand} returns the current value of the seed. -@end deftypefn - -@deftypefn {Loadable Function} {} randn (@var{x}) -@deftypefnx {Loadable Function} {} randn (@var{n}, @var{m}) -@deftypefnx {Loadable Function} {} randn (@code{"seed"}, @var{x}) -Return a matrix with normally distributed random elements. The -arguments are handled the same as the arguments for @code{eye}. In -addition, you can set the seed for the random number generator using the -form - -@example -randn ("seed", @var{x}) -@end example - -@noindent -where @var{x} is a scalar value. If called as - -@example -randn ("seed") -@end example - -@noindent -@code{randn} returns the current value of the seed. -@end deftypefn - -The @code{rand} and @code{randn} functions use separate generators. -This ensures that - -@example -@group -rand ("seed", 13); -randn ("seed", 13); -u = rand (100, 1); -n = randn (100, 1); -@end group -@end example - -@noindent -and - -@example -@group -rand ("seed", 13); -randn ("seed", 13); -u = zeros (100, 1); -n = zeros (100, 1); -for i = 1:100 - u(i) = rand (); - n(i) = randn (); -end -@end group -@end example - -@noindent -produce equivalent results. - -Normally, @code{rand} and @code{randn} obtain their initial -seeds from the system clock, so that the sequence of random numbers is -not the same each time you run Octave. If you really do need for to -reproduce a sequence of numbers exactly, you can set the seed to a -specific value. - -If it is invoked without arguments, @code{rand} and @code{randn} return a -single element of a random sequence. - -The @code{rand} and @code{randn} functions use Fortran code from RANLIB, -a library of fortran routines for random number generation, compiled by -Barry W. Brown and James Lovato of the Department of Biomathematics at -The University of Texas, M.D. Anderson Cancer Center, Houston, TX 77030. - -@deftypefn {Built-in Function} {} diag (@var{v}, @var{k}) -Return a diagonal matrix with vector @var{v} on diagonal @var{k}. The -second argument is optional. If it is positive, the vector is placed on -the @var{k}-th super-diagonal. If it is negative, it is placed on the -@var{-k}-th sub-diagonal. The default value of @var{k} is 0, and the -vector is placed on the main diagonal. For example, - -@example -@group -diag ([1, 2, 3], 1) - - @result{} 0 1 0 0 - 0 0 2 0 - 0 0 0 3 - 0 0 0 0 -@end group -@end example -@end deftypefn - -@defvr {Built-in Variable} ok_to_lose_imaginary_part -If the value of @code{ok_to_lose_imaginary_part} is nonzero, implicit -conversions of complex numbers to real numbers are allowed (for example, -by fsolve). If the value is @code{"warn"}, the conversion is allowed, -but a warning is printed. Otherwise, an error message is printed and -control is returned to the top level. The default value is -@code{"warn"}. - -XXX FIXME XXX -- this is here because it is used by @code{ones}, -@code{zeros}, @code{rand}, etc. -@end defvr - -The functions @code{linspace} and @code{logspace} make it very easy to -create vectors with evenly or logarithmically spaced elements. -@xref{Ranges}. - -@deftypefn {Function File} {} linspace (@var{base}, @var{limit}, @var{n}) -creates a row vector with @var{n} (@var{n} greater than 1) linearly -spaced elements between @var{base} and @var{limit}. The @var{base} and -@var{limit} are always included in the range. If @var{base} is greater -than @var{limit}, the elements are stored in decreasing order. If the -number of points is not specified, a value of 100 is used. - -The @code{linspace} function always returns a row vector, regardless of -the value of @code{prefer_column_vectors}. -@end deftypefn - -@deftypefn {Function File} {} logspace (@var{base}, @var{limit}, @var{n}) -Similar to @code{linspace} except that the values are logarithmically -spaced from -@iftex -@tex -$10^{base}$ to $10^{limit}$. -@end tex -@end iftex -@ifinfo -10^base to 10^limit. -@end ifinfo - -If @var{limit} is equal to -@iftex -@tex -$\pi$, -@end tex -@end iftex -@ifinfo -pi, -@end ifinfo -the points are between -@iftex -@tex -$10^{base}$ and $\pi$, -@end tex -@end iftex -@ifinfo -10^base and pi, -@end ifinfo -@emph{not} -@iftex -@tex -$10^{base}$ and $10^{\pi}$, -@end tex -@end iftex -@ifinfo -10^base and 10^pi, -@end ifinfo -in order to be compatible with the corresponding @sc{Matlab} function. -@end deftypefn - -@defvr {Built-in Variable} treat_neg_dim_as_zero -If the value of @code{treat_neg_dim_as_zero} is nonzero, expressions -like - -@example -eye (-1) -@end example - -@noindent -produce an empty matrix (i.e., row and column dimensions are zero). -Otherwise, an error message is printed and control is returned to the -top level. The default value is 0. -@end defvr - -@node Famous Matrices, , Special Utility Matrices, Special Matrices -@section Famous Matrices - -The following functions return famous matrix forms. - -@deftypefn {Function File} {} hadamard (@var{k}) -Return the Hadamard matrix of order n = 2^k. -@end deftypefn - -@deftypefn {Function File} {} hankel (@var{c}, @var{r}) -Return the Hankel matrix constructed given the first column @var{c}, and -(optionally) the last row @var{r}. If the last element of @var{c} is -not the same as the first element of @var{r}, the last element of -@var{c} is used. If the second argument is omitted, the last row is -taken to be the same as the first column. - -A Hankel matrix formed from an m-vector @var{c}, and an n-vector -@var{r}, has the elements -@iftex -@tex -$$ -H (i, j) = \cases{c_{i+j-1},&$i+j-1\le m$;\cr r_{i+j-m},&otherwise.\cr} -$$ -@end tex -@end iftex -@ifinfo - -@example -@group -H (i, j) = c (i+j-1), i+j-1 <= m; -H (i, j) = r (i+j-m), otherwise -@end group -@end example -@end ifinfo -@end deftypefn - -@deftypefn {Function File} {} hilb (@var{n}) -Return the Hilbert matrix of order @var{n}. The -@iftex -@tex -$i,\,j$ -@end tex -@end iftex -@ifinfo -i, j -@end ifinfo -element of a Hilbert matrix is defined as -@iftex -@tex -$$ -H (i, j) = {1 \over (i + j - 1)} -$$ -@end tex -@end iftex -@ifinfo - -@example -H (i, j) = 1 / (i + j - 1) -@end example -@end ifinfo -@end deftypefn - -@deftypefn {Function File} {} invhilb (@var{n}) -Return the inverse of a Hilbert matrix of order @var{n}. This is exact. -Compare with the numerical calculation of @code{inverse (hilb (n))}, -which suffers from the ill-conditioning of the Hilbert matrix, and the -finite precision of your computer's floating point arithmetic. -@end deftypefn - -@deftypefn {Function File} {} toeplitz (@var{c}, @var{r}) -Return the Toeplitz matrix constructed given the first column @var{c}, -and (optionally) the first row @var{r}. If the first element of @var{c} -is not the same as the first element of @var{r}, the first element of -@var{c} is used. If the second argument is omitted, the first row is -taken to be the same as the first column. - -A square Toeplitz matrix has the form -@iftex -@tex -$$ -\left[\matrix{c_0 & r_1 & r_2 & \ldots & r_n\cr - c_1 & c_0 & r_1 & & c_{n-1}\cr - c_2 & c_1 & c_0 & & c_{n-2}\cr - \vdots & & & & \vdots\cr - c_n & c_{n-1} & c_{n-2} & \ldots & c_0}\right]. -$$ -@end tex -@end iftex -@ifinfo - -@example -@group -c(0) r(1) r(2) ... r(n) -c(1) c(0) r(1) r(n-1) -c(2) c(1) c(0) r(n-2) - . . - . . - . . - -c(n) c(n-1) c(n-2) ... c(0) -@end group -@end example -@end ifinfo -@end deftypefn - -@deftypefn {Function File} {} vander (@var{c}) -Return the Vandermonde matrix whose next to last column is @var{c}. - -A Vandermonde matrix has the form -@iftex -@tex -$$ -\left[\matrix{c_0^n & \ldots & c_0^2 & c_0 & 1\cr - c_1^n & \ldots & c_1^2 & c_1 & 1\cr - \vdots & & \vdots & \vdots & \vdots\cr - c_n^n & \ldots & c_n^2 & c_n & 1}\right]. -$$ -@end tex -@end iftex -@ifinfo - -@example -@group -c(0)^n ... c(0)^2 c(0) 1 -c(1)^n ... c(1)^2 c(1) 1 - . . . . - . . . . - . . . . - -c(n)^n ... c(n)^2 c(n) 1 -@end group -@end example -@end ifinfo -@end deftypefn diff --git a/doc/interpreter/using.texi b/doc/interpreter/using.texi deleted file mode 100644 --- a/doc/interpreter/using.texi +++ /dev/null @@ -1,54 +0,0 @@ -@c Copyright (C) 1996, 1997 John W. Eaton -@c This is part of the Octave manual. -@c For copying conditions, see the file gpl.texi. - -@cindex manual, using this -@cindex using this manual -@cindex language, Octave -@cindex program, @code{octave} -@cindex Octave language -@cindex @code{octave} program - -@node Using this Manual -@chapter Using the Manual - -The term Octave refers to a particular program, and to the language you -use to tell this program what to do. When we need to be careful, we -call the program ``the @code{octave} interpreter'' and the language -``the Octave language.'' The purpose of this manual is to explain both -the Octave language and how to run the @code{octave} interpreter. - -The term @dfn{Octave program} refers to a program written by you in -the Octave programming language. - -@xref{Introduction, ,Introduction}, for the bare essentials you need to -know to start using @code{octave}. - -@c XXX FIXME XXX -- need example program -@c -@c A sample Octave program has been provided for you (@pxref{Sample Program}). - -@c XXX FIXME XXX -- should we also have a glossary? -@c -@c If you find terms that you aren't familiar with, try looking them -@c up in the glossary (@pxref{Glossary}).@refill - -@c XXX FIXME XXX -- how about a language summary too? -@c -@c The entire Octave language is summarized for quick reference in -@c @xref{Octave Summary}. Look there if you just need -to refresh your memory about a particular feature. - -Most of the time complete Octave programs are used as examples, but in -some of the more advanced sections, only the part of the Octave program -that illustrates the concept being described is shown. - -@c XXX FIXME XXX -- should also explain typesetting conventions. - -@ifinfo -If you are reading this in GNU Emacs using Info, you can copy the regions -of text showing these sample files into your own test files. This way you -can try out the examples shown in the remainder of this document. You do -this by using the command @kbd{M-x write-region} to copy text from the Info -file into a file for use with @code{octave}. -@end ifinfo diff --git a/f2c-compat.sh b/f2c-compat.sh deleted file mode 100755 --- a/f2c-compat.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh -# -# f2c-compat -- try to see if calling a Fortran compiled routine from -# a C compiled main program will work as if the Fortran routine has -# been translated to C via f2c. -# -# John W. Eaton -# jwe@che.utexas.edu -# Department of Chemical Engineering -# The University of Texas at Austin - -# trap 'rm -f ftest* ctest* core; exit 1' 1 3 15 - -status=1 - -if test $# -eq 0; then - FLIBS_SH="./flibs.sh" -elif test $# -eq 1; then - FLIBS_SH="$1" -else - echo "usage: f2c-compat.sh [flibs_script]" - exit 1 -fi - -# Write a minimal program, compile it, and see if it works as -# expected. - -cat << EOF > ftest.f - INTEGER FUNCTION FORSUB (C, D) - CHARACTER *(*) C - INTEGER L - DOUBLE PRECISION D - L = LEN (C) - WRITE (*, '(A,1X,I2)') C(1:L), INT (D) - FORSUB = 1 - RETURN - END -EOF -${F77-f77} -c ftest.f > /dev/null 2>&1 - -cat << EOF > ctest.c -extern int strlen (); -extern int strcpy (); -extern int forsub_ (); -static char s[14]; -int -main (argc, argv) - int argc; - char **argv; -{ - double d = 10.0; - int len; - strcpy (s, "FOO-I-HITHERE"); - len = strlen (s); - return (! forsub_ (s, &d, len)); -} -/* For Sun f77 */ -int -MAIN_ () -{ - return 0; -} -EOF - -${CC-cc} -c ctest.c > /dev/null 2>&1 - -FLIBS=`F77="${F77-f77}" $FLIBS_SH` - -${CC-cc} -o ctest ctest.o ftest.o $FLIBS -lm > /dev/null 2>&1 - -ctest_output=`./ctest 2>&1` -status=$? - -if test $status -eq 0 && test "$ctest_output" = "FOO-I-HITHERE 10" -then - echo '-DF77_APPEND_UNDERSCORE=1' - status=0 -else - cat << EOF > ctest.c -extern int strlen (); -extern int strcpy (); -extern int forsub (); -static char s[14]; -int -main (argc, argv) - int argc; - char **argv; -{ - double d = 10.0; - int len; - strcpy (s, "FOO-I-HITHERE"); - len = strlen (s); - return (! forsub (s, &d, len)); -} -/* For Sun f77 */ -int -MAIN_ () -{ - return 0; -} -EOF - - ${CC-cc} -c ctest.c > /dev/null 2>&1 - - ${CC-cc} -o ctest ctest.o ftest.o $FLIBS -lm > /dev/null 2>&1 - - ctest_output=`./ctest 2>&1` - status=$? - - if test $status -eq 0 && test "$ctest_output" = "FOO-I-HITHERE 10" - then - status=0 - fi -fi - -rm -f ftest* ctest* core - -# Bye-bye. - -exit $status diff --git a/flibs.sh b/flibs.sh deleted file mode 100755 --- a/flibs.sh +++ /dev/null @@ -1,147 +0,0 @@ -#!/bin/sh -# -# flibs -- try to get the Fortran compiler to tell us what libraries -# it expects to link to, and echo the result to the standard output. -# -# John W. Eaton -# jwe@che.utexas.edu -# Department of Chemical Engineering -# The University of Texas at Austin - -trap 'rm -f conftest* core; exit 1' 1 3 15 - -# Write a minimal program and compile it with -v. I don't know what -# to do if your compiler doesn't have -v... - -echo " END" > conftest.f - -if test $# -eq 1 -then - foutput=`cat $1` -else - foutput=`${F77-f77} -v -o conftest conftest.f 2>&1` -fi - -# The easiest thing to do for xlf output is to replace all the commas -# with spaces. Try to only do that if the output is really from xlf, -# since doing that causes problems on other systems. - -xlf_p=`echo $foutput | grep xlfentry` -if test -n "$xlf_p" -then - foutput=`echo $foutput | sed 's/,/ /g'` -fi - -ld_run_path=`echo $foutput | \ - sed -n -e 's/.*\(LD_RUN_PATH *= *[^ ]*\).*/\1/p' | \ - sed -e 's/LD_RUN_PATH *= *//'` - -# We are only supposed to find this on Solaris systems, and this -# substitution is probably only going to work with gcc on those -# systems... - -if test -n "$ld_run_path" -then - ld_run_path="-Xlinker -R -Xlinker $ld_run_path" -fi - -flibs= -lflags= - -# If want_arg is set, we know we want the arg to be added to the list, -# so we don't have to examine it. -want_arg= - -for arg in $foutput -do - old_want_arg=$want_arg - want_arg= - case "$old_want_arg" in - '') - case $arg in - /*.a | /*values-X*.o) - exists=false - for f in $lflags - do - if test x$arg = x$f - then - exists=true - fi - done - if $exists - then - arg= - else - lflags="$lflags $arg" - fi - ;; - -lang*) - arg= - ;; - -[lLR]) - want_arg=$arg - arg= - ;; - -[lLR]*) - exists=false - for f in $lflags - do - if test x$arg = x$f - then - exists=true - fi - done - if $exists || test x$arg = x-lm -o x$arg = x-lc - then - arg= - else - lflags="$lflags $arg" - fi - ;; - -u) - want_arg=$arg - ;; - -Y) - want_arg=$arg - arg= - ;; - *) - arg= - ;; - esac - ;; - -[lLR]) - arg="$old_want_arg $arg" - ;; - -Y) - -# Should probably try to ensure unique directory options here too. -# This probably only applies to Solaris systems, and then will only -# work with gcc... - - arg=`echo $arg | sed -e 's%^P,%%'` - SAVE_IFS=$IFS - IFS=: - list= - for elt in $arg - do - list="$list -L $elt" - done - IFS=$SAVE_IFS - arg="$list" - ;; - esac - - if test -n "$arg" - then - flibs="$flibs $arg" - fi -done - -echo "$ld_run_path $flibs" - -rm -f conftest* core - -# Bye-bye. - -exit 0 diff --git a/float-type.c b/float-type.c deleted file mode 100644 --- a/float-type.c +++ /dev/null @@ -1,448 +0,0 @@ -/* - -This file combines the single and double precision versions of machar, -selected by cc -DSP or cc -DDP. This feature provided by D. G. Hough, -August 3, 1988. - -*/ - -#ifdef SP -#define REAL float -#define ZERO 0.0 -#define ONE 1.0 -#define PREC "Single " -#define REALSIZE 1 -#endif - -#ifdef DP -#define REAL double -#define ZERO 0.0e0 -#define ONE 1.0e0 -#define PREC "Double " -#define REALSIZE 2 -#endif - -#include -#include - -#define ABS(xxx) ((xxx>ZERO)?(xxx):(-xxx)) - -void -rmachar(ibeta,it,irnd,ngrd,machep,negep,iexp,minexp, - maxexp,eps,epsneg,xmin,xmax) - - int *ibeta,*iexp,*irnd,*it,*machep,*maxexp,*minexp,*negep,*ngrd; - REAL *eps,*epsneg,*xmax,*xmin; - -/* - - This subroutine is intended to determine the parameters of the - floating-point arithmetic system specified below. The - determination of the first three uses an extension of an algorithm - due to M. Malcolm, CACM 15 (1972), pp. 949-951, incorporating some, - but not all, of the improvements suggested by M. Gentleman and S. - Marovich, CACM 17 (1974), pp. 276-277. An earlier version of this - program was published in the book Software Manual for the - Elementary Functions by W. J. Cody and W. Waite, Prentice-Hall, - Englewood Cliffs, NJ, 1980. The present program is a - translation of the Fortran 77 program in W. J. Cody, "MACHAR: - A subroutine to dynamically determine machine parameters". - TOMS (14), 1988. - - Parameter values reported are as follows: - - ibeta - the radix for the floating-point representation - it - the number of base ibeta digits in the floating-point - significand - irnd - 0 if floating-point addition chops - 1 if floating-point addition rounds, but not in the - IEEE style - 2 if floating-point addition rounds in the IEEE style - 3 if floating-point addition chops, and there is - partial underflow - 4 if floating-point addition rounds, but not in the - IEEE style, and there is partial underflow - 5 if floating-point addition rounds in the IEEE style, - and there is partial underflow - ngrd - the number of guard digits for multiplication with - truncating arithmetic. It is - 0 if floating-point arithmetic rounds, or if it - truncates and only it base ibeta digits - participate in the post-normalization shift of the - floating-point significand in multiplication; - 1 if floating-point arithmetic truncates and more - than it base ibeta digits participate in the - post-normalization shift of the floating-point - significand in multiplication. - machep - the largest negative integer such that - 1.0+FLOAT(ibeta)**machep .NE. 1.0, except that - machep is bounded below by -(it+3) - negeps - the largest negative integer such that - 1.0-FLOAT(ibeta)**negeps .NE. 1.0, except that - negeps is bounded below by -(it+3) - iexp - the number of bits (decimal places if ibeta = 10) - reserved for the representation of the exponent - (including the bias or sign) of a floating-point - number - minexp - the largest in magnitude negative integer such that - FLOAT(ibeta)**minexp is positive and normalized - maxexp - the smallest positive power of BETA that overflows - eps - the smallest positive floating-point number such - that 1.0+eps .NE. 1.0. In particular, if either - ibeta = 2 or IRND = 0, eps = FLOAT(ibeta)**machep. - Otherwise, eps = (FLOAT(ibeta)**machep)/2 - epsneg - A small positive floating-point number such that - 1.0-epsneg .NE. 1.0. In particular, if ibeta = 2 - or IRND = 0, epsneg = FLOAT(ibeta)**negeps. - Otherwise, epsneg = (ibeta**negeps)/2. Because - negeps is bounded below by -(it+3), epsneg may not - be the smallest number that can alter 1.0 by - subtraction. - xmin - the smallest non-vanishing normalized floating-point - power of the radix, i.e., xmin = FLOAT(ibeta)**minexp - xmax - the largest finite floating-point number. In - particular xmax = (1.0-epsneg)*FLOAT(ibeta)**maxexp - Note - on some machines xmax will be only the - second, or perhaps third, largest number, being - too small by 1 or 2 units in the last digit of - the significand. - - Latest revision - August 4, 1988 - - Author - W. J. Cody - Argonne National Laboratory - -*/ - -{ - int i,iz,j,k; - int mx,itmp,nxres; - REAL a,b,beta,betain,one,y,z,zero; - REAL betah,t,tmp,tmpa,tmp1,two; - - (*irnd) = 1; - one = (REAL)(*irnd); - two = one + one; - a = two; - b = a; - zero = 0.0e0; - -/* - determine ibeta,beta ala malcolm -*/ - - tmp = ((a+one)-a)-one; - - while (tmp == zero) { - a = a+a; - tmp = a+one; - tmp1 = tmp-a; - tmp = tmp1-one; - } - - tmp = a+b; - itmp = (int)(tmp-a); - while (itmp == 0) { - b = b+b; - tmp = a+b; - itmp = (int)(tmp-a); - } - - *ibeta = itmp; - beta = (REAL)(*ibeta); - -/* - determine irnd, it -*/ - - (*it) = 0; - b = one; - tmp = ((b+one)-b)-one; - - while (tmp == zero) { - *it = *it+1; - b = b*beta; - tmp = b+one; - tmp1 = tmp-b; - tmp = tmp1-one; - } - - *irnd = 0; - betah = beta/two; - tmp = a+betah; - tmp1 = tmp-a; - if (tmp1 != zero) *irnd = 1; - tmpa = a+beta; - tmp = tmpa+betah; - if ((*irnd == 0) && (tmp-tmpa != zero)) *irnd = 2; - -/* - determine negep, epsneg -*/ - - (*negep) = (*it) + 3; - betain = one / beta; - a = one; - - for (i = 1; i<=(*negep); i++) { - a = a * betain; - } - - b = a; - tmp = (one-a); - tmp = tmp-one; - - while (tmp == zero) { - a = a*beta; - *negep = *negep-1; - tmp1 = one-a; - tmp = tmp1-one; - } - - (*negep) = -(*negep); - (*epsneg) = a; - -/* - determine machep, eps -*/ - - (*machep) = -(*it) - 3; - a = b; - tmp = one+a; - - while (tmp-one == zero) { - a = a*beta; - *machep = *machep+1; - tmp = one+a; - } - - *eps = a; - -/* - determine ngrd -*/ - - (*ngrd) = 0; - tmp = one+*eps; - tmp = tmp*one; - if (((*irnd) == 0) && (tmp-one) != zero) (*ngrd) = 1; - -/* - determine iexp, minexp, xmin - - loop to determine largest i such that - (1/beta) ** (2**(i)) - does not underflow. - exit from loop is signaled by an underflow. -*/ - - i = 0; - k = 1; - z = betain; - t = one+*eps; - nxres = 0; - - for (;;) { - y = z; - z = y * y; - -/* - check for underflow -*/ - - a = z * one; - tmp = z*t; - if ((a+a == zero) || (ABS(z) > y)) break; - tmp1 = tmp*betain; - if (tmp1*beta == z) break; - i = i + 1; - k = k+k; - } - -/* - determine k such that (1/beta)**k does not underflow - first set k = 2 ** i -*/ - - (*iexp) = i + 1; - mx = k + k; - if (*ibeta == 10) { - -/* - for decimal machines only -*/ - - (*iexp) = 2; - iz = *ibeta; - while (k >= iz) { - iz = iz * (*ibeta); - (*iexp) = (*iexp) + 1; - } - mx = iz + iz - 1; - } - -/* - loop to determine minexp, xmin. - exit from loop is signaled by an underflow. -*/ - - for (;;) { - (*xmin) = y; - y = y * betain; - a = y * one; - tmp = y*t; - tmp1 = a+a; - if ((tmp1 == zero) || (ABS(y) >= (*xmin))) break; - k = k + 1; - tmp1 = tmp*betain; - tmp1 = tmp1*beta; - - if ((tmp1 == y) && (tmp != y)) { - nxres = 3; - *xmin = y; - break; - } - - } - - (*minexp) = -k; - -/* - determine maxexp, xmax -*/ - - if ((mx <= k+k-3) && ((*ibeta) != 10)) { - mx = mx + mx; - (*iexp) = (*iexp) + 1; - } - - (*maxexp) = mx + (*minexp); - -/* - Adjust *irnd to reflect partial underflow. -*/ - - (*irnd) = (*irnd)+nxres; - -/* - Adjust for IEEE style machines. -*/ - - if ((*irnd) >= 2) (*maxexp) = (*maxexp)-2; - -/* - adjust for machines with implicit leading bit in binary - significand and machines with radix point at extreme - right of significand. -*/ - - i = (*maxexp) + (*minexp); - if (((*ibeta) == 2) && (i == 0)) (*maxexp) = (*maxexp) - 1; - if (i > 20) (*maxexp) = (*maxexp) - 1; - if (a != y) (*maxexp) = (*maxexp) - 2; - (*xmax) = one - (*epsneg); - tmp = (*xmax)*one; - if (tmp != (*xmax)) (*xmax) = one - beta * (*epsneg); - (*xmax) = (*xmax) / (beta * beta * beta * (*xmin)); - i = (*maxexp) + (*minexp) + 3; - if (i > 0) { - - for (j = 1; j<=i; j++ ) { - if ((*ibeta) == 2) (*xmax) = (*xmax) + (*xmax); - if ((*ibeta) != 2) (*xmax) = (*xmax) * beta; - } - - } - - return; - -} - -typedef union -{ - double d; - int i[2]; -} equiv; - -#ifdef DP -int -equiv_compare (equiv *std, equiv *v, int len) -{ - int i; - for (i = 0; i < len; i++) - if (v[i].i[0] != std[i].i[0] || v[i].i[1] != std[i].i[1]) - return 0; - return 1; -} -#endif - -int -main (void) -{ - /* Works for 32 bit machines with 32 bit ints and 64 bit doubles */ - - int ibeta, iexp, irnd, it, machep, maxexp, minexp, negep, ngrd; - REAL eps, epsneg, xmax, xmin; - int i; - equiv flt_params[4]; - - rmachar (&ibeta, &it, &irnd, &ngrd, &machep, &negep, &iexp, &minexp, - &maxexp, &eps, &epsneg, &xmin, &xmax); - - flt_params[0].d = xmin; - flt_params[1].d = xmax; - flt_params[2].d = epsneg; - flt_params[3].d = eps; - -#ifdef DP -#define IS_MACH(v,nm,sm_1,sm_2,lrg_1,lrg_2,rt_1,rt_2,dv_1,dv_2) \ - do \ - { \ - equiv v[4]; \ - v[0].i[0] = (sm_1); v[0].i[1] = (sm_2); \ - v[1].i[0] = (lrg_1); v[1].i[1] = (lrg_2); \ - v[2].i[0] = (rt_1); v[2].i[1] = (rt_2); \ - v[3].i[0] = (dv_1); v[3].i[1] = (dv_2); \ -\ - if (equiv_compare (v, flt_params, 4)) \ - { \ - printf ("%s\n", nm); \ - return 0; \ - } \ - } \ - while (0) - - IS_MACH (ieee_big_endian, "IEEE_BIG_ENDIAN", - 1048576, 0, - 2146435071, -1, - 1017118720, 0, - 1018167296, 0); -/* 1070810131, 1352628735); */ - - IS_MACH (ieee_little_endian, "IEEE_LITTLE_ENDIAN", - 0, 1048576, - -1, 2146435071, - 0, 1017118720, - 0, 1018167296); -/* 1352628735, 1070810131); */ - - IS_MACH (vax_d_float, "VAX_D_FLOAT", - 128, 0, - -32769, -1, - 9344, 0, - 9344, 0); -/* 546979738, -805796613); */ - - IS_MACH (vax_g_float, "VAX_G_FLOAT", - 16, 0, - -32769, -1, - 15552, 0, - 15552, 0); -/* 1142112243, 2046775455); */ -#else -LOSE! LOSE! -#endif - - printf ("UNRECOGNIZED_FLOATING_POINT_FORMAT\n"); - return 1; -}