#! /bin/sh # # To apply this patch, cd to the top level Octave source directory and # run this file through /bin/sh. It will first remove any files that # have been deleted from the source distribution since the last # release and then update the sources with patch(1). # # Diffs for updating *.ps, *.dvi, and *.info* files are not included # because they can be recreated from the Texinfo files using TeX and # makeinfo. # # Diffs for updating parse.cc and y.tab.h are not included because # they can be recreated from the file parse.y using bison. # # Diffs for updating lex.cc are not included because it can be # recreated from lex.l using flex. # # Diffs for updating the configure script are not included because # it can be recreated from configure.in using autoconf. # # John W. Eaton # jwe@bevo.che.wisc.edu # University of Wisconsin-Madison # Department of Chemical Engineering if test -f src/octave.cc ; then true else echo '***********************************************************' 1>&2 echo 'You must run this script in the top-level octave directory!' 1>&2 echo '***********************************************************' 1>&2 exit 1 fi ### ### Special commands should go here. ### rm -f doc/interpreter/amuse.texi doc/interpreter/extend.texi \ doc/interpreter/gnuinfo.texi doc/interpreter/help.texi \ doc/interpreter/history.texi doc/interpreter/hsuser.texi \ doc/interpreter/in-idx.texi doc/interpreter/invoke.texi \ doc/interpreter/program.texi doc/interpreter/rd-idx.texi \ doc/interpreter/rluser.texi doc/interpreter/special.texi \ src/mk-oct-links.in echo 'patching existing files' patch -p1 << \PATCH_EOF diff -cNr octave-2.0.2/BUGS octave-2.0.3/BUGS *** octave-2.0.2/BUGS Sun Jan 26 22:18:05 1997 --- octave-2.0.3/BUGS Tue Feb 18 09:39:34 1997 *************** *** 148,160 **** for you. If for some reason you cannot use Octave's `bug_report' function, ! send bug reports for Octave to: ! ! bug-octave@bevo.che.wisc.edu *Do not send bug reports to `help-octave'*. Most users of Octave do ! not want to receive bug reports. Those that do have asked to be on ! `bug-octave'. As a last resort, send bug reports on paper to: --- 148,158 ---- for you. If for some reason you cannot use Octave's `bug_report' function, ! send bug reports for Octave to . *Do not send bug reports to `help-octave'*. Most users of Octave do ! not want to receive bug reports. Those that do have asked to be on the ! mailing list. As a last resort, send bug reports on paper to: *************** *** 255,261 **** * If you wish to suggest changes to the Octave source, send them as context diffs. If you even discuss something in the Octave source, refer to it by context, not by line number, because the line ! numbers in the development sources probalby won't match those in your sources. Here are some things that are not necessary: --- 253,259 ---- * If you wish to suggest changes to the Octave source, send them as context diffs. If you even discuss something in the Octave source, refer to it by context, not by line number, because the line ! numbers in the development sources probably won't match those in your sources. Here are some things that are not necessary: *************** *** 342,359 **** How To Get Help with Octave =========================== ! If you need help installing, using or changing Octave, the mailing ! list ! ! help-octave@bevo.che.wisc.edu ! ! exists for the discussion of Octave matters related to using, ! installing, and porting Octave. If you would like to join the ! discussion, please send a short note to ! ! help-octave-request@bevo.che.wisc.edu ! ^^^^^^^ *Please do not* send requests to be added or removed from the the mailing list, or other administrative trivia to the list itself. --- 340,355 ---- How To Get Help with Octave =========================== ! The mailing list exists for the ! discussion of matters related to using and installing Octave. If would ! like to join the discussion, please send a short note to ! . *Please do not* send requests to be added or removed from the the mailing list, or other administrative trivia to the list itself. + + If you think you have found a bug in the installation procedure, + however, you should send a complete bug report for the problem to + . *Note Bug Reporting:: for information + that will help you to submit a useful report. diff -cNr octave-2.0.2/ChangeLog octave-2.0.3/ChangeLog *** octave-2.0.2/ChangeLog Mon Jan 27 15:52:16 1997 --- octave-2.0.3/ChangeLog Tue Feb 18 09:22:16 1997 *************** *** 1,3 **** --- 1,88 ---- + Tue Feb 18 09:22:04 1997 John W. Eaton + + * Version 2.0.3 released. + + Tue Feb 18 00:33:36 1997 John W. Eaton + + * octMakefile.in (binary-dist): Strip src/octave and info/info. + + * examples/oregonator.m, examples/oregonator.cc: New files. + * examples/Makefile.in (SOURCES): Add them to the list. + + Fri Feb 14 14:07:08 1997 John W. Eaton + + * install-octave: Don't fail if LIBRARIES file is missing. + Don't try to install .oct files if there aren't any. + + * octMakefile.in (bin-dist-type): Delete target. + (binary-dist): Don't depend on bin-dist-type. + Don't delete config.status or config.h here. + (BINDISTFILES): Include config.status and config.h here. + (dist): Don't delete Makefile here. + (binary-dist): Avoid empty chmod command. + + * Makefile.in (config-check): New target. + (all): Depend on config-check. + (static-binary-distribution, dynamic-binary-distribution): Delete. + (binary-distribution): If in source directory, run configure and + make with appropriate args. + + * octMakefile.in (maintainer-clean, distclean): Don't delete Makefile. + (CONF_DISTFILES): Distribute Makefile too. + + Thu Feb 13 16:25:09 1997 John W. Eaton + + * configure.in (SH_LD, SH_LDFLAGS): New variables. + * Makeconf.in: Substitute them. + + * configure.in (SH_LIBS, SH_FLIBS, SH_TERMLIBS): Delete. + + * Makeconf.in (SH_LIBS, SH_FLIBS, SH_TERMLIBS): Delete. + + * octave-bug.in: Reinstate RLD_FLAG. + * mkoctfile.in: Likewise. + * Makeconf.in: Likewise. + + * configure.in: Reinstate RLD_FLAG, but make it optional. + + Tue Feb 4 14:10:35 1997 John W. Eaton + + * octMakefile.in (binary-dist): Use find and xargs instead of + requiring chmod to support X. + + Mon Feb 3 23:51:08 1997 John W. Eaton + + * examples/info-emacs-octave-help: Update from Kurt Hornik. + + Fri Jan 31 20:41:15 1997 John W. Eaton + + * dlfcn/Makefile.in (all): Make libdlfcn.a, not dlfcn.a. + + Wed Jan 29 00:18:55 1997 John W. Eaton + + * Makeconf.in: Use -M instead of -MM to generate dependencies. + Don't strip $(srcdir) from output. + + * examples/Makefile.in (install): Install info-emacs-info and + info-emacs-octave-help in $(archlibdir). + + * configure.in (INSTALL_SCRIPT): Substitute this in Makefiles. + * octMakefile.in (INSTALL_SCRIPT): New macro. + (install): Use it. + * Makefile.in (install-strip): New target. + + Tue Jan 28 09:48:32 1997 John W. Eaton + + * aclocal.m4 (OCTAVE_FLIBS): Don't look for values-X*.o. This is + apparently added automatically now by gcc. Don't put space + between -L and directory name. + + * Makefile.in (help): New target. + (header-msg): extract from all. + (all, help): Depend on header-msg. + + * aclocal.m4 (ld_run_path): Fix typo in last fix. + Mon Jan 27 00:10:10 1997 John W. Eaton * Version 2.0.2 released. diff -cNr octave-2.0.2/INSTALL.OCTAVE octave-2.0.3/INSTALL.OCTAVE *** octave-2.0.2/INSTALL.OCTAVE Sun Jan 26 22:17:59 1997 --- octave-2.0.3/INSTALL.OCTAVE Tue Feb 18 09:39:34 1997 *************** *** 26,40 **** Look for Octave sources in the directory DIR. `--with-f2c' ! Use f2c even if Fortran compiler is available. ! `--enable-dld' ! Use DLD to make Octave capable of dynamically linking ! externally compiled functions. This only works on systems ! that have a working port of DLD. `--enable-lite-kernel' ! Compile smaller kernel. This currently requires DLD so that Octave can load functions at run time that are not loaded at compile time. --- 26,50 ---- Look for Octave sources in the directory DIR. `--with-f2c' ! Use `f2c' even if a Fortran compiler is available. ! `--with-g77' ! Use `g77' to compile Fortran code. ! ! `--enable-dl' ! Use `dlopen' and friends to make Octave capable of dynamically ! linking externally compiled functions. This only works on ! systems that actually have these functions. ! ! `--enable-shl' ! Use `shl_load' and friends to make Octave capable of ! dynamically linking externally compiled functions. This only ! works on systems that actually have these functions (only ! HP-UX systems). `--enable-lite-kernel' ! Compile smaller kernel. This currently requires the dynamic ! linking functions `dlopen' or `shl_load' and friends so that Octave can load functions at run time that are not loaded at compile time. *************** *** 49,57 **** * Run make. ! You will need a recent version of GNU make. Modifying Octave's makefiles to work with other make programs is probably not worth ! your time. We recommend you get and compile GNU make instead. For plotting, you will need to have gnuplot installed on your system. Gnuplot is a command-driven interactive function plotting --- 59,67 ---- * Run make. ! You will need a recent version of GNU Make. Modifying Octave's makefiles to work with other make programs is probably not worth ! your time. We recommend you get and compile GNU Make instead. For plotting, you will need to have gnuplot installed on your system. Gnuplot is a command-driven interactive function plotting *************** *** 59,91 **** `gnu' in gnuplot is a coincidence--it is not related to the GNU project or the FSF in any but the most peripheral sense. ! For version 2.0.1, you must have the GNU C++ compiler (gcc) version 2.7.2 or later to compile Octave. You will also need ! version 2.7.1 or 2.7.2 of the GNU C++ class library (libg++). If ! you plan to modify the parser you will also need GNU bison and ! fles. If you modify the documentation, you will need GNU Texinfo, ! along with the patch for the makeinfo program that is distributed ! with Octave. ! ! GNU make, gcc, and libg++, gnuplot, bison, flex, and Texinfo are ! all available from many anonymous ftp archives. The primary site ! is prep.ai.mit.edu, but it is often very busy. A list of sites ! that mirror the software on prep is available by anonymous ftp ! from prep.ai.mit.edu in the file `/pub/gnu/GNUinfo/FTP', or by ! fingering fsf@prep.ai.mit.edu. If you don't have a Fortran compiler, or if your Fortran compiler doesn't work like the traditional Unix f77, you will need to have ! the Fortran to C translator f2c. You can get f2c from any number ! of anonymous ftp archives. The most recent version of f2c is ! always available from netlib.att.com. ! ! On an otherwise idle SPARCstation II, it will take somewhere ! between 60 and 90 minutes to compile everything, depending on ! whether you are compiling the Fortran libraries with f2c or using ! the Fortran compiler directly. You will need about 50 megabytes ! of disk storage to work with (considerably less if you don't ! compile with debugging symbols). To do that, use the command make CFLAGS=-O CXXFLAGS=-O LDFLAGS= --- 69,101 ---- `gnu' in gnuplot is a coincidence--it is not related to the GNU project or the FSF in any but the most peripheral sense. ! For version 2.0.3, you must have the GNU C++ compiler (`gcc') version 2.7.2 or later to compile Octave. You will also need ! version 2.7.1 or 2.7.2 of the GNU C++ class library (`libg++'). ! If you plan to modify the parser you will also need GNU `bison' ! and `flex'. If you modify the documentation, you will need GNU ! Texinfo, along with the patch for the `makeinfo' program that is ! distributed with Octave. ! ! GNU Make, `gcc', and `libg++', `gnuplot', `bison', `flex', and ! Texinfo are all available from many anonymous ftp archives. The ! primary site is `prep.ai.mit.edu', but it is often very busy. A ! list of sites that mirror the software on `prep' is available by ! anonymous ftp from `ftp://prep.ai.mit.edu/pub/gnu/GNUinfo/FTP', or ! by fingering . If you don't have a Fortran compiler, or if your Fortran compiler doesn't work like the traditional Unix f77, you will need to have ! the Fortran to C translator `f2c'. You can get `f2c' from any ! number of anonymous ftp archives. The most recent version of `f2c' ! is always available from `netlib.att.com'. ! ! On an otherwise idle Pentium 133 running Linux, it will take ! somewhere between 1-1/2 to 3 hours to compile everything, ! depending on whether you are building shared libraries. You will ! need about 100 megabytes of disk storage to work with ! (considerably less if you don't compile with debugging symbols). ! To do that, use the command make CFLAGS=-O CXXFLAGS=-O LDFLAGS= *************** *** 166,175 **** warning: ANSI C++ prohibits conversion from `(int)' to `(...)' while compiling `sighandlers.cc', you may need to edit some files ! in the gcc include subdirectory to add proper prototypes for functions there. For example, Ultrix 4.2 needs proper ! declarations for the `signal()' and the `SIG_IGN' macro in the ! file `signal.h'. On some systems the `SIG_IGN' macro is defined to be something like this: --- 176,185 ---- warning: ANSI C++ prohibits conversion from `(int)' to `(...)' while compiling `sighandlers.cc', you may need to edit some files ! in the `gcc' include subdirectory to add proper prototypes for functions there. For example, Ultrix 4.2 needs proper ! declarations for the `signal' function and the `SIG_IGN' macro in ! the file `signal.h'. On some systems the `SIG_IGN' macro is defined to be something like this: *************** *** 180,208 **** #define SIG_IGN (void (*)(int))1 ! to match the prototype declaration for `signal()'. This change ! should also be made for the `SIG_DFL' and `SIG_ERR' symbols. It ! may be necessary to change the definitions in `sys/signal.h' as ! well. ! ! The gcc fixincludes/fixproto script should probably fix these ! problems when gcc installs its modified set of header files, but I ! don't think that's been done yet. *You should not change the files in `/usr/include'*. You can find ! the gcc include directory tree by running the command gcc -print-libgcc-file-name ! The directory of gcc include files normally begins in the same directory that contains the file `libgcc.a'. ! * There is a bug with the makeinfo program that is distributed with Texinfo (through version 3.9) that causes the indices in Octave's on-line manual to be generated incorrectly. If you need to ! recreate the on-line documentation, you should get the makeinfo program that is distributed with texinfo-3.9 and apply the patch ! for makeinfo that is distributed with Octave. See the file `MAKEINFO.PATCH' for more details. * Some of the Fortran subroutines may fail to compile with older --- 190,218 ---- #define SIG_IGN (void (*)(int))1 ! to match the prototype declaration for the `signal' function. This ! change should also be made for the `SIG_DFL' and `SIG_ERR' ! symbols. It may be necessary to change the definitions in ! `sys/signal.h' as well. ! ! The `gcc' `fixincludes' and `fixproto' scripts should probably fix ! these problems when `gcc' installs its modified set of header ! files, but I don't think that's been done yet. *You should not change the files in `/usr/include'*. You can find ! the `gcc' include directory tree by running the command gcc -print-libgcc-file-name ! The directory of `gcc' include files normally begins in the same directory that contains the file `libgcc.a'. ! * There is a bug with the `makeinfo' program that is distributed with Texinfo (through version 3.9) that causes the indices in Octave's on-line manual to be generated incorrectly. If you need to ! recreate the on-line documentation, you should get the `makeinfo' program that is distributed with texinfo-3.9 and apply the patch ! for `makeinfo' that is distributed with Octave. See the file `MAKEINFO.PATCH' for more details. * Some of the Fortran subroutines may fail to compile with older *************** *** 237,243 **** * Some people have reported that calls to shell_cmd and the pager do not work on SunOS systems. This is apparently due to having `G_HAVE_SYS_WAIT' defined to be 0 instead of 1 when compiling ! libg++. * On NeXT systems, linking to `libsys_s.a' may fail to resolve the following functions --- 247,253 ---- * Some people have reported that calls to shell_cmd and the pager do not work on SunOS systems. This is apparently due to having `G_HAVE_SYS_WAIT' defined to be 0 instead of 1 when compiling ! `libg++'. * On NeXT systems, linking to `libsys_s.a' may fail to resolve the following functions *************** *** 295,376 **** Fax: (415) 962-1869 Octave may soon support FSQP, an NLP solver from Andre Tits ! (andre@src.umd.edu) of the University of Maryland. FSQP is available free of charge to academic sites, but can not be redistributed to third parties. Binary Distributions ==================== ! This section contains instructions for creating and installing a ! binary distribution. Installing Octave from a Binary Distribution -------------------------------------------- ! * To install Octave from a binary distribution, execute the command ! sh ./doinstall.sh ! in the top level directory of the distribution. ! Binary distributions are normally compiled assuming that Octave ! will be installed in the following subdirectories of `/usr/local'. ! `bin' ! Octave and other binaries that people will want to run ! directly. ! `man/man1' ! Unix-style man pages describing Octave. ! `info' ! Info files describing Octave. ! `lib/octave/VERSION/m' ! Function files distributed with Octave. This includes the ! Octave version, so that multiple versions of Octave may be ! installed at the same time. ! `lib/octave/VERSION/exec/HOST_TYPE' ! Executables to be run by Octave rather than the user. ! `lib/octave/VERSION/oct/HOST_TYPE' ! Object files that will be dynamically loaded. ! `lib/octave/VERSION/imagelib' ! Image files that are distributed with Octave. ! where VERSION stands for the current version number of the ! interpreter, and HOST_TYPE is the type of computer on which Octave ! is installed (for example, `i486-unknown-gnu'). ! ! If these directories don't exist, the script `doinstall.sh' will ! create them for you. ! ! If it is not possible for you to install Octave in `/usr/local', or ! if you would prefer to install it in a different directory, you can ! specify the name of the top level directory as an argument to the ! doinstall.sh script. For example: ! sh ./doinstall.sh /some/other/directory ! will install Octave in subdirectories of the directory ! `/some/other/directory'. Creating a Binary Distribution ------------------------------ ! Here is how to build a binary distribution for others. ! * You must build Octave in the same directory as the source. This is ! required since the `binary-dist' targets in the makefiles will not ! work if you compile outside the source tree. ! ! * Use `CFLAGS=-O CXXFLAGS=-O LDFLAGS=' as arguments for Make because ! most people who get the binary distributions are probably not ! going to be interested in debugging Octave. ! * Type `make binary-dist'. This will build everything and then pack ! it up for distribution. --- 305,433 ---- Fax: (415) 962-1869 Octave may soon support FSQP, an NLP solver from Andre Tits ! of the University of Maryland. FSQP is available free of charge to academic sites, but can not be redistributed to third parties. Binary Distributions ==================== ! Although Octave is not very difficult to build from its sources, it ! is a relatively large program that does require a significant amount of ! time and disk space to compile and install. Because of this, many ! people want to be able to obtain binary distributions so they can start ! using Octave immediately, without having to bother with the details of ! compiling it first. This is understandable, so I try to maintain a ! current collection of binary distributions at ! `ftp://ftp.che.wisc.edu/pub/octave/BINARIES'. ! ! Please understand, however, that there is only a limited amount of ! time available to devote to making binaries, so binaries may not be ! immediately available for some platforms. (Please contact ! if you are interested in helping make a ! binary distributions available for your system.) ! ! Also, binary distributions are limited to static binaries that do not ! support dynamic linking. For earlier versions of Octave, I tried ! distributing dynamically linked binaries but that proved to be too much ! trouble to support. If you want to have a copy of Octave that includes ! all the features described in this manual, you will have to build it ! from the sources yourself, or find someone else who is willing to do it ! for you. Installing Octave from a Binary Distribution -------------------------------------------- ! To install Octave from a binary distribution, execute the command ! sh ./install-octave ! in the top level directory of the distribution. ! Binary distributions are normally compiled assuming that Octave will ! be installed in the following subdirectories of `/usr/local'. ! `bin' ! Octave and other binaries that people will want to run directly. ! `lib' ! Shared libraries that Octave needs in order to run. These files ! are not included if you are installing a statically linked version ! of Octave. ! `man/man1' ! Unix-style man pages describing Octave. ! `info' ! Info files describing Octave. ! `share/octave/VERSION/m' ! Function files distributed with Octave. This includes the Octave ! version, so that multiple versions of Octave may be installed at ! the same time. ! `libexec/octave/VERSION/exec/HOST_TYPE' ! Executables to be run by Octave rather than the user. ! `libexec/octave/VERSION/oct/HOST_TYPE' ! Object files that will be dynamically loaded. ! `share/octave/VERSION/imagelib' ! Image files that are distributed with Octave. ! where VERSION stands for the current version number of the interpreter, ! and HOST_TYPE is the type of computer on which Octave is installed (for ! example, `i586-pc-linux-gnu'). ! If these directories don't exist, the script `install-octave' will ! create them for you. The installation script also creates the following ! subdirectories of `/usr/local' that are intended for locally installed ! functions: ! ! `share/octave/site/m' ! Locally installed M-files. ! ! `libexec/octave/site/exec/HOST_TYPE' ! Locally installed binaries intended to be run by Octave rather ! than by the user. ! ! `libexec/octave/site/octave/HOST_TYPE' ! Local object files that will be dynamically linked. ! ! If it is not possible for you to install Octave in `/usr/local', or ! if you would prefer to install it in a different directory, you can ! specify the name of the top level directory as an argument to the ! `install-octave' script. For example: ! ! sh ./install-octave /some/other/directory ! ! will install Octave in subdirectories of the directory ! `/some/other/directory'. Creating a Binary Distribution ------------------------------ ! Here is how to build a binary distribution for others to use. If you ! want to make a binary distribution for your system available along with ! the Octave sources and binaries on `ftp.che.wisc.edu', please follow ! this procedure. For directions explaining how to make the binary ! available on the ftp site, please contact ! . ! ! * Unpack the source distribution: ! ! gunzip -c octave-2.0.3.tar.gz | tar xf - ! ! * Change your current directory to the top-level directory of the ! source distribution: ! ! cd octave-2.0.3 ! ! * Make the binary distribution: ! make binary-dist ! This will create a compressed tar file ready for distribution. It ! will contain statically linked binaries and have a name like ! `octave-2.0.3-i586-pc-linux-gnu.tar.gz' diff -cNr octave-2.0.2/Makeconf.in octave-2.0.3/Makeconf.in *** octave-2.0.2/Makeconf.in Sat Jan 25 22:49:40 1997 --- octave-2.0.3/Makeconf.in Thu Feb 13 21:00:28 1997 *************** *** 114,119 **** --- 114,124 ---- ALL_LDFLAGS = $(LIBFLAGS) $(FORTRAN_MAIN_FLAG) $(GCC_IEEE_FP_FLAG) \ $(LD_STATIC_FLAG) $(CPICFLAG) $(LDFLAGS) + SH_LD = @SH_LD@ + SH_LDFLAGS = @SH_LDFLAGS@ + + RLD_FLAG = @RLD_FLAG@ + FLIBS = @FLIBS@ CXXLIBS = @CXXLIBS@ *************** *** 122,131 **** LIBPLPLOT = @LIBPLPLOT@ LIBDLFCN = @LIBDLFCN@ - SH_FLIBS = @SH_FLIBS@ - SH_TERMLIBS = @SH_TERMLIBS@ - SH_LIBS = @SH_LIBS@ - # The arguments passed to configure. config_opts = @config_opts@ --- 127,132 ---- *************** *** 274,286 **** %.d : %.cc @echo making $@ from $< @rm -f $@ ! @-if test "$(srcdir)" = "." ; then \ ! $(CXX) -MM $(CPPFLAGS) $(ALL_CXXFLAGS) $< | \ ! sed -e 's,$*\.o,pic/& & $@,g' > $@.tmp ; \ ! else \ ! $(CXX) -MM $(CPPFLAGS) $(ALL_CXXFLAGS) $< | \ ! sed -e 's,$*\.o,pic/& & $@,g' -e 's,$(srcdir)/,,g' > $@.tmp ; \ ! fi @mv $@.tmp $@ # And one for .c files.too: --- 275,282 ---- %.d : %.cc @echo making $@ from $< @rm -f $@ ! @$(CXX) -M $(CPPFLAGS) $(ALL_CXXFLAGS) $< | \ ! sed -e 's,$*\.o,pic/& & $@,g' > $@.tmp @mv $@.tmp $@ # And one for .c files.too: *************** *** 288,300 **** %.d : %.c @echo making $@ from $< @rm -f $@ ! @-if test "$(srcdir)" = "." ; then \ ! $(CC) -MM $(CPPFLAGS) $(ALL_CFLAGS) $< | \ ! sed -e 's,$*\.o,pic/& & $@,g' > $@.tmp ; \ ! else \ ! $(CC) -MM $(CPPFLAGS) $(ALL_CFLAGS) $< | \ ! sed -e 's,$*\.o,pic/& & $@,g' -e 's,$(srcdir)/,,g' > $@.tmp ; \ ! fi @mv $@.tmp $@ define do-subdir-for-command --- 284,291 ---- %.d : %.c @echo making $@ from $< @rm -f $@ ! @$(CC) -M $(CPPFLAGS) $(ALL_CFLAGS) $< | \ ! sed -e 's,$*\.o,pic/& & $@,g' > $@.tmp @mv $@.tmp $@ define do-subdir-for-command *************** *** 333,338 **** --- 324,330 ---- -e "s;%GCC_IEEE_FP_FLAG%;\"${GCC_IEEE_FP_FLAG}\";" \ -e "s;%LDFLAGS%;\"${LDFLAGS}\";" \ -e "s;%LIBFLAGS%;\"-L${libdir}\";" \ + -e "s;%RLD_FLAG%;\"-L${RLD_FLAG}\";" \ -e "s;%CXXLIBS%;\"${CXXLIBS}\";" \ -e "s;%TERMLIBS%;\"${TERMLIBS}\";" \ -e "s;%LIBS%;\"${LIBS}\";" \ diff -cNr octave-2.0.2/Makefile octave-2.0.3/Makefile *** octave-2.0.2/Makefile Wed Dec 31 18:00:00 1969 --- octave-2.0.3/Makefile Tue Feb 18 12:04:24 1997 *************** *** 0 **** --- 1,120 ---- + # Generated automatically from Makefile.in by configure. + # + # Makefile for octave's src directory + # + # John W. Eaton + # jwe@bevo.che.wisc.edu + # University of Wisconsin-Madison + # Department of Chemical Engineering + + TARGETS = octave-bug mkoctfile libcruft liboctave kpathsea info dlfcn \ + src scripts doc check octave.info INSTALL.OCTAVE BUGS \ + install uninstall tags TAGS dist conf-dist snapshot snapshot-version + + NO_DEP_TARGETS = clean mostlyclean distclean maintainer-clean + + all: header-msg config-check + $(MAKE) -f octMakefile all + + $(TARGETS): FORCE + $(MAKE) -f octMakefile $@ + + $(NO_DEP_TARGETS): FORCE + $(MAKE) -f octMakefile omit_deps=true $@ + + install-strip: + $(MAKE) -f octMakefile INSTALL_PROGRAM='${INSTALL} -s' install + + binary-dist: FORCE + @if test -f configure && test -f octMakefile.in ; then \ + ./configure --disable-shared --disable-dl --disable-shl ; \ + else \ + echo "" ; \ + echo "*** You must run make binary-dist in the source directory." ; \ + echo "" ; \ + exit 1 ; \ + fi + $(MAKE) -f octMakefile CFLAGS=-O CXXFLAGS=-O LDFLAGS=-static all + $(MAKE) -f octMakefile binary-dist + + # Maybe this message will prevent people from asking why the + # Makefiles don't work for them. Maybe not. + + header-msg: FORCE + @echo "" + @echo "**********************************************************" + @echo "* *" + @echo "* To compile Octave, you will need a recent version of *" + @echo "* GNU Make. *" + @echo "* *" + @echo "* You will also need g++ and libg++. *" + @echo "* *" + @echo "* This version of Octave has been developed with *" + @echo "* version 2.7.2. You probably won't get very far *" + @echo "* with earlier versions. Later versions may work, *" + @echo "* but C++ is still evolving, so don't be too surprised *" + @echo "* if you run into some trouble. *" + @echo "* *" + @echo "* Now would be a good time to read INSTALL.OCTAVE if *" + @echo "* you have not done so already. *" + @echo "* *" + @echo "**********************************************************" + @echo "" + + help: header-msg + @echo "" + @echo "For more information, please read the files INSTALL," + @echo "INSTALL.OCTAVE, and any other system-specific README" + @echo "files that apply (e.g., README.Linux)." + @echo "" + @echo "The following targets are available:" + @echo "" + @echo " all build everything" + @echo " check run self tests" + @echo " install install files" + @echo " install-strip same as install but strip binaries" + @echo " uninstall delete installed files" + @echo "" + @echo " dist create a source distribution" + @echo " conf-dist create a config files distribution" + @echo " binary-dist create a binary distribution" + @echo "" + @echo " clean remove files created by make all" + @echo " mostlyclean remove most files created by make all" + @echo " distclean remove all files not in distribution" + @echo " maintainer-clean clean up everything" + @echo "" + @echo " octave-bug create octave-bug script" + @echo " mkoctfile create mkoctfile script" + @echo " INSTALL.OCTAVE create INSTALL.OCTAVE doc file" + @echo " BUGS create BUGS doc file" + @echo " tags create tags files" + @echo " TAGS create TAGS files" + @echo "" + @echo " dlfcn make all in subdirectory dlfcn" + @echo " doc make all in subdirectory doc" + @echo " info make all in subdirectory info" + @echo " kpathsea make all in subdirectory kpathsea" + @echo " libcruft make all in subdirectory libcruft" + @echo " liboctave make all in subdirectory liboctave" + @echo " scripts make all in subdirectory scripts" + @echo " src make all in subdirectory src" + @echo "" + @echo " help print this message" + @echo "" + + config-check: + @if test -f octMakefile ; then \ + true ; \ + else \ + echo "" ; \ + echo "*** You must run configure before running make." ; \ + echo "***" ; \ + echo "*** Please read the INSTALL and INSTALL.OCTAVE files" ; \ + echo "*** for more information about how to configure and" ; \ + echo "*** compile Octave." ; \ + echo "" ; \ + exit 1 ; \ + fi + + FORCE: diff -cNr octave-2.0.2/Makefile.in octave-2.0.3/Makefile.in *** octave-2.0.2/Makefile.in Mon Jan 27 13:28:22 1997 --- octave-2.0.3/Makefile.in Fri Feb 14 14:21:49 1997 *************** *** 6,15 **** # University of Wisconsin-Madison # Department of Chemical Engineering # Maybe this message will prevent people from asking why the # Makefiles don't work for them. Maybe not. ! all: FORCE @echo "" @echo "**********************************************************" @echo "* *" --- 6,45 ---- # University of Wisconsin-Madison # Department of Chemical Engineering + TARGETS = octave-bug mkoctfile libcruft liboctave kpathsea info dlfcn \ + src scripts doc check octave.info INSTALL.OCTAVE BUGS \ + install uninstall tags TAGS dist conf-dist snapshot snapshot-version + + NO_DEP_TARGETS = clean mostlyclean distclean maintainer-clean + + all: header-msg config-check + $(MAKE) -f octMakefile all + + $(TARGETS): FORCE + $(MAKE) -f octMakefile $@ + + $(NO_DEP_TARGETS): FORCE + $(MAKE) -f octMakefile omit_deps=true $@ + + install-strip: + $(MAKE) -f octMakefile INSTALL_PROGRAM='${INSTALL} -s' install + + binary-dist: FORCE + @if test -f configure && test -f octMakefile.in ; then \ + ./configure --disable-shared --disable-dl --disable-shl ; \ + else \ + echo "" ; \ + echo "*** You must run make binary-dist in the source directory." ; \ + echo "" ; \ + exit 1 ; \ + fi + $(MAKE) -f octMakefile CFLAGS=-O CXXFLAGS=-O LDFLAGS=-static all + $(MAKE) -f octMakefile binary-dist + # Maybe this message will prevent people from asking why the # Makefiles don't work for them. Maybe not. ! header-msg: FORCE @echo "" @echo "**********************************************************" @echo "* *" *************** *** 29,70 **** @echo "* *" @echo "**********************************************************" @echo "" - $(MAKE) -f octMakefile all - - # plplot should go in TARGETS if we start distributing it. ! TARGETS = octave-bug mkoctfile libcruft liboctave kpathsea info dlfcn \ ! src scripts doc check octave.info INSTALL.OCTAVE BUGS \ ! install uninstall tags TAGS dist conf-dist snapshot snapshot-version ! ! NO_DEP_TARGETS = clean mostlyclean distclean maintainer-clean ! ! ALL_TARGETS = $(TARGETS) $(NO_DEP_TARGETS) ! ! $(TARGETS): FORCE ! $(MAKE) -f octMakefile $@ ! ! $(NO_DEP_TARGETS): FORCE ! $(MAKE) -f octMakefile omit_deps=true $@ ! ! binary-dist: FORCE ! @echo "***" ! @echo "*** you must specify either static or dynamic:" ! @echo "***" ! @echo "*** make dynamic-binary-dist" ! @echo "***" ! @echo "*** dynamically linked version typically including support" ! @echo "*** for shared libraried and dynamically linked functions" ! @echo "***" ! @echo "*** make static-binary-dist" ! @echo "***" ! @echo "*** statically linked version" ! @echo "***" ! ! static-binary-dist: ! $(MAKE) -f octMakefile DIST_TYPE=static binary-dist ! dynamic-binary-dist: ! $(MAKE) -f octMakefile DIST_TYPE=dynamic binary-dist ! FORCE: --- 59,119 ---- @echo "* *" @echo "**********************************************************" @echo "" ! help: header-msg ! @echo "" ! @echo "For more information, please read the files INSTALL," ! @echo "INSTALL.OCTAVE, and any other system-specific README" ! @echo "files that apply (e.g., README.Linux)." ! @echo "" ! @echo "The following targets are available:" ! @echo "" ! @echo " all build everything" ! @echo " check run self tests" ! @echo " install install files" ! @echo " install-strip same as install but strip binaries" ! @echo " uninstall delete installed files" ! @echo "" ! @echo " dist create a source distribution" ! @echo " conf-dist create a config files distribution" ! @echo " binary-dist create a binary distribution" ! @echo "" ! @echo " clean remove files created by make all" ! @echo " mostlyclean remove most files created by make all" ! @echo " distclean remove all files not in distribution" ! @echo " maintainer-clean clean up everything" ! @echo "" ! @echo " octave-bug create octave-bug script" ! @echo " mkoctfile create mkoctfile script" ! @echo " INSTALL.OCTAVE create INSTALL.OCTAVE doc file" ! @echo " BUGS create BUGS doc file" ! @echo " tags create tags files" ! @echo " TAGS create TAGS files" ! @echo "" ! @echo " dlfcn make all in subdirectory dlfcn" ! @echo " doc make all in subdirectory doc" ! @echo " info make all in subdirectory info" ! @echo " kpathsea make all in subdirectory kpathsea" ! @echo " libcruft make all in subdirectory libcruft" ! @echo " liboctave make all in subdirectory liboctave" ! @echo " scripts make all in subdirectory scripts" ! @echo " src make all in subdirectory src" ! @echo "" ! @echo " help print this message" ! @echo "" ! config-check: ! @if test -f octMakefile ; then \ ! true ; \ ! else \ ! echo "" ; \ ! echo "*** You must run configure before running make." ; \ ! echo "***" ; \ ! echo "*** Please read the INSTALL and INSTALL.OCTAVE files" ; \ ! echo "*** for more information about how to configure and" ; \ ! echo "*** compile Octave." ; \ ! echo "" ; \ ! exit 1 ; \ ! fi ! FORCE: diff -cNr octave-2.0.2/NEWS octave-2.0.3/NEWS *** octave-2.0.2/NEWS Mon Jan 27 15:51:08 1997 --- octave-2.0.3/NEWS Fri Feb 14 14:36:37 1997 *************** *** 1,3 **** --- 1,31 ---- + Summary of changes for version 2.0.3: + ------------------------------------ + + * The manual has been completely revised and now corresponds much + more closely to the features of the current version. + + * The return value for assignment expressions is now the RHS since + that is more consistent with the way other programming languages + work. However, Octave still prints the entire LHS value so that + + x = zeros (1, 2); + x(2) = 1 + + still prints + + x = + + 0 1 + + but an assignment like + + z = x(2) = 1 + + sets z to 1 (not [ 0, 1 ] as in previous versions of Octave). + + * It is now much easier to make binary distributions. See the + Binary Distributions section of the manual for more details. + Summary of changes for version 2.0.2: ------------------------------------ diff -cNr octave-2.0.2/README.Linux octave-2.0.3/README.Linux *** octave-2.0.2/README.Linux Wed Jan 22 10:44:28 1997 --- octave-2.0.3/README.Linux Sat Feb 8 15:57:51 1997 *************** *** 41,47 **** for the libraries. If it is not, please ask the maintainers of the libraries to clarify the documentation. ! Please note that I am NOT Octave won't even compile ------------------------- --- 41,58 ---- for the libraries. If it is not, please ask the maintainers of the libraries to clarify the documentation. ! Please note that I am NOT recommending that everyone running Linux and ! using Octave should install the same versions of the libraries and ! compilers that I have. I am simply saying that the versions listed ! above work for me. Other version combinations may also work, but I ! don't have time to map out all the possibilities... ! ! Craig Earls reports that the order of installing ! libc and lig++ is important. If libg++ is installed *first*, Octave ! will work, but if the libraries are installed in the reverse orfer, ! Octave fails. The conflict apparently arises because libc and libg++ ! shared libraries both use libio, however no one seems to be able to ! provide a clear explanation of exactly what is happening. Octave won't even compile ------------------------- *************** *** 54,60 **** bash$ cat foo.cc #include ! int main (void} { cerr << "yo\n"; return 0; } bash$ g++ -v foo.cc gcc -v foo.cc -lg++ -lstdc++ -lm --- 65,71 ---- bash$ cat foo.cc #include ! int main (void) { cerr << "yo\n"; return 0; } bash$ g++ -v foo.cc gcc -v foo.cc -lg++ -lstdc++ -lm *************** *** 149,152 **** University of Wisconsin-Madison Department of Chemical Engineering ! Wed Jan 15 20:04:54 1997 --- 160,163 ---- University of Wisconsin-Madison Department of Chemical Engineering ! Wed Jan 29 13:39:02 1997 diff -cNr octave-2.0.2/aclocal.m4 octave-2.0.3/aclocal.m4 *** octave-2.0.2/aclocal.m4 Sat Jan 25 23:15:17 1997 --- octave-2.0.3/aclocal.m4 Tue Jan 28 23:28:05 1997 *************** *** 126,132 **** fi dnl ld_run_path=`echo $foutput | \ ! sed -n -e 's/^.*\(LD_RUN_PATH *= *\([^ ]*\).*/\1/p'` dnl dnl We are only supposed to find this on Solaris systems, and this dnl substitution is probably only going to work with gcc on those --- 126,132 ---- fi dnl ld_run_path=`echo $foutput | \ ! sed -n -e 's/^.*LD_RUN_PATH *= *\([^ ]*\).*/\1/p'` dnl dnl We are only supposed to find this on Solaris systems, and this dnl substitution is probably only going to work with gcc on those *************** *** 154,160 **** 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 --- 154,160 ---- case "$old_want_arg" in '') case $arg in ! /*.a) exists=false for f in $lflags; do if test x$arg = x$f; then *************** *** 230,236 **** IFS=: list= for elt in $arg; do ! list="$list -L $elt" done IFS=$SAVE_IFS arg="$list" --- 230,236 ---- IFS=: list= for elt in $arg; do ! list="$list -L$elt" done IFS=$SAVE_IFS arg="$list" diff -cNr octave-2.0.2/configure octave-2.0.3/configure *** octave-2.0.2/configure Mon Jan 27 15:54:54 1997 --- octave-2.0.3/configure Tue Feb 18 09:41:50 1997 *************** *** 1,6 **** #! /bin/sh ! # From configure.in Revision: 1.251 --- 1,6 ---- #! /bin/sh ! # From configure.in Revision: 1.255 *************** *** 41,46 **** --- 41,48 ---- ac_help="$ac_help --enable-shared create shared libraries (not all systems)" ac_help="$ac_help + --enable-rpath add -rpath to link command for shared libraries" + ac_help="$ac_help --enable-lite-kernel compile smaller kernel (requires dynamic linking)" # Initialize some variables set by options. *************** *** 582,588 **** fi echo $ac_n "checking host system type""... $ac_c" 1>&6 ! echo "configure:586: checking host system type" >&5 host_alias=$host case "$host_alias" in --- 584,590 ---- fi echo $ac_n "checking host system type""... $ac_c" 1>&6 ! echo "configure:588: checking host system type" >&5 host_alias=$host case "$host_alias" in *************** *** 803,809 **** # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:807: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 805,811 ---- # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:809: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 834,840 **** echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:838: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. --- 836,842 ---- echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:840: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. *************** *** 844,854 **** cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then --- 846,856 ---- cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then *************** *** 874,885 **** { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:878: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ! echo "configure:883: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 876,887 ---- { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:880: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ! echo "configure:885: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 888,894 **** yes; #endif EOF ! if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no --- 890,896 ---- yes; #endif EOF ! if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no *************** *** 903,909 **** ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ! echo "configure:907: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 905,911 ---- ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ! echo "configure:909: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 931,937 **** fi echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 ! echo "configure:935: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 933,939 ---- fi echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 ! echo "configure:937: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 944,955 **** cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : --- 946,957 ---- cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : *************** *** 1024,1030 **** # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1028: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1026,1032 ---- # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1030: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1053,1059 **** # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1057: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1055,1061 ---- # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:1059: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1101,1107 **** fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:1105: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. --- 1103,1109 ---- fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:1107: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. *************** *** 1111,1121 **** cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then --- 1113,1123 ---- cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then *************** *** 1135,1146 **** { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:1139: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1144: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1137,1148 ---- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:1141: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:1146: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1149,1155 **** yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no --- 1151,1157 ---- yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no *************** *** 1164,1170 **** ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1168: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1166,1172 ---- ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:1170: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1192,1198 **** fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1196: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= --- 1194,1200 ---- fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1198: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= *************** *** 1207,1219 **** # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : --- 1209,1221 ---- # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : *************** *** 1224,1236 **** rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : --- 1226,1238 ---- rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : *************** *** 1254,1266 **** if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 ! echo "configure:1258: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP --- 1256,1268 ---- if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 ! echo "configure:1260: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP *************** *** 1278,1284 **** if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA --- 1280,1286 ---- if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA *************** *** 1407,1422 **** --- 1409,1444 ---- + use_rpath=true + # Check whether --enable-rpath or --disable-rpath was given. + if test "${enable_rpath+set}" = set; then + enableval="$enable_rpath" + if test $enableval = no; then use_rpath=false; fi + fi + + DLFCN_DIR= CPICFLAG=-fPIC CXXPICFLAG=-fPIC FPICFLAG=-fPIC SHLEXT=so + SH_LD="$CC" + SH_LDFLAGS=-shared + RLD_FLAG= case "$canonical_host_type" in + *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) + SH_LD=ld + SH_LDFLAGS=-Bshareable + ;; alpha-dec-osf*) CPICFLAG= CXXPICFLAG= FPICFLAG= + SH_LDFLAGS="-Xlinker -exepct_unresolved -Xlinker '*'" + RLD_FLAG='-Xlinker -rpath -Xlinker $(libdir)' + ;; + i[3456789]86-*-linux*) + RLD_FLAG='-Xlinker -rpath -Xlinker $(libdir)' ;; rs6000-ibm-aix* | powerpc-ibm-aix*) CPICFLAG= *************** *** 1431,1436 **** --- 1453,1459 ---- FPICFLAG=+Z fi SHLEXT=sl + RLD_FLAG='-Xlinker +b -Xlinker $(libdir)' ;; *-sgi-*) if $use_g77; then *************** *** 1438,1443 **** --- 1461,1467 ---- else FPICFLAG=-KPIC fi + RLD_FLAG='-L$(libdir)' ;; sparc-sun-sunos4*) if $use_g77; then *************** *** 1452,1464 **** --- 1476,1502 ---- else FPICFLAG=-PIC fi + RLD_FLAG='-Xlinker -R -Xlinker $(libdir)' ;; esac + + if $use_rpath; then + true + else + RLD_FLAG= + fi + echo "$ac_t""defining FPICFLAG to be $FPICFLAG" 1>&6 echo "$ac_t""defining CPICFLAG to be $CPICFLAG" 1>&6 echo "$ac_t""defining CXXPICFLAG to be $CXXPICFLAG" 1>&6 echo "$ac_t""defining SHLEXT to be $SHLEXT" 1>&6 echo "$ac_t""defining DLFCN_DIR to be $DLFCN_DIR" 1>&6 + echo "$ac_t""defining SH_LD to be $SH_LD" 1>&6 + echo "$ac_t""defining SH_LDFLAGS to be $SH_LDFLAGS" 1>&6 + echo "$ac_t""defining RLD_FLAG to be $RLD_FLAG" 1>&6 + + + *************** *** 1490,1496 **** ### functions like gethostname and gettimeofday is in libsocket. echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 ! echo "configure:1494: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then --- 1528,1534 ---- ### functions like gethostname and gettimeofday is in libsocket. echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 ! echo "configure:1532: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then *************** *** 1512,1528 **** ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 ! echo "configure:1516: checking for minix/config.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* --- 1550,1566 ---- ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 ! echo "configure:1554: checking for minix/config.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1564: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* *************** *** 1560,1568 **** fi echo $ac_n "checking for AIX""... $ac_c" 1>&6 ! echo "configure:1564: checking for AIX" >&5 cat > conftest.$ac_ext <&6 ! echo "configure:1602: checking for AIX" >&5 cat > conftest.$ac_ext <&6 ! echo "configure:1588: checking for getpwnam in -lsun" >&5 ac_lib_var=`echo sun'_'getpwnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1622,1628 ---- echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6 ! echo "configure:1626: checking for getpwnam in -lsun" >&5 ac_lib_var=`echo sun'_'getpwnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1592,1598 **** ac_save_LIBS="$LIBS" LIBS="-lsun $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1641,1647 ---- getpwnam() ; return 0; } EOF ! if { (eval echo configure:1645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 1631,1637 **** fi echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6 ! echo "configure:1635: checking for gethostname in -lsocket" >&5 ac_lib_var=`echo socket'_'gethostname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1669,1675 ---- fi echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6 ! echo "configure:1673: checking for gethostname in -lsocket" >&5 ac_lib_var=`echo socket'_'gethostname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1639,1645 **** ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1688,1694 ---- gethostname() ; return 0; } EOF ! if { (eval echo configure:1692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 1682,1688 **** ### be eliminated in favor of run-time checks. echo $ac_n "checking size of short""... $ac_c" 1>&6 ! echo "configure:1686: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1720,1726 ---- ### be eliminated in favor of run-time checks. echo $ac_n "checking size of short""... $ac_c" 1>&6 ! echo "configure:1724: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1690,1696 **** { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() --- 1728,1734 ---- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() *************** *** 1701,1707 **** exit(0); } EOF ! if { (eval echo configure:1705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else --- 1739,1745 ---- exit(0); } EOF ! if { (eval echo configure:1743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else *************** *** 1721,1727 **** echo $ac_n "checking size of int""... $ac_c" 1>&6 ! echo "configure:1725: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1759,1765 ---- echo $ac_n "checking size of int""... $ac_c" 1>&6 ! echo "configure:1763: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1729,1735 **** { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() --- 1767,1773 ---- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() *************** *** 1740,1746 **** exit(0); } EOF ! if { (eval echo configure:1744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else --- 1778,1784 ---- exit(0); } EOF ! if { (eval echo configure:1782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else *************** *** 1760,1766 **** echo $ac_n "checking size of long""... $ac_c" 1>&6 ! echo "configure:1764: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1798,1804 ---- echo $ac_n "checking size of long""... $ac_c" 1>&6 ! echo "configure:1802: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1768,1774 **** { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() --- 1806,1812 ---- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() *************** *** 1779,1785 **** exit(0); } EOF ! if { (eval echo configure:1783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else --- 1817,1823 ---- exit(0); } EOF ! if { (eval echo configure:1821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else *************** *** 1804,1822 **** # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ! echo "configure:1808: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF ! if { (eval echo configure:1820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else --- 1842,1860 ---- # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ! echo "configure:1846: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF ! if { (eval echo configure:1858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else *************** *** 1837,1848 **** fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 ! echo "configure:1841: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1879: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else --- 1903,1909 ---- char *p = (char *) alloca(1); ; return 0; } EOF ! if { (eval echo configure:1907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else *************** *** 1897,1908 **** echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 ! echo "configure:1901: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1939: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1931: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1969: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 1993,1999 ---- ; return 0; } EOF ! if { (eval echo configure:1997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 1982,1988 **** fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:1986: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2020,2026 ---- fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:2024: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1990,1996 **** ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else --- 2047,2053 ---- exit (find_stack_direction() < 0); } EOF ! if { (eval echo configure:2051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else *************** *** 2031,2042 **** fi echo $ac_n "checking for working const""... $ac_c" 1>&6 ! echo "configure:2035: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2073: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else --- 2123,2129 ---- ; return 0; } EOF ! if { (eval echo configure:2127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else *************** *** 2111,2117 **** echo $ac_n "checking for C++ libraries""... $ac_c" 1>&6 ! echo "configure:2115: checking for C++ libraries" >&5 if eval "test \"`echo '$''{'octave_cv_cxxlibs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2149,2155 ---- echo $ac_n "checking for C++ libraries""... $ac_c" 1>&6 ! echo "configure:2153: checking for C++ libraries" >&5 if eval "test \"`echo '$''{'octave_cv_cxxlibs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 2127,2140 **** CXXFLAGS="$XCXXFLAGS -v" export CXXFLAGS coutput=`( cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else echo "configure: failed program was:" >&5 --- 2165,2178 ---- CXXFLAGS="$XCXXFLAGS -v" export CXXFLAGS coutput=`( cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else echo "configure: failed program was:" >&5 *************** *** 2208,2214 **** ### See if we should define NPOS. echo $ac_n "checking whether including defines NPOS""... $ac_c" 1>&6 ! echo "configure:2212: checking whether including defines NPOS" >&5 if eval "test \"`echo '$''{'octave_cv_string_npos'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2246,2252 ---- ### See if we should define NPOS. echo $ac_n "checking whether including defines NPOS""... $ac_c" 1>&6 ! echo "configure:2250: checking whether including defines NPOS" >&5 if eval "test \"`echo '$''{'octave_cv_string_npos'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 2221,2234 **** cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { size_t foo = NPOS ; return 0; } EOF ! if { (eval echo configure:2232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* octave_cv_string_npos=yes else --- 2259,2272 ---- cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { size_t foo = NPOS ; return 0; } EOF ! if { (eval echo configure:2270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* octave_cv_string_npos=yes else *************** *** 2271,2277 **** # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2275: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2309,2315 ---- # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2313: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 2345,2351 **** # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2349: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_F77'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2383,2389 ---- # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2387: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_F77'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 2380,2386 **** if $use_g77; then echo $ac_n "checking for Fortran libraries""... $ac_c" 1>&6 ! echo "configure:2384: checking for Fortran libraries" >&5 if eval "test \"`echo '$''{'octave_cv_flibs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2418,2424 ---- if $use_g77; then echo $ac_n "checking for Fortran libraries""... $ac_c" 1>&6 ! echo "configure:2422: checking for Fortran libraries" >&5 if eval "test \"`echo '$''{'octave_cv_flibs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 2391,2397 **** foutput=`echo $foutput | sed 's/,/ /g'` fi ld_run_path=`echo $foutput | \ ! sed -n -e 's/^.*\(LD_RUN_PATH *= *\([^ ]*\).*/\1/p'` if test -n "$ld_run_path"; then if test "$ac_cv_prog_gcc" = yes; then ld_run_path="-Xlinker -R -Xlinker $ld_run_path" --- 2429,2435 ---- foutput=`echo $foutput | sed 's/,/ /g'` fi ld_run_path=`echo $foutput | \ ! sed -n -e 's/^.*LD_RUN_PATH *= *\([^ ]*\).*/\1/p'` if test -n "$ld_run_path"; then if test "$ac_cv_prog_gcc" = yes; then ld_run_path="-Xlinker -R -Xlinker $ld_run_path" *************** *** 2408,2414 **** 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 --- 2446,2452 ---- case "$old_want_arg" in '') case $arg in ! /*.a) exists=false for f in $lflags; do if test x$arg = x$f; then *************** *** 2479,2485 **** IFS=: list= for elt in $arg; do ! list="$list -L $elt" done IFS=$SAVE_IFS arg="$list" --- 2517,2523 ---- IFS=: list= for elt in $arg; do ! list="$list -L$elt" done IFS=$SAVE_IFS arg="$list" *************** *** 2510,2516 **** else if test -n "$F77"; then echo $ac_n "checking for Fortran libraries""... $ac_c" 1>&6 ! echo "configure:2514: checking for Fortran libraries" >&5 if eval "test \"`echo '$''{'octave_cv_flibs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2548,2554 ---- else if test -n "$F77"; then echo $ac_n "checking for Fortran libraries""... $ac_c" 1>&6 ! echo "configure:2552: checking for Fortran libraries" >&5 if eval "test \"`echo '$''{'octave_cv_flibs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 2521,2527 **** foutput=`echo $foutput | sed 's/,/ /g'` fi ld_run_path=`echo $foutput | \ ! sed -n -e 's/^.*\(LD_RUN_PATH *= *\([^ ]*\).*/\1/p'` if test -n "$ld_run_path"; then if test "$ac_cv_prog_gcc" = yes; then ld_run_path="-Xlinker -R -Xlinker $ld_run_path" --- 2559,2565 ---- foutput=`echo $foutput | sed 's/,/ /g'` fi ld_run_path=`echo $foutput | \ ! sed -n -e 's/^.*LD_RUN_PATH *= *\([^ ]*\).*/\1/p'` if test -n "$ld_run_path"; then if test "$ac_cv_prog_gcc" = yes; then ld_run_path="-Xlinker -R -Xlinker $ld_run_path" *************** *** 2538,2544 **** 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 --- 2576,2582 ---- case "$old_want_arg" in '') case $arg in ! /*.a) exists=false for f in $lflags; do if test x$arg = x$f; then *************** *** 2609,2615 **** IFS=: list= for elt in $arg; do ! list="$list -L $elt" done IFS=$SAVE_IFS arg="$list" --- 2647,2653 ---- IFS=: list= for elt in $arg; do ! list="$list -L$elt" done IFS=$SAVE_IFS arg="$list" *************** *** 2630,2636 **** FLIBS="$octave_cv_flibs" echo "$ac_t""$FLIBS" 1>&6 echo $ac_n "checking whether $F77 uses uppercase external names""... $ac_c" 1>&6 ! echo "configure:2634: checking whether $F77 uses uppercase external names" >&5 if eval "test \"`echo '$''{'octave_cv_f77_uppercase_names'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2668,2674 ---- FLIBS="$octave_cv_flibs" echo "$ac_t""$FLIBS" 1>&6 echo $ac_n "checking whether $F77 uses uppercase external names""... $ac_c" 1>&6 ! echo "configure:2672: checking whether $F77 uses uppercase external names" >&5 if eval "test \"`echo '$''{'octave_cv_f77_uppercase_names'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 2655,2661 **** fi echo $ac_n "checking whether $F77 appends underscores to external names""... $ac_c" 1>&6 ! echo "configure:2659: checking whether $F77 appends underscores to external names" >&5 if eval "test \"`echo '$''{'octave_cv_f77_append_underscore'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2693,2699 ---- fi echo $ac_n "checking whether $F77 appends underscores to external names""... $ac_c" 1>&6 ! echo "configure:2697: checking whether $F77 appends underscores to external names" >&5 if eval "test \"`echo '$''{'octave_cv_f77_append_underscore'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2689,2695 **** echo $ac_n "checking $F77/f2c compatibility""... $ac_c" 1>&6 ! echo "configure:2693: checking $F77/f2c compatibility" >&5 if eval "test \"`echo '$''{'octave_cv_f2c_f77_compat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2727,2733 ---- echo $ac_n "checking $F77/f2c compatibility""... $ac_c" 1>&6 ! echo "configure:2731: checking $F77/f2c compatibility" >&5 if eval "test \"`echo '$''{'octave_cv_f2c_f77_compat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 2771,2777 **** # Extract the first word of "f2c", so it can be a program name with args. set dummy f2c; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2775: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_F2C'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 2809,2815 ---- # Extract the first word of "f2c", so it can be a program name with args. set dummy f2c; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:2813: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_F2C'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 2835,2841 **** oct_conflib=libconflib.a oct_obj_ext=o ! if { (eval echo configure:2839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then $AR $ARFLAGS $oct_conflib conftest.$oct_obj_ext 1>&5 if test -n "$RANLIB"; then $RANLIB $oct_conflib 1>&5 --- 2873,2879 ---- oct_conflib=libconflib.a oct_obj_ext=o ! if { (eval echo configure:2877: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then $AR $ARFLAGS $oct_conflib conftest.$oct_obj_ext 1>&5 if test -n "$RANLIB"; then $RANLIB $oct_conflib 1>&5 *************** *** 2843,2849 **** fi rm -f conftest* echo $ac_n "checking for f_open in -lf2c""... $ac_c" 1>&6 ! echo "configure:2847: checking for f_open in -lf2c" >&5 ac_lib_var=`echo f2c'_'f_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2881,2887 ---- fi rm -f conftest* echo $ac_n "checking for f_open in -lf2c""... $ac_c" 1>&6 ! echo "configure:2885: checking for f_open in -lf2c" >&5 ac_lib_var=`echo f2c'_'f_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2851,2857 **** ac_save_LIBS="$LIBS" LIBS="-lf2c -L. -lconflib -lm $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 2900,2906 ---- f_open() ; return 0; } EOF ! if { (eval echo configure:2904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 2887,2893 **** if test -z "$FLIBS"; then echo $ac_n "checking for d_sin in -lF77""... $ac_c" 1>&6 ! echo "configure:2891: checking for d_sin in -lF77" >&5 ac_lib_var=`echo F77'_'d_sin | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2925,2931 ---- if test -z "$FLIBS"; then echo $ac_n "checking for d_sin in -lF77""... $ac_c" 1>&6 ! echo "configure:2929: checking for d_sin in -lF77" >&5 ac_lib_var=`echo F77'_'d_sin | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2895,2901 **** ac_save_LIBS="$LIBS" LIBS="-lF77 -lm $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 2944,2950 ---- d_sin() ; return 0; } EOF ! if { (eval echo configure:2948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 2929,2935 **** if test -n "$FLIBS"; then echo $ac_n "checking for f_rew in -lI77""... $ac_c" 1>&6 ! echo "configure:2933: checking for f_rew in -lI77" >&5 ac_lib_var=`echo I77'_'f_rew | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2967,2973 ---- if test -n "$FLIBS"; then echo $ac_n "checking for f_rew in -lI77""... $ac_c" 1>&6 ! echo "configure:2971: checking for f_rew in -lI77" >&5 ac_lib_var=`echo I77'_'f_rew | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2937,2943 **** ac_save_LIBS="$LIBS" LIBS="-lI77 -lF77 $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 2986,2992 ---- f_rew() ; return 0; } EOF ! if { (eval echo configure:2990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 3013,3024 **** ### Checks for header files. echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:3017: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 3051,3062 ---- ### Checks for header files. echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:3055: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 3026,3032 **** #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* --- 3064,3070 ---- #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3068: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* *************** *** 3043,3049 **** if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF --- 3081,3087 ---- if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF *************** *** 3061,3067 **** if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF --- 3099,3105 ---- if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF *************** *** 3082,3088 **** : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') --- 3120,3126 ---- : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') *************** *** 3093,3099 **** exit (0); } EOF ! if { (eval echo configure:3097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else --- 3131,3137 ---- exit (0); } EOF ! if { (eval echo configure:3135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else *************** *** 3121,3132 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:3125: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> --- 3159,3170 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:3163: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> *************** *** 3134,3140 **** DIR *dirp = 0; ; return 0; } EOF ! if { (eval echo configure:3138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else --- 3172,3178 ---- DIR *dirp = 0; ; return 0; } EOF ! if { (eval echo configure:3176: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else *************** *** 3159,3165 **** # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:3163: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 3197,3203 ---- # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:3201: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 3167,3173 **** ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 3216,3222 ---- opendir() ; return 0; } EOF ! if { (eval echo configure:3220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 3200,3206 **** else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:3204: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 3238,3244 ---- else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:3242: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 3208,3214 **** ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 3257,3263 ---- opendir() ; return 0; } EOF ! if { (eval echo configure:3261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 3242,3253 **** fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 ! echo "configure:3246: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 3280,3291 ---- fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 ! echo "configure:3284: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 3256,3262 **** struct tm *tp; ; return 0; } EOF ! if { (eval echo configure:3260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else --- 3294,3300 ---- struct tm *tp; ; return 0; } EOF ! if { (eval echo configure:3298: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else *************** *** 3277,3288 **** fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 ! echo "configure:3281: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 3315,3326 ---- fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 ! echo "configure:3319: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 3298,3304 **** s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF ! if { (eval echo configure:3302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else --- 3336,3342 ---- s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF ! if { (eval echo configure:3340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else *************** *** 3327,3343 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:3331: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* --- 3365,3381 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:3369: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:3379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* *************** *** 3375,3381 **** ### See if the optional nonlinear programming code is present. echo $ac_n "checking for npsol""... $ac_c" 1>&6 ! echo "configure:3379: checking for npsol" >&5 if test -f $srcdir/libcruft/npsol/npsol.f; then echo "$ac_t""yes" 1>&6 else --- 3413,3419 ---- ### See if the optional nonlinear programming code is present. echo $ac_n "checking for npsol""... $ac_c" 1>&6 ! echo "configure:3417: checking for npsol" >&5 if test -f $srcdir/libcruft/npsol/npsol.f; then echo "$ac_t""yes" 1>&6 else *************** *** 3387,3393 **** fi echo $ac_n "checking for qpsol""... $ac_c" 1>&6 ! echo "configure:3391: checking for qpsol" >&5 if test -f $srcdir/libcruft/qpsol/qpsol.f; then echo "$ac_t""yes" 1>&6 else --- 3425,3431 ---- fi echo $ac_n "checking for qpsol""... $ac_c" 1>&6 ! echo "configure:3429: checking for qpsol" >&5 if test -f $srcdir/libcruft/qpsol/qpsol.f; then echo "$ac_t""yes" 1>&6 else *************** *** 3399,3405 **** fi echo $ac_n "checking for fsqp""... $ac_c" 1>&6 ! echo "configure:3403: checking for fsqp" >&5 if test -f $srcdir/libcruft/fsqp/fsqpd.f; then echo "$ac_t""yes" 1>&6 else --- 3437,3443 ---- fi echo $ac_n "checking for fsqp""... $ac_c" 1>&6 ! echo "configure:3441: checking for fsqp" >&5 if test -f $srcdir/libcruft/fsqp/fsqpd.f; then echo "$ac_t""yes" 1>&6 else *************** *** 3421,3432 **** strnicmp tempnam umask unlink usleep vfprintf vsprintf waitpid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3425: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:3463: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 3487,3493 ---- ; return 0; } EOF ! if { (eval echo configure:3491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 3475,3481 **** echo $ac_n "checking whether putenv uses malloc""... $ac_c" 1>&6 ! echo "configure:3479: checking whether putenv uses malloc" >&5 if eval "test \"`echo '$''{'octave_cv_func_putenv_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 3513,3519 ---- echo $ac_n "checking whether putenv uses malloc""... $ac_c" 1>&6 ! echo "configure:3517: checking whether putenv uses malloc" >&5 if eval "test \"`echo '$''{'octave_cv_func_putenv_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 3483,3489 **** octave_cv_func_putenv_malloc=no else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then octave_cv_func_putenv_malloc=yes else --- 3574,3580 ---- exit (rstr1 == rstr2 ? 0 : 1); } EOF ! if { (eval echo configure:3578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then octave_cv_func_putenv_malloc=yes else *************** *** 3557,3575 **** fi echo $ac_n "checking whether program_invocation_name is predefined""... $ac_c" 1>&6 ! echo "configure:3561: checking whether program_invocation_name is predefined" >&5 if eval "test \"`echo '$''{'octave_cv_var_program_inv_name'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* octave_cv_var_program_inv_name=yes else --- 3595,3613 ---- fi echo $ac_n "checking whether program_invocation_name is predefined""... $ac_c" 1>&6 ! echo "configure:3599: checking whether program_invocation_name is predefined" >&5 if eval "test \"`echo '$''{'octave_cv_var_program_inv_name'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* octave_cv_var_program_inv_name=yes else *************** *** 3599,3605 **** ;; *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 ! echo "configure:3603: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 3637,3643 ---- ;; *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 ! echo "configure:3641: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 3607,3613 **** ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 3656,3662 ---- dlopen() ; return 0; } EOF ! if { (eval echo configure:3660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 3648,3659 **** for ac_func in dlopen dlsym dlerror dlclose do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3652: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:3690: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 3714,3720 ---- ; return 0; } EOF ! if { (eval echo configure:3718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 3728,3734 **** if test "$WITH_SHL" = yes || test "$WITH_SHL" = maybe; then echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 ! echo "configure:3732: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 3766,3772 ---- if test "$WITH_SHL" = yes || test "$WITH_SHL" = maybe; then echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 ! echo "configure:3770: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 3736,3742 **** ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 3785,3791 ---- shl_load() ; return 0; } EOF ! if { (eval echo configure:3789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 3777,3788 **** for ac_func in shl_load shl_findsym do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:3781: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:3819: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 3843,3849 ---- ; return 0; } EOF ! if { (eval echo configure:3847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 3867,3878 **** ### which one (if any) appears in sys/time.h. echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6 ! echo "configure:3871: checking for gettimeofday" >&5 if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:3909: checking for gettimeofday" >&5 if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gettimeofday=yes" else --- 3933,3939 ---- ; return 0; } EOF ! if { (eval echo configure:3937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gettimeofday=yes" else *************** *** 3910,3923 **** if eval "test \"`echo '$ac_cv_func_'gettimeofday`\" = yes"; then echo "$ac_t""yes" 1>&6 cat > conftest.$ac_ext < int main() { gettimeofday ((struct timeval *) 0,(struct timezone *) 0); ; return 0; } EOF ! if { (eval echo configure:3921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 --- 3948,3961 ---- if eval "test \"`echo '$ac_cv_func_'gettimeofday`\" = yes"; then echo "$ac_t""yes" 1>&6 cat > conftest.$ac_ext < int main() { gettimeofday ((struct timeval *) 0,(struct timezone *) 0); ; return 0; } EOF ! if { (eval echo configure:3959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 *************** *** 3945,3951 **** ### with functions from the BSD/NET2 math library. echo $ac_n "checking for quiet_nan in -lsunmath""... $ac_c" 1>&6 ! echo "configure:3949: checking for quiet_nan in -lsunmath" >&5 ac_lib_var=`echo sunmath'_'quiet_nan | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 3983,3989 ---- ### with functions from the BSD/NET2 math library. echo $ac_n "checking for quiet_nan in -lsunmath""... $ac_c" 1>&6 ! echo "configure:3987: checking for quiet_nan in -lsunmath" >&5 ac_lib_var=`echo sunmath'_'quiet_nan | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 3953,3959 **** ac_save_LIBS="$LIBS" LIBS="-lsunmath -lm $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 4002,4008 ---- quiet_nan() ; return 0; } EOF ! if { (eval echo configure:4006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 3996,4002 **** case "$canonical_host_type" in *-*-linux*) echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 ! echo "configure:4000: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 4034,4040 ---- case "$canonical_host_type" in *-*-linux*) echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 ! echo "configure:4038: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 4004,4010 **** ac_save_LIBS="$LIBS" LIBS="-lm -lc $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 4053,4059 ---- sin() ; return 0; } EOF ! if { (eval echo configure:4057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 4045,4051 **** ;; *) echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 ! echo "configure:4049: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 4083,4089 ---- ;; *) echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 ! echo "configure:4087: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 4053,4059 **** ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 4102,4108 ---- sin() ; return 0; } EOF ! if { (eval echo configure:4106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 4125,4136 **** for ac_func in finite isnan isinf infinity quiet_nan do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:4129: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:4167: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 4191,4197 ---- ; return 0; } EOF ! if { (eval echo configure:4195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 4185,4196 **** for ac_func in acosh asinh atanh erf erfc do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:4189: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:4227: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 4251,4257 ---- ; return 0; } EOF ! if { (eval echo configure:4255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 4243,4254 **** ### Checks for OS specific cruft. echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 ! echo "configure:4247: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 4281,4292 ---- ### Checks for OS specific cruft. echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 ! echo "configure:4285: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 4256,4262 **** struct stat s; s.st_blksize; ; return 0; } EOF ! if { (eval echo configure:4260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else --- 4294,4300 ---- struct stat s; s.st_blksize; ; return 0; } EOF ! if { (eval echo configure:4298: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else *************** *** 4277,4288 **** fi echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 ! echo "configure:4281: checking for st_blocks in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 4315,4326 ---- fi echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 ! echo "configure:4319: checking for st_blocks in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 4290,4296 **** struct stat s; s.st_blocks; ; return 0; } EOF ! if { (eval echo configure:4294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blocks=yes else --- 4328,4334 ---- struct stat s; s.st_blocks; ; return 0; } EOF ! if { (eval echo configure:4332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blocks=yes else *************** *** 4313,4324 **** fi echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 ! echo "configure:4317: checking for st_rdev in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 4351,4362 ---- fi echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 ! echo "configure:4355: checking for st_rdev in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 4326,4332 **** struct stat s; s.st_rdev; ; return 0; } EOF ! if { (eval echo configure:4330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else --- 4364,4370 ---- struct stat s; s.st_rdev; ; return 0; } EOF ! if { (eval echo configure:4368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else *************** *** 4347,4358 **** fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 ! echo "configure:4351: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 4385,4396 ---- fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 ! echo "configure:4389: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 4360,4366 **** struct tm *tp; tp->tm_sec; ; return 0; } EOF ! if { (eval echo configure:4364: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else --- 4398,4404 ---- struct tm *tp; tp->tm_sec; ; return 0; } EOF ! if { (eval echo configure:4402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else *************** *** 4381,4392 **** fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 ! echo "configure:4385: checking for tm_zone in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> --- 4419,4430 ---- fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 ! echo "configure:4423: checking for tm_zone in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> *************** *** 4394,4400 **** struct tm tm; tm.tm_zone; ; return 0; } EOF ! if { (eval echo configure:4398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else --- 4432,4438 ---- struct tm tm; tm.tm_zone; ; return 0; } EOF ! if { (eval echo configure:4436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else *************** *** 4414,4425 **** else echo $ac_n "checking for tzname""... $ac_c" 1>&6 ! echo "configure:4418: checking for tzname" >&5 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ --- 4452,4463 ---- else echo $ac_n "checking for tzname""... $ac_c" 1>&6 ! echo "configure:4456: checking for tzname" >&5 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ *************** *** 4429,4435 **** atoi(*tzname); ; return 0; } EOF ! if { (eval echo configure:4433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_var_tzname=yes else --- 4467,4473 ---- atoi(*tzname); ; return 0; } EOF ! if { (eval echo configure:4471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_var_tzname=yes else *************** *** 4451,4457 **** fi echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6 ! echo "configure:4455: checking whether closedir returns void" >&5 if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 4489,4495 ---- fi echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6 ! echo "configure:4493: checking whether closedir returns void" >&5 if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 4459,4471 **** ac_cv_func_closedir_void=yes else cat > conftest.$ac_ext < #include <$ac_header_dirent> int closedir(); main() { exit(closedir(opendir(".")) != 0); } EOF ! if { (eval echo configure:4469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_closedir_void=no else --- 4497,4509 ---- ac_cv_func_closedir_void=yes else cat > conftest.$ac_ext < #include <$ac_header_dirent> int closedir(); main() { exit(closedir(opendir(".")) != 0); } EOF ! if { (eval echo configure:4507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_closedir_void=no else *************** *** 4489,4500 **** echo $ac_n "checking for gr_passwd in struct group""... $ac_c" 1>&6 ! echo "configure:4493: checking for gr_passwd in struct group" >&5 if eval "test \"`echo '$''{'octave_cv_struct_gr_passwd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 4527,4538 ---- echo $ac_n "checking for gr_passwd in struct group""... $ac_c" 1>&6 ! echo "configure:4531: checking for gr_passwd in struct group" >&5 if eval "test \"`echo '$''{'octave_cv_struct_gr_passwd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 4502,4508 **** struct group s; s.gr_passwd; ; return 0; } EOF ! if { (eval echo configure:4506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* octave_cv_struct_gr_passwd=yes else --- 4540,4546 ---- struct group s; s.gr_passwd; ; return 0; } EOF ! if { (eval echo configure:4544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* octave_cv_struct_gr_passwd=yes else *************** *** 4526,4532 **** TERMLIBS="" for termlib in ncurses curses termcap terminfo termlib; do echo $ac_n "checking for tputs in -l${termlib}""... $ac_c" 1>&6 ! echo "configure:4530: checking for tputs in -l${termlib}" >&5 ac_lib_var=`echo ${termlib}'_'tputs | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 4564,4570 ---- TERMLIBS="" for termlib in ncurses curses termcap terminfo termlib; do echo $ac_n "checking for tputs in -l${termlib}""... $ac_c" 1>&6 ! echo "configure:4568: checking for tputs in -l${termlib}" >&5 ac_lib_var=`echo ${termlib}'_'tputs | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 4534,4540 **** ac_save_LIBS="$LIBS" LIBS="-l${termlib} $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 4583,4589 ---- tputs() ; return 0; } EOF ! if { (eval echo configure:4587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 4585,4600 **** fi echo $ac_n "checking for struct exception in math.h""... $ac_c" 1>&6 ! echo "configure:4589: checking for struct exception in math.h" >&5 cat > conftest.$ac_ext < int main() { struct exception *x; x->type; x->name; ; return 0; } EOF ! if { (eval echo configure:4598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF --- 4623,4638 ---- fi echo $ac_n "checking for struct exception in math.h""... $ac_c" 1>&6 ! echo "configure:4627: checking for struct exception in math.h" >&5 cat > conftest.$ac_ext < int main() { struct exception *x; x->type; x->name; ; return 0; } EOF ! if { (eval echo configure:4636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF *************** *** 4612,4623 **** ### Signal stuff. echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:4616: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 4650,4661 ---- ### Signal stuff. echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:4654: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 4634,4640 **** int i; ; return 0; } EOF ! if { (eval echo configure:4638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else --- 4672,4678 ---- int i; ; return 0; } EOF ! if { (eval echo configure:4676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else *************** *** 4653,4664 **** echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 ! echo "configure:4657: checking for sys_siglist declaration in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 4691,4702 ---- echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6 ! echo "configure:4695: checking for sys_siglist declaration in signal.h or unistd.h" >&5 if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 4670,4676 **** char *msg = *(sys_siglist + 1); ; return 0; } EOF ! if { (eval echo configure:4674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else --- 4708,4714 ---- char *msg = *(sys_siglist + 1); ; return 0; } EOF ! if { (eval echo configure:4712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_decl_sys_siglist=yes else *************** *** 4691,4706 **** fi echo $ac_n "checking for sys_siglist variable""... $ac_c" 1>&6 ! echo "configure:4695: checking for sys_siglist variable" >&5 cat > conftest.$ac_ext < int main() { extern char *sys_siglist[]; printf ("%s\n", sys_siglist[1]); ; return 0; } EOF ! if { (eval echo configure:4704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF --- 4729,4744 ---- fi echo $ac_n "checking for sys_siglist variable""... $ac_c" 1>&6 ! echo "configure:4733: checking for sys_siglist variable" >&5 cat > conftest.$ac_ext < int main() { extern char *sys_siglist[]; printf ("%s\n", sys_siglist[1]); ; return 0; } EOF ! if { (eval echo configure:4742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF *************** *** 4716,4728 **** rm -f conftest* echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6 ! echo "configure:4720: checking for type of signal functions" >&5 if eval "test \"`echo '$''{'octave_cv_signal_vintage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { --- 4754,4766 ---- rm -f conftest* echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6 ! echo "configure:4758: checking for type of signal functions" >&5 if eval "test \"`echo '$''{'octave_cv_signal_vintage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { *************** *** 4735,4741 **** ; return 0; } EOF ! if { (eval echo configure:4739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* octave_cv_signal_vintage=posix else --- 4773,4779 ---- ; return 0; } EOF ! if { (eval echo configure:4777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* octave_cv_signal_vintage=posix else *************** *** 4744,4750 **** rm -rf conftest* cat > conftest.$ac_ext < int main() { --- 4782,4788 ---- rm -rf conftest* cat > conftest.$ac_ext < int main() { *************** *** 4754,4760 **** ; return 0; } EOF ! if { (eval echo configure:4758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* octave_cv_signal_vintage=4.2bsd else --- 4792,4798 ---- ; return 0; } EOF ! if { (eval echo configure:4796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* octave_cv_signal_vintage=4.2bsd else *************** *** 4763,4769 **** rm -rf conftest* cat > conftest.$ac_ext < --- 4801,4807 ---- rm -rf conftest* cat > conftest.$ac_ext < *************** *** 4776,4782 **** ; return 0; } EOF ! if { (eval echo configure:4780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* octave_cv_signal_vintage=svr3 else --- 4814,4820 ---- ; return 0; } EOF ! if { (eval echo configure:4818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* octave_cv_signal_vintage=svr3 else *************** *** 4817,4823 **** echo $ac_n "checking if signal handlers must be reinstalled when invoked""... $ac_c" 1>&6 ! echo "configure:4821: checking if signal handlers must be reinstalled when invoked" >&5 if eval "test \"`echo '$''{'octave_cv_must_reinstall_sighandlers'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 4855,4861 ---- echo $ac_n "checking if signal handlers must be reinstalled when invoked""... $ac_c" 1>&6 ! echo "configure:4859: checking if signal handlers must be reinstalled when invoked" >&5 if eval "test \"`echo '$''{'octave_cv_must_reinstall_sighandlers'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 4825,4831 **** { echo "configure: error: cannot check signal handling if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < --- 4863,4869 ---- { echo "configure: error: cannot check signal handling if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < *************** *** 4867,4873 **** } EOF ! if { (eval echo configure:4871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then octave_cv_must_reinstall_sighandlers=no else --- 4905,4911 ---- } EOF ! if { (eval echo configure:4909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then octave_cv_must_reinstall_sighandlers=no else *************** *** 4893,4904 **** ### Type stuff. echo $ac_n "checking for mode_t""... $ac_c" 1>&6 ! echo "configure:4897: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS --- 4931,4942 ---- ### Type stuff. echo $ac_n "checking for mode_t""... $ac_c" 1>&6 ! echo "configure:4935: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS *************** *** 4926,4937 **** fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 ! echo "configure:4930: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS --- 4964,4975 ---- fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 ! echo "configure:4968: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS *************** *** 4959,4970 **** fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 ! echo "configure:4963: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS --- 4997,5008 ---- fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 ! echo "configure:5001: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS *************** *** 4992,5003 **** fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 ! echo "configure:4996: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS --- 5030,5041 ---- fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 ! echo "configure:5034: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS *************** *** 5025,5036 **** fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 ! echo "configure:5029: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF --- 5063,5074 ---- fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 ! echo "configure:5067: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF *************** *** 5059,5070 **** fi echo $ac_n "checking for dev_t""... $ac_c" 1>&6 ! echo "configure:5063: checking for dev_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_dev_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS --- 5097,5108 ---- fi echo $ac_n "checking for dev_t""... $ac_c" 1>&6 ! echo "configure:5101: checking for dev_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_dev_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS *************** *** 5092,5103 **** fi echo $ac_n "checking for ino_t""... $ac_c" 1>&6 ! echo "configure:5096: checking for ino_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ino_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS --- 5130,5141 ---- fi echo $ac_n "checking for ino_t""... $ac_c" 1>&6 ! echo "configure:5134: checking for ino_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ino_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS *************** *** 5125,5136 **** fi echo $ac_n "checking for nlink_t""... $ac_c" 1>&6 ! echo "configure:5129: checking for nlink_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_nlink_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS --- 5163,5174 ---- fi echo $ac_n "checking for nlink_t""... $ac_c" 1>&6 ! echo "configure:5167: checking for nlink_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_nlink_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS *************** *** 5158,5169 **** fi echo $ac_n "checking for sigset_t""... $ac_c" 1>&6 ! echo "configure:5162: checking for sigset_t" >&5 if eval "test \"`echo '$''{'octave_cv_type_sigset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS --- 5196,5207 ---- fi echo $ac_n "checking for sigset_t""... $ac_c" 1>&6 ! echo "configure:5200: checking for sigset_t" >&5 if eval "test \"`echo '$''{'octave_cv_type_sigset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS *************** *** 5211,5222 **** for ac_func in getrusage times do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:5215: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:5253: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 5277,5283 ---- ; return 0; } EOF ! if { (eval echo configure:5281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 5310,5316 **** # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5314: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 5348,5354 ---- # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5352: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 5343,5349 **** *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 ! echo "configure:5347: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 5381,5387 ---- *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 ! echo "configure:5385: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 5351,5357 **** ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 5400,5406 ---- yywrap() ; return 0; } EOF ! if { (eval echo configure:5404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 5404,5410 **** # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5408: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 5442,5448 ---- # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5446: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 5443,5449 **** esac echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 ! echo "configure:5447: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 5481,5487 ---- esac echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 ! echo "configure:5485: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 5464,5492 **** fi - ### Kluge for SunOS 4.x vs. shared libraries. - - SH_LIBS="$LIBS" - SH_FLIBS="$FLIBS" - SH_TERMLIBS="$TERMLIBS" - case "$canonical_host_type" in - *-*-sunos4*) - SH_LIBS= - SH_FLIBS= - SH_TERMLIBS= - ;; - esac - echo "$ac_t""defining SH_LIBS to be $SH_LIBS" 1>&6 - echo "$ac_t""defining SH_FLIBS to be $SH_FLIBS" 1>&6 - echo "$ac_t""defining SH_TERMLIBS to be $SH_TERMLIBS" 1>&6 - - - - # Extract the first word of "runtest", so it can be a program name with args. set dummy runtest; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5490: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RUNTEST'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 5502,5511 ---- fi # Extract the first word of "runtest", so it can be a program name with args. set dummy runtest; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5509: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RUNTEST'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 5514,5520 **** # Extract the first word of "expect", so it can be a program name with args. set dummy expect; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5518: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_EXPECT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 5533,5539 ---- # Extract the first word of "expect", so it can be a program name with args. set dummy expect; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5537: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_EXPECT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 5555,5561 **** # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:5559: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 5574,5580 ---- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:5578: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 5604,5609 **** --- 5623,5630 ---- test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + INSTALL_SCRIPT='${INSTALL}' + EXE= case "$canonical_host_type" in *************** *** 5616,5622 **** # Extract the first word of "gnuplot", so it can be a program name with args. set dummy gnuplot; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5620: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GNUPLOT_BINARY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 5637,5643 ---- # Extract the first word of "gnuplot", so it can be a program name with args. set dummy gnuplot; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5641: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GNUPLOT_BINARY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 5643,5649 **** if test -n "$GNUPLOT_BINARY"; then echo $ac_n "checking to see if your gnuplot supports multiplot""... $ac_c" 1>&6 ! echo "configure:5647: checking to see if your gnuplot supports multiplot" >&5 if test -z "`echo 'set term unknown; set multiplot' | \ $GNUPLOT_BINARY 2>&1`"; then echo "$ac_t""yes" 1>&6 --- 5664,5670 ---- if test -n "$GNUPLOT_BINARY"; then echo $ac_n "checking to see if your gnuplot supports multiplot""... $ac_c" 1>&6 ! echo "configure:5668: checking to see if your gnuplot supports multiplot" >&5 if test -z "`echo 'set term unknown; set multiplot' | \ $GNUPLOT_BINARY 2>&1`"; then echo "$ac_t""yes" 1>&6 *************** *** 5655,5661 **** echo "$ac_t""no" 1>&6 fi echo $ac_n "checking to see if your gnuplot supports multiple plot windows""... $ac_c" 1>&6 ! echo "configure:5659: checking to see if your gnuplot supports multiple plot windows" >&5 if test -z "`echo 'set term x11 2' | $GNUPLOT_BINARY 2>&1`"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF --- 5676,5682 ---- echo "$ac_t""no" 1>&6 fi echo $ac_n "checking to see if your gnuplot supports multiple plot windows""... $ac_c" 1>&6 ! echo "configure:5680: checking to see if your gnuplot supports multiple plot windows" >&5 if test -z "`echo 'set term x11 2' | $GNUPLOT_BINARY 2>&1`"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF *************** *** 5690,5696 **** # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5694: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DEFAULT_PAGER'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 5711,5717 ---- # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:5715: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DEFAULT_PAGER'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 5973,5978 **** --- 5994,6002 ---- s%@CXXPICFLAG@%$CXXPICFLAG%g s%@SHLEXT@%$SHLEXT%g s%@DLFCN_DIR@%$DLFCN_DIR%g + s%@SH_LD@%$SH_LD%g + s%@SH_LDFLAGS@%$SH_LDFLAGS%g + s%@RLD_FLAG@%$RLD_FLAG%g s%@OCTAVE_LITE@%$OCTAVE_LITE%g s%@ALLOCA@%$ALLOCA%g s%@CXXLIBS@%$CXXLIBS%g *************** *** 6003,6015 **** s%@LFLAGS@%$LFLAGS%g s%@YACC@%$YACC%g s%@LN_S@%$LN_S%g - s%@SH_LIBS@%$SH_LIBS%g - s%@SH_FLIBS@%$SH_FLIBS%g - s%@SH_TERMLIBS@%$SH_TERMLIBS%g s%@RUNTEST@%$RUNTEST%g s%@EXPECT@%$EXPECT%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@EXE@%$EXE%g s%@GNUPLOT_BINARY@%$GNUPLOT_BINARY%g s%@DEFAULT_PAGER@%$DEFAULT_PAGER%g --- 6027,6037 ---- s%@LFLAGS@%$LFLAGS%g s%@YACC@%$YACC%g s%@LN_S@%$LN_S%g s%@RUNTEST@%$RUNTEST%g s%@EXPECT@%$EXPECT%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g + s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@EXE@%$EXE%g s%@GNUPLOT_BINARY@%$GNUPLOT_BINARY%g s%@DEFAULT_PAGER@%$DEFAULT_PAGER%g diff -cNr octave-2.0.2/configure.in octave-2.0.3/configure.in *** octave-2.0.2/configure.in Mon Jan 27 15:32:14 1997 --- octave-2.0.3/configure.in Fri Feb 14 14:15:01 1997 *************** *** 21,27 **** ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA ### 02111-1307, USA. ! AC_REVISION($Revision: 1.251 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) --- 21,27 ---- ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA ### 02111-1307, USA. ! AC_REVISION($Revision: 1.255 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) *************** *** 375,390 **** --- 375,409 ---- SHARED_LIBS=false) AC_SUBST(SHARED_LIBS) + use_rpath=true + AC_ARG_ENABLE(rpath, + [ --enable-rpath add -rpath to link command for shared libraries], + [if test $enableval = no; then use_rpath=false; fi], []) + DLFCN_DIR= CPICFLAG=-fPIC CXXPICFLAG=-fPIC FPICFLAG=-fPIC SHLEXT=so + SH_LD="$CC" + SH_LDFLAGS=-shared + RLD_FLAG= case "$canonical_host_type" in + *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) + SH_LD=ld + SH_LDFLAGS=-Bshareable + ;; alpha-dec-osf*) CPICFLAG= CXXPICFLAG= FPICFLAG= + SH_LDFLAGS="-Xlinker -exepct_unresolved -Xlinker '*'" + RLD_FLAG='-Xlinker -rpath -Xlinker $(libdir)' + ;; + changequote(,)dnl + i[3456789]86-*-linux*) + changequote([,])dnl + RLD_FLAG='-Xlinker -rpath -Xlinker $(libdir)' ;; rs6000-ibm-aix* | powerpc-ibm-aix*) CPICFLAG= *************** *** 399,404 **** --- 418,424 ---- FPICFLAG=+Z fi SHLEXT=sl + RLD_FLAG='-Xlinker +b -Xlinker $(libdir)' ;; *-sgi-*) if $use_g77; then *************** *** 406,411 **** --- 426,432 ---- else FPICFLAG=-KPIC fi + RLD_FLAG='-L$(libdir)' ;; sparc-sun-sunos4*) if $use_g77; then *************** *** 420,437 **** --- 441,472 ---- else FPICFLAG=-PIC fi + RLD_FLAG='-Xlinker -R -Xlinker $(libdir)' ;; esac + + if $use_rpath; then + true + else + RLD_FLAG= + fi + AC_MSG_RESULT([defining FPICFLAG to be $FPICFLAG]) AC_MSG_RESULT([defining CPICFLAG to be $CPICFLAG]) AC_MSG_RESULT([defining CXXPICFLAG to be $CXXPICFLAG]) AC_MSG_RESULT([defining SHLEXT to be $SHLEXT]) AC_MSG_RESULT([defining DLFCN_DIR to be $DLFCN_DIR]) + AC_MSG_RESULT([defining SH_LD to be $SH_LD]) + AC_MSG_RESULT([defining SH_LDFLAGS to be $SH_LDFLAGS]) + AC_MSG_RESULT([defining RLD_FLAG to be $RLD_FLAG]) AC_SUBST(FPICFLAG) AC_SUBST(CPICFLAG) AC_SUBST(CXXPICFLAG) AC_SUBST(SHLEXT) AC_SUBST(DLFCN_DIR) + AC_SUBST(SH_LD) + AC_SUBST(SH_LDFLAGS) + AC_SUBST(RLD_FLAG) ### Allow compilation of smaller kernel. This only works if some form ### of dynamic linking is also supported and used. *************** *** 1014,1038 **** AC_PROG_LN_S - ### Kluge for SunOS 4.x vs. shared libraries. - - SH_LIBS="$LIBS" - SH_FLIBS="$FLIBS" - SH_TERMLIBS="$TERMLIBS" - case "$canonical_host_type" in - *-*-sunos4*) - SH_LIBS= - SH_FLIBS= - SH_TERMLIBS= - ;; - esac - AC_MSG_RESULT([defining SH_LIBS to be $SH_LIBS]) - AC_MSG_RESULT([defining SH_FLIBS to be $SH_FLIBS]) - AC_MSG_RESULT([defining SH_TERMLIBS to be $SH_TERMLIBS]) - AC_SUBST(SH_LIBS) - AC_SUBST(SH_FLIBS) - AC_SUBST(SH_TERMLIBS) - AC_CHECK_PROG(RUNTEST, runtest, runtest, []) AC_CHECK_PROG(EXPECT, expect, expect, []) if test -z "$EXPECT"; then --- 1049,1054 ---- *************** *** 1041,1046 **** --- 1057,1064 ---- AC_SUBST(RUNTEST) AC_PROG_INSTALL + INSTALL_SCRIPT='${INSTALL}' + AC_SUBST(INSTALL_SCRIPT) EXE= case "$canonical_host_type" in diff -cNr octave-2.0.2/dlfcn/Makefile.in octave-2.0.3/dlfcn/Makefile.in *** octave-2.0.2/dlfcn/Makefile.in Thu Dec 12 02:23:41 1996 --- octave-2.0.3/dlfcn/Makefile.in Fri Jan 31 20:41:34 1997 *************** *** 28,39 **** DISTFILES := $(SOURCES) $(INCLUDES) README dl.exp Makefile.in Makefile.orig ! all: dlfcn.a .PHONY: all ! dlfcn.a: $(OBJECTS) ! $(AR) $(ARFLAGS) dlfcn.a $(OBJECTS) ! $(RANLIB) dlfcn.a check: all .PHONY: check --- 28,39 ---- DISTFILES := $(SOURCES) $(INCLUDES) README dl.exp Makefile.in Makefile.orig ! all: libdlfcn.a .PHONY: all ! libdlfcn.a: $(OBJECTS) ! $(AR) $(ARFLAGS) $@ $(OBJECTS) ! $(RANLIB) $@ check: all .PHONY: check diff -cNr octave-2.0.2/doc/ChangeLog octave-2.0.3/doc/ChangeLog *** octave-2.0.2/doc/ChangeLog Mon Jan 27 15:52:34 1997 --- octave-2.0.3/doc/ChangeLog Tue Feb 18 09:22:43 1997 *************** *** 1,3 **** --- 1,13 ---- + Tue Feb 18 09:22:04 1997 John W. Eaton + + * Version 2.0.3 released. + + Wed Jan 29 11:49:25 1997 John W. Eaton + + * Makefile.in (../INSTALL.OCTAVE, ../BUGS): Declare these to be + .PHONY so that we will always check the interpreter makefile to + get the proper dependencies. + Mon Jan 27 15:52:33 1997 John W. Eaton * Version 2.0.2 released. diff -cNr octave-2.0.2/doc/Makefile.in octave-2.0.3/doc/Makefile.in *** octave-2.0.2/doc/Makefile.in Thu Jan 23 16:11:58 1997 --- octave-2.0.3/doc/Makefile.in Wed Jan 29 11:49:15 1997 *************** *** 33,41 **** --- 33,43 ---- ../INSTALL.OCTAVE: cd interpreter ; $(MAKE) ../../INSTALL.OCTAVE + .PHONY: ../INSTALL.OCTAVE ../BUGS: cd interpreter ; $(MAKE) ../../BUGS + .PHONY: ../BUGS $(SUBDIRS): echo making all in $@ diff -cNr octave-2.0.2/doc/conf.texi.in octave-2.0.3/doc/conf.texi.in *** octave-2.0.2/doc/conf.texi.in Thu Jul 18 21:24:12 1996 --- octave-2.0.3/doc/conf.texi.in Wed Feb 12 00:07:58 1997 *************** *** 4,6 **** --- 4,7 ---- @set VERSION %OCTAVE_VERSION% @set OCTAVEHOME %OCTAVE_HOME% + @set TARGETHOSTTYPE %TARGET_HOST_TYPE% diff -cNr octave-2.0.2/doc/interpreter/Makefile.in octave-2.0.3/doc/interpreter/Makefile.in *** octave-2.0.2/doc/interpreter/Makefile.in Sun Jan 26 22:11:03 1997 --- octave-2.0.3/doc/interpreter/Makefile.in Tue Feb 18 12:03:14 1997 *************** *** 20,40 **** SOURCES = ! TEXINFO = amuse.texi arith.texi audio.texi bugs.texi \ ! control.texi cp-idx.texi diffeq.texi emacs.texi expr.texi \ ! extend.texi fn-idx.texi func.texi gnuinfo.texi help.texi \ ! history.texi hsuser.texi image.texi in-idx.texi install.texi \ ! intro.texi invoke.texi io.texi linalg.texi \ ! matrix.texi nonlin.texi octave.texi op-idx.texi optim.texi \ ! plot.texi poly.texi preface.texi program.texi quad.texi \ ! rd-idx.texi rluser.texi set.texi signal.texi special.texi \ ! stats.texi stmt.texi strings.texi system.texi var.texi \ vr-idx.texi ! FORMATTED = octave.dvi octave.ps octave.info octave.info octave.info-[0-9]* ! DISTFILES = Makefile.in dir octave.1 conf.texi gpl.texi \ ! $(TEXINFO) $(FORMATTED) ifeq ($(wildcard octave.info), ) BINDISTFILES = $(srcdir)/octave.1 $(srcdir)/octave.info \ --- 20,38 ---- SOURCES = ! TEXINFO = arith.texi audio.texi basics.texi bugs.texi control.texi \ ! cp-idx.texi data.texi diffeq.texi emacs.texi errors.texi \ ! eval.texi expr.texi fn-idx.texi func.texi gpl.texi \ ! grammar.texi image.texi install.texi intro.texi io.texi \ ! linalg.texi matrix.texi nonlin.texi numbers.texi octave.texi \ ! op-idx.texi optim.texi plot.texi poly.texi preface.texi \ ! quad.texi set.texi signal.texi stats.texi stmt.texi \ ! strings.texi struct.texi system.texi tips.texi var.texi \ vr-idx.texi ! FORMATTED = octave.dvi octave.ps octave.info octave.info-[0-9]* ! DISTFILES = Makefile.in dir octave.1 conf.texi $(TEXINFO) $(FORMATTED) ifeq ($(wildcard octave.info), ) BINDISTFILES = $(srcdir)/octave.1 $(srcdir)/octave.info \ *************** *** 48,54 **** version_file := $(firstword $(foreach file, $(xfiles), $(wildcard $(file)))) ! SPELL = $(patsubst %.texi, %.spell, $(ALL_TEXINFO)) %.spell : %.texi rm -f $@ --- 46,52 ---- version_file := $(firstword $(foreach file, $(xfiles), $(wildcard $(file)))) ! SPELL = $(patsubst %.texi, %.spell, $(TEXINFO)) %.spell : %.texi rm -f $@ *************** *** 64,73 **** conf.texi: $(srcdir)/../../src/version.h ../../Makeconf Makefile \ $(srcdir)/../conf.texi.in @echo "Making conf.texi from conf.texi.in..." - @(version_val=${version}; \ sed < $(srcdir)/../conf.texi.in > conf.texi.tmp \ ! -e "s;%OCTAVE_VERSION%;$$version_val;" \ ! -e "s;%OCTAVE_HOME%;${prefix};") @if test "$(srcdir)" = "." ; then \ $(top_srcdir)/move-if-change conf.texi.tmp conf.texi; \ else \ --- 62,71 ---- conf.texi: $(srcdir)/../../src/version.h ../../Makeconf Makefile \ $(srcdir)/../conf.texi.in @echo "Making conf.texi from conf.texi.in..." sed < $(srcdir)/../conf.texi.in > conf.texi.tmp \ ! -e "s;%OCTAVE_VERSION%;${version};" \ ! -e "s;%TARGET_HOST_TYPE%;${target_host_type};" \ ! -e "s;%OCTAVE_HOME%;${prefix};" @if test "$(srcdir)" = "." ; then \ $(top_srcdir)/move-if-change conf.texi.tmp conf.texi; \ else \ diff -cNr octave-2.0.2/doc/interpreter/arith.texi octave-2.0.3/doc/interpreter/arith.texi *** octave-2.0.2/doc/interpreter/arith.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/arith.texi Mon Feb 17 15:29:22 1997 *************** *** 1,8 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Arithmetic, Linear Algebra, Built-in Variables, Top @chapter Arithmetic Unless otherwise noted, all of the functions described in this chapter --- 1,8 ---- ! @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 Arithmetic, Linear Algebra, Matrix Manipulation, Top @chapter Arithmetic Unless otherwise noted, all of the functions described in this chapter *************** *** 30,38 **** complex, return @code{ceil (real (@var{x})) + ceil (imag (@var{x})) * I}. @end deftypefn ! @deftypefn {Mapping Function} {} floor (@var{x}) ! Return the largest integer not greater than @var{x}. If @var{x} is ! complex, return @code{floor (real (@var{x})) + floor (imag (@var{x})) * I}. @end deftypefn @deftypefn {Mapping Function} {} fix (@var{x}) --- 30,38 ---- complex, return @code{ceil (real (@var{x})) + ceil (imag (@var{x})) * I}. @end deftypefn ! @deftypefn {Mapping Function} {} exp (@var{x}) ! Compute the exponential of @var{x}. To compute the matrix exponential, ! see @ref{Linear Algebra}. @end deftypefn @deftypefn {Mapping Function} {} fix (@var{x}) *************** *** 40,74 **** @code{fix (real (@var{x})) + fix (imag (@var{x})) * I}. @end deftypefn ! @deftypefn {Mapping Function} {} round (@var{x}) ! Return the integer nearest to @var{x}. If @var{x} is complex, return ! @code{round (real (@var{x})) + round (imag (@var{x})) * I}. ! @end deftypefn ! ! @deftypefn {Mapping Function} {} sign (@var{x}) ! Compute the @dfn{signum} function, which is defined as ! @iftex ! @tex ! $$ ! {\rm sign} (@var{x}) = \cases{1,&$x>0$;\cr 0,&$x=0$;\cr -1,&$x<0$.\cr} ! $$ ! @end tex ! @end iftex ! @ifinfo ! ! @example ! -1, x < 0; ! sign (x) = 0, x = 0; ! 1, x > 0. ! @end example ! @end ifinfo ! ! For complex arguments, @code{sign} returns @code{x ./ abs (@var{x})}. ! @end deftypefn ! ! @deftypefn {Mapping Function} {} exp (@var{x}) ! Compute the exponential of @var{x}. To compute the matrix exponential, ! see @ref{Linear Algebra}. @end deftypefn @deftypefn {Mapping Function} {} gcd (@var{x}, @code{...}) --- 40,48 ---- @code{fix (real (@var{x})) + fix (imag (@var{x})) * I}. @end deftypefn ! @deftypefn {Mapping Function} {} floor (@var{x}) ! Return the largest integer not greater than @var{x}. If @var{x} is ! complex, return @code{floor (real (@var{x})) + floor (imag (@var{x})) * I}. @end deftypefn @deftypefn {Mapping Function} {} gcd (@var{x}, @code{...}) *************** *** 115,127 **** see @ref{Linear Algebra}. @end deftypefn @deftypefn {Mapping Function} {@var{y} =} log2 (@var{x}) @deftypefnx {Mapping Function} {[@var{f}, @var{e}]} log2 (@var{x}) Compute the base-2 logarithm of @var{x}. With two outputs, returns @var{f} and @var{e} such that @iftex @tex ! $1/2 <= |f| < 1$ and $x = f * 2^e$. @end tex @end iftex @ifinfo --- 89,105 ---- see @ref{Linear Algebra}. @end deftypefn + @deftypefn {Mapping Function} {} log10 (@var{x}) + Compute the base-10 logarithm of @var{x}. + @end deftypefn + @deftypefn {Mapping Function} {@var{y} =} log2 (@var{x}) @deftypefnx {Mapping Function} {[@var{f}, @var{e}]} log2 (@var{x}) Compute the base-2 logarithm of @var{x}. With two outputs, returns @var{f} and @var{e} such that @iftex @tex ! $1/2 <= |f| < 1$ and $x = f \cdot 2^e$. @end tex @end iftex @ifinfo *************** *** 129,136 **** @end ifinfo @end deftypefn ! @deftypefn {Mapping Function} {} log10 (@var{x}) ! Compute the base-10 logarithm of @var{x}. @end deftypefn @deftypefn {Mapping Function} {} pow2 (@var{x}) --- 107,143 ---- @end ifinfo @end deftypefn ! @deftypefn {Loadable Function} {} max (@var{x}) ! For a vector argument, return the maximum value. For a matrix argument, ! return the maximum value from each column, as a row vector. Thus, ! ! @example ! max (max (@var{x})) ! @end example ! ! @noindent ! returns the largest element of @var{x}. ! ! For complex arguments, the magnitude of the elements are used for ! comparison. ! @end deftypefn ! ! @deftypefn {Loadable Function} {} min (@var{x}) ! Like @code{max}, but return the minimum value. ! @end deftypefn ! ! @deftypefn {Function File} {} nextpow2 (@var{x}) ! If @var{x} is a scalar, returns the first integer @var{n} such that ! @iftex ! @tex ! $2^n \ge |x|$. ! @end tex ! @end iftex ! @ifinfo ! 2^n >= abs (x). ! @end ifinfo ! ! If @var{x} is a vector, return @code{nextpow2 (length (@var{x}))}. @end deftypefn @deftypefn {Mapping Function} {} pow2 (@var{x}) *************** *** 147,153 **** for each element of @var{x}. With two arguments, returns @iftex @tex ! $f 2^e$. @end tex @end iftex @ifinfo --- 154,160 ---- for each element of @var{x}. With two arguments, returns @iftex @tex ! $f \cdot 2^e$. @end tex @end iftex @ifinfo *************** *** 155,215 **** @end ifinfo @end deftypefn ! @deftypefn {Function File} {} nextpow2 (@var{x}) ! If @var{x} is a scalar, returns the first integer @var{n} such that ! @iftex ! @tex ! $2^n \ge |x|$. ! @end tex ! @end iftex ! @ifinfo ! 2^n >= abs (x). ! @end ifinfo ! ! If @var{x} is a vector, return @code{nextpow2 (length (@var{x}))}. ! @end deftypefn ! ! @deftypefn {Mapping Function} {} sqrt (@var{x}) ! Compute the square root of @var{x}. To compute the matrix square root, ! see @ref{Linear Algebra}. ! @end deftypefn ! ! @deftypefn {Loadable Function} {} max (@var{x}) ! For a vector argument, return the maximum value. For a matrix argument, ! return the maximum value from each column, as a row vector. Thus, @example ! max (max (@var{x})) @end example ! @noindent ! returns the largest element of @var{x}. ! ! For complex arguments, the magnitude of the elements are used for ! comparison. @end deftypefn ! @deftypefn {Loadable Function} {} min (@var{x}) ! Like @code{max}, but return the minimum value. @end deftypefn ! @deftypefn {Mapping Function} {} rem (@var{x}, @var{y}) ! Return the remainder of @code{@var{x} / @var{y}}, computed using the ! expression @example ! x - y .* fix (x ./ y) @end example ! An error message is printed if the dimensions of the arguments do not ! agree, or if either of the arguments is complex. @end deftypefn @deftypefn {Mapping Function} {} xor (@var{x}, @var{y}) Return the `exclusive or' of the entries of @var{x} and @var{y}. For boolean expressions @var{x} and @var{y}, ! @code{xor (@var{x}, @var{y})} is true if and only if either @var{x} or ! @var{y} is true. @end deftypefn @node Complex Arithmetic, Trigonometry, Utility Functions, Arithmetic --- 162,216 ---- @end ifinfo @end deftypefn ! @deftypefn {Mapping Function} {} rem (@var{x}, @var{y}) ! Return the remainder of @code{@var{x} / @var{y}}, computed using the ! expression @example ! x - y .* fix (x ./ y) @end example ! An error message is printed if the dimensions of the arguments do not ! agree, or if either of the arguments is complex. @end deftypefn ! @deftypefn {Mapping Function} {} round (@var{x}) ! Return the integer nearest to @var{x}. If @var{x} is complex, return ! @code{round (real (@var{x})) + round (imag (@var{x})) * I}. @end deftypefn ! @deftypefn {Mapping Function} {} sign (@var{x}) ! Compute the @dfn{signum} function, which is defined as ! @iftex ! @tex ! $$ ! {\rm sign} (@var{x}) = \cases{1,&$x>0$;\cr 0,&$x=0$;\cr -1,&$x<0$.\cr} ! $$ ! @end tex ! @end iftex ! @ifinfo @example ! -1, x < 0; ! sign (x) = 0, x = 0; ! 1, x > 0. @end example + @end ifinfo ! For complex arguments, @code{sign} returns @code{x ./ abs (@var{x})}. ! @end deftypefn ! ! @deftypefn {Mapping Function} {} sqrt (@var{x}) ! Compute the square root of @var{x}. If @var{x} is negative, a complex ! result is returned. To compute the matrix square root, see ! @ref{Linear Algebra}. @end deftypefn @deftypefn {Mapping Function} {} xor (@var{x}, @var{y}) Return the `exclusive or' of the entries of @var{x} and @var{y}. For boolean expressions @var{x} and @var{y}, ! @code{xor (@var{x}, @var{y})} is true if and only if @var{x} or @var{y} ! is true, but not if both @var{x} and @var{y} are true. @end deftypefn @node Complex Arithmetic, Trigonometry, Utility Functions, Arithmetic *************** *** 217,239 **** The following functions are available for working with complex numbers. Each expects a single argument. Given a matrix they work on ! an element by element basis. @deftypefn {Mapping Function} {} abs (@var{z}) ! Compute the magnitude of @var{z}. @end deftypefn @deftypefn {Mapping Function} {} arg (@var{z}) @deftypefnx {Mapping Function} {} angle (@var{z}) ! Compute the argument of @var{z}. @end deftypefn @deftypefn {Mapping Function} {} conj (@var{z}) ! Return the complex conjugate of @var{z}. @end deftypefn @deftypefn {Mapping Function} {} imag (@var{z}) ! Return the imaginary part of @var{z}. @end deftypefn @deftypefn {Mapping Function} {} real (@var{z}) --- 218,296 ---- The following functions are available for working with complex numbers. Each expects a single argument. Given a matrix they work on ! an element by element basis. In the descriptions of the following ! functions, ! @iftex ! @tex ! $z$ is the complex number $x + iy$, where $i$ is defined as ! $\sqrt{-1}$. ! @end tex ! @end iftex ! @ifinfo ! @var{z} is the complex number @var{x} + @var{i}@var{y}, where @var{i} is ! defined as @code{sqrt (-1)}. ! @end ifinfo @deftypefn {Mapping Function} {} abs (@var{z}) ! Compute the magnitude of @var{z}, defined as ! @iftex ! @tex ! $|z| = \sqrt{x^2 + y^2}$. ! @end tex ! @end iftex ! @ifinfo ! |@var{z}| = @code{sqrt (x^2 + y^2)}. ! @end ifinfo ! ! For example, ! ! @example ! @group ! abs (3 + 4i) ! @result{} 5 ! @end group ! @end example @end deftypefn @deftypefn {Mapping Function} {} arg (@var{z}) @deftypefnx {Mapping Function} {} angle (@var{z}) ! Compute the argument of @var{z}, defined as ! @iftex ! @tex ! $\theta = \tan^{-1}(y/x)$. ! @end tex ! @end iftex ! @ifinfo ! @var{theta} = @code{atan (@var{y}/@var{x})}. ! @end ifinfo ! ! @noindent ! in radians. ! ! For example, ! ! @example ! @group ! arg (3 + 4i) ! @result{} 0.92730 ! @end group ! @end example @end deftypefn @deftypefn {Mapping Function} {} conj (@var{z}) ! Return the complex conjugate of @var{z}, defined as ! @iftex ! @tex ! $\bar{z} = x - iy$. ! @end tex ! @end iftex ! @ifinfo ! @code{conj (@var{z})} = @var{x} - @var{i}@var{y}. ! @end ifinfo @end deftypefn @deftypefn {Mapping Function} {} imag (@var{z}) ! Return the imaginary part of @var{z} as a real number. @end deftypefn @deftypefn {Mapping Function} {} real (@var{z}) *************** *** 287,292 **** --- 344,350 ---- @example @group sin ([1, 2; 3, 4]) + @result{} 0.84147 0.90930 0.14112 -0.75680 @end group *************** *** 328,333 **** --- 386,392 ---- @example @group cumsum ([1, 2; 3, 4]) + @result{} 1 2 4 6 @end group *************** *** 340,345 **** --- 399,405 ---- @example @group cumprod ([1, 2; 3, 4]) + @result{} 1 2 3 8 @end group *************** *** 398,404 **** @end deftypefn @deftypefn {Mapping Function} {} bincoeff (@var{n}, @var{k}) ! Returns the binomial coefficient of @var{n} and @var{k}. @end deftypefn @deftypefn {Mapping Function} {} erf (@var{z}) --- 458,492 ---- @end deftypefn @deftypefn {Mapping Function} {} bincoeff (@var{n}, @var{k}) ! Returns the binomial coefficient of @var{n} and @var{k}, defined as ! @iftex ! @tex ! $$ ! {n \choose k} = {n (n-1) (n-2) \cdots (n-k+1) \over k!} ! $$ ! @end tex ! @end iftex ! @ifinfo ! ! @example ! @group ! / \ ! | n | n (n-1) (n-2) ... (n-k+1) ! | | = ------------------------- ! | k | k! ! \ / ! @end group ! @end example ! @end ifinfo ! ! For example, ! ! @example ! @group ! bincoeff (5, 2) ! @result{} 10 ! @end group ! @end example @end deftypefn @deftypefn {Mapping Function} {} erf (@var{z}) *************** *** 423,433 **** @end deftypefn @deftypefn {Mapping Function} {} erfc (@var{z}) ! Computes the complementary error function, @code{1 - erf (@var{z})}. @end deftypefn @deftypefn {Mapping Function} {} erfinv (@var{z}) ! Computes the inverse of the error function. @end deftypefn @deftypefn {Mapping Function} {} gamma (@var{z}) --- 511,529 ---- @end deftypefn @deftypefn {Mapping Function} {} erfc (@var{z}) ! Computes the complementary error function, ! @iftex ! @tex ! $1 - {\rm erf} (z)$. ! @end tex ! @end iftex ! @ifinfo ! @code{1 - erf (@var{z})}. ! @end ifinfo @end deftypefn @deftypefn {Mapping Function} {} erfinv (@var{z}) ! Computes the inverse of the error function, @end deftypefn @deftypefn {Mapping Function} {} gamma (@var{z}) *************** *** 456,462 **** @iftex @tex $$ ! \gamma (a, x) = {\int_0^x e^{-t} t^{a-1} dt \over \Gamma (a)} $$ @end tex @end iftex --- 552,558 ---- @iftex @tex $$ ! \gamma (a, x) = {\displaystyle\int_0^x e^{-t} t^{a-1} dt \over \Gamma (a)} $$ @end tex @end iftex *************** *** 485,498 **** @deftypefn {Function File} {} cross (@var{x}, @var{y}) Computes the vector cross product of the two 3-dimensional vectors ! @var{x} and @var{y}. @end deftypefn @deftypefn {Function File} {} commutation_matrix (@var{m}, @var{n}) Returns the commutation matrix @iftex - $K_{m,n}$ @tex @end tex @end iftex @ifinfo --- 581,601 ---- @deftypefn {Function File} {} cross (@var{x}, @var{y}) Computes the vector cross product of the two 3-dimensional vectors ! @var{x} and @var{y}. For example, ! ! @example ! @group ! cross ([1,1,0], [0,1,1]) ! @result{} [ 1; -1; 1 ] ! @end group ! @end example @end deftypefn @deftypefn {Function File} {} commutation_matrix (@var{m}, @var{n}) Returns the commutation matrix @iftex @tex + $K_{m,n}$ @end tex @end iftex @ifinfo *************** *** 510,516 **** matrix such that @iftex @tex ! $K_{m,n} * {\rm vec} (A) = {\rm vec} (A^T)$ @end tex @end iftex @ifinfo --- 613,619 ---- matrix such that @iftex @tex ! $K_{m,n} \cdot {\rm vec} (A) = {\rm vec} (A^T)$ @end tex @end iftex @ifinfo *************** *** 576,588 **** @end tex @end iftex @ifinfo ! @var{D}_@var{n} * vech (@var{A}) = vec (@var{A}) @end ifinfo for all symmetric @iftex @tex - @end tex $n \times n$ @end iftex @ifinfo @var{n} by @var{n} --- 679,691 ---- @end tex @end iftex @ifinfo ! @var{D}_@var{n} \cdot vech (@var{A}) = vec (@var{A}) @end ifinfo for all symmetric @iftex @tex $n \times n$ + @end tex @end iftex @ifinfo @var{n} by @var{n} *************** *** 621,627 **** modified. The @code{i} and @code{j} forms are like ordinary variables, and may be used for other purposes. However, unlike other variables, they once again assume their special predefined values if they are ! cleared @xref{Miscellaneous Utilities}. @end defvr @defvr {Built-in Variable} Inf --- 724,730 ---- modified. The @code{i} and @code{j} forms are like ordinary variables, and may be used for other purposes. However, unlike other variables, they once again assume their special predefined values if they are ! cleared @xref{Status of Variables}. @end defvr @defvr {Built-in Variable} Inf *************** *** 632,655 **** @defvr {Built-in Variable} NaN @defvrx {Built-in Variable} nan ! Not a number. This is the result of an operation like @samp{0/0}, or ! @samp{Inf - Inf}, or any operation with a NaN. ! @end defvr ! ! @defvr {Built-in Variable} eps ! The machine precision. More precisely, @code{eps} is the largest ! relative spacing between any two adjacent numbers in the machine's ! floating point system. This number is obviously system-dependent. On ! machines that support 64 bit IEEE floating point arithmetic, @code{eps} ! is approximately ! @ifinfo ! 2.2204e-16. ! @end ifinfo @iftex @tex ! $2.2204\times10^{-16}$. @end tex @end iftex @end defvr @defvr {Built-in Variable} pi --- 735,750 ---- @defvr {Built-in Variable} NaN @defvrx {Built-in Variable} nan ! Not a number. This is the result of an operation like @iftex @tex ! $0/0$, or $\infty - \infty$, @end tex @end iftex + @ifinfo + 0/0, or @samp{Inf - Inf}, + @end ifinfo + or any operation with a NaN. @end defvr @defvr {Built-in Variable} pi *************** *** 676,681 **** --- 771,792 ---- @ifinfo @code{log} (@var{e}) = 1. @end ifinfo + @end defvr + + @defvr {Built-in Variable} eps + The machine precision. More precisely, @code{eps} is the largest + relative spacing between any two adjacent numbers in the machine's + floating point system. This number is obviously system-dependent. On + machines that support 64 bit IEEE floating point arithmetic, @code{eps} + is approximately + @ifinfo + 2.2204e-16. + @end ifinfo + @iftex + @tex + $2.2204\times10^{-16}$. + @end tex + @end iftex @end defvr @defvr {Built-in Variable} realmax diff -cNr octave-2.0.2/doc/interpreter/audio.texi octave-2.0.3/doc/interpreter/audio.texi *** octave-2.0.2/doc/interpreter/audio.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/audio.texi Tue Feb 18 01:45:14 1997 *************** *** 1,9 **** ! @c Copyright (C) 1996 John W. Eaton @c Written by Kurt Hornik on 1996/05/14 @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Audio Processing, Input and Output, Image Processing, Top @chapter Audio Processing Octave provides a few functions for dealing with audio data. An audio --- 1,9 ---- ! @c Copyright (C) 1996, 1997 John W. Eaton @c Written by Kurt Hornik on 1996/05/14 @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Audio Processing, System Utilities, Image Processing, Top @chapter Audio Processing Octave provides a few functions for dealing with audio data. An audio *************** *** 30,49 **** @deftypefn {Function File} {} lin2mu (@var{x}) If the vector @var{x} represents mono audio data in 8- or 16-bit ! linear encoding, @code{lin2mu (@var{x})} is the correspoding mu-law encoding. @end deftypefn @deftypefn {Function File} {} mu2lin (@var{x}, @var{bps}) If the vector @var{x} represents mono audio data in mu-law encoding, ! @code{mu2lin (@var{x} [, @var{bps}])} converts it to linear encoding. ! The optional argument @var{bps} specifies whether the input data uses ! 8 bit per sample (default) or 16 bit. @end deftypefn - @c XXX FIXME XXX -- ext and bps are optional, but we need to note the - @c default values here too. - @deftypefn {Function File} {} loadaudio (@var{name}, @var{ext}, @var{bps}) Loads audio data from the file @file{@var{name}.@var{ext}} into the vector @var{x}. --- 30,46 ---- @deftypefn {Function File} {} lin2mu (@var{x}) If the vector @var{x} represents mono audio data in 8- or 16-bit ! linear encoding, @code{lin2mu (@var{x})} is the corresponding mu-law encoding. @end deftypefn @deftypefn {Function File} {} mu2lin (@var{x}, @var{bps}) If the vector @var{x} represents mono audio data in mu-law encoding, ! @code{mu2lin} converts it to linear encoding. The optional argument ! @var{bps} specifies whether the input data uses 8 bit per sample ! (default) or 16 bit. @end deftypefn @deftypefn {Function File} {} loadaudio (@var{name}, @var{ext}, @var{bps}) Loads audio data from the file @file{@var{name}.@var{ext}} into the vector @var{x}. *************** *** 69,88 **** operating system support. It is assumed that audio data in linear encoding can be played and recorded by reading from and writing to @file{/dev/dsp}, and that similarly @file{/dev/audio} is used for mu-law ! encoding. This definitely works on Linux systems, and should also work ! on Suns. If your hardware is accessed differently, please contact ! Andreas Weingessel . @deftypefn {Function File} {} playaudio (@var{name}, @var{ext}) @deftypefnx {Function File} {} playaudio (@var{x}) ! Plays the audio file @file{@var{name}.@var{ext}} or in the vector ! @var{x}. @end deftypefn @deftypefn {Function File} {} record (@var{sec}, @var{sampling_rate}) Records @var{sec} seconds of audio input into the vector @var{x}. The default value for @var{sampling_rate} is 8000 samples per second, or ! 8kHz. The program waits until the @key{ENTER} key is hit, and then immediately starts to record. @end deftypefn --- 66,85 ---- operating system support. It is assumed that audio data in linear encoding can be played and recorded by reading from and writing to @file{/dev/dsp}, and that similarly @file{/dev/audio} is used for mu-law ! encoding. These file names are system-dependent. Improvements so that ! these functions will work without modification on a wide variety of ! hardware are welcome. @deftypefn {Function File} {} playaudio (@var{name}, @var{ext}) @deftypefnx {Function File} {} playaudio (@var{x}) ! Plays the audio file @file{@var{name}.@var{ext}} or the audio data ! stored in the vector @var{x}. @end deftypefn @deftypefn {Function File} {} record (@var{sec}, @var{sampling_rate}) Records @var{sec} seconds of audio input into the vector @var{x}. The default value for @var{sampling_rate} is 8000 samples per second, or ! 8kHz. The program waits until the user types @key{RET} and then immediately starts to record. @end deftypefn diff -cNr octave-2.0.2/doc/interpreter/basics.texi octave-2.0.3/doc/interpreter/basics.texi *** octave-2.0.2/doc/interpreter/basics.texi Wed Dec 31 18:00:00 1969 --- octave-2.0.3/doc/interpreter/basics.texi Sun Feb 16 22:48:26 1997 *************** *** 0 **** --- 1,1128 ---- + @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 Getting Started, Data Types, Introduction, Top + @chapter Getting Started + + This chapter explains some of Octave's basic features, including how to + start an Octave session, get help at the command prompt, edit the + command line, and write Octave programs that can be executed as commands + from your shell. + + @menu + * Invoking Octave:: + * Quitting Octave:: + * Getting Help:: + * Command Line Editing:: + * Errors:: + * Executable Octave Programs:: + * Comments:: + @end menu + + @node Invoking Octave, Quitting Octave, Getting Started, Getting Started + @section 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 @kbd{octave --help} to display all + available options and briefly describe their use (@kbd{octave -h} is a + shorter equivalent). + + @menu + * Command Line Options:: + * Startup Files:: + @end menu + + @node Command Line Options, Startup Files, Invoking Octave, Invoking Octave + @subsection 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 + @code{OCTAVE_EXEC_PATH} found in the environment, but not any commands + in the system or user startup files that set @code{EXEC_PATH}. + + @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 + @code{OCTAVE_INFO_FILE} found in the environment, but not any commands + in the system or user startup files that set @samp{INFO_FILE}. + + @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 + @code{OCTAVE_INFO_PROGRAM} found in the environment, but not any + commands in the system or user startup files that set + @code{INFO_PROGRAM}. + + @item --interactive + @itemx -i + @cindex @code{--interactive} + @cindex @code{-i} + Force interactive behavior. This can be useful for running Octave via a + remote shell command or inside an Emacs shell buffer. For another way + to run Octave within Emacs, see @ref{Emacs}. + + @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 + @code{OCTAVE_PATH} found in the environment, but not any commands in the + system or user startup files that set @code{LOADPATH}. + + @item --silent + @itemx --quiet + @itemx -q + @cindex @code{--silent} + @cindex @code{--quiet} + @cindex @code{-q} + Don't print the usual greeting and version 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, @code{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 + @kbd{@value{OCTAVEHOME}/bin/octave} to start Octave, + @code{program_invocation_name} would have the value + @code{"@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 + @subsection 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 OCTAVE_HOME/share/octave/site/m/startup/octaverc + Where @code{OCTAVE_HOME} is the directory in which all of Octave is + installed (the default is @file{/usr/local}). 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 OCTAVE_HOME/share/octave/VERSION/m/startup/octaverc + Where @code{OCTAVE_HOME} is the directory in which all of Octave is + installed (the default is @file{/usr/local}), and @code{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. + + @node Quitting Octave, Getting Help, Invoking Octave, Getting Started + @section Quitting Octave + @cindex exiting octave + @cindex quitting octave + + @deftypefn {Built-in Function} {} exit (@var{status}) + @deftypefnx {Built-in Function} {} quit (@var{status}) + Exit the current Octave session. If the optional integer value + @var{status} is supplied, pass that value to the operating system as the + Octave's exit status. + @end deftypefn + + @deftypefn {Built-in Function} {} atexit (@var{fcn}) + Register function to be called when Octave exits. For example, + + @example + @group + function print_flops_at_exit () + printf ("\n%s\n", system ("fortune")); + fflush (stdout); + endfunction + atexit ("print_flops_at_exit"); + @end group + @end example + + @noindent + will print a message when Octave exits. + @end deftypefn + + @node Getting Help, Command Line Editing, Quitting Octave, Getting Started + @section Commands for Getting Help + @cindex on-line help + @cindex help, on-line + + The entire text of this manual is available from the Octave prompt + via the command @kbd{help -i}. In addition, the documentation for + individual user-written functions and variables is also available via + the @kbd{help} command. This section describes the commands used for + reading the manual and the documentation strings for user-supplied + functions and variables. @xref{Function Files}, for more information + about how to document the functions you write. + + @deffn {Command} help + Octave's @code{help} command can be used to print brief usage-style + messages, or to display information directly from an on-line version of + the printed manual, using the GNU Info browser. If invoked without any + arguments, @code{help} prints a list of all the available operators, + functions, and built-in variables. If the first argument is @code{-i}, + the @code{help} command searches the index of the on-line version of + this manual for the given topics. + + For example, the command @kbd{help help} prints a short message + describing the @code{help} command, and @kbd{help -i help} starts the + GNU Info browser at this node in the on-line version of the manual. + + Once the GNU Info browser is running, help for using it is available + using the command @kbd{C-h}. + @end deffn + + The help command can give you information about operators, but not the + comma and semicolons that are used as command separators. To get help + for those, you must type @kbd{help comma} or @kbd{help semicolon}. + + @defvr {Built-in Variable} INFO_FILE + The variable @code{INFO_FILE} names the location of the Octave info file. + The default value is @code{"@value{OCTAVEHOME}/info/octave.info"}. + @end defvr + + @defvr {Built-in Variable} INFO_PROGRAM + The variable @code{INFO_PROGRAM} names the info program to run. Its + initial value is + @code{@value{OCTAVEHOME}/libexec/octave/VERSION/exec/ARCH/info}, but + that value can be overridden by the environment variable + @code{OCTAVE_INFO_PROGRAM}, or the command line argument + @code{--info-program NAME}, or by setting the value of + @code{INFO_PROGRAM} in a startup script. + @end defvr + + @defvr {Built-in Variable} suppress_verbose_help_message + If the value of @code{suppress_verbose_help_message} is nonzero, Octave + will not add additional help information to the end of the output from + the @code{help} command and usage messages for built-in commands. + @end defvr + + @node Command Line Editing, Errors, Getting Help, Getting Started + @section Command Line Editing + @cindex command-line editing + @cindex editing the command line + + Octave uses the GNU readline library to provide an extensive set of + command-line editing and history features. Only the most common + features are described in this manual. Please see The GNU Readline + Library manual for more information. + + To insert printing characters (letters, digits, symbols, etc.), simply + type the character. Octave will insert the character at the cursor and + advance the cursor forward. + + Many of the command-line editing functions operate using control + characters. For example, the character @kbd{Control-a} moves the cursor + to the beginning of the line. To type @kbd{C-a}, hold down @key{CTRL} + and then press @key{a}. In the following sections, control characters + such as @kbd{Control-a} are written as @kbd{C-a}. + + Another set of command-line editing functions use Meta characters. On + some terminals, you type @kbd{M-u} by holding down @key{META} and + pressing @key{u}. If your terminal does not have a @key{META} key, you + can still type Meta charcters using two-character sequences starting + with @kbd{ESC}. Thus, to enter @kbd{M-u}, you could type + @key{ESC}@key{u}. The @kbd{ESC} character sequences are also allowed on + terminals with real Meta keys. In the following sections, Meta + characters such as @kbd{Meta-u} are written as @kbd{M-u}. + + @menu + * Cursor Motion:: + * Killing and Yanking:: + * Commands For Text:: + * Commands For Completion:: + * Commands For History:: + * Customizing the Prompt:: + * Diary and Echo Commands:: + @end menu + + @node Cursor Motion, Killing and Yanking, Command Line Editing, Command Line Editing + @subsection Cursor Motion + + The following commands allow you to position the cursor. + + @table @kbd + @item C-b + Move back one character. + + @item C-f + Move forward one character. + + @item DEL + Delete the character to the left of the cursor. + + @item C-d + Delete the character underneath the cursor. + + @item M-f + Move forward a word. + + @item M-b + Move backward a word. + + @item C-a + Move to the start of the line. + + @item C-e + Move to the end of the line. + + @item C-l + Clear the screen, reprinting the current line at the top. + + @item C-_ + @itemx C-/ + Undo the last thing that you did. You can undo all the way back to an + empty line. + + @item M-r + Undo all changes made to this line. This is like typing the `undo' + command enough times to get back to the beginning. + @end table + + The above table describes the most basic possible keystrokes that you need + in order to do editing of the input line. On most terminals, you can + also use the arrow keys in place of @kbd{C-f} and @kbd{C-b} to move + forward and backward. + + Notice how @kbd{C-f} moves forward a character, while @kbd{M-f} moves + forward a word. It is a loose convention that control keystrokes + operate on characters while meta keystrokes operate on words. + + There is also a function available so that you can clear the screen from + within Octave programs. + + @cindex clearing the screen + + @deftypefn {Built-in Function} {} clc () + @deftypefnx {Built-in Function} {} home () + Clear the terminal screen and move the cursor to the upper left corner. + @end deftypefn + + @node Killing and Yanking, Commands For Text, Cursor Motion, Command Line Editing + @subsection Killing and Yanking + + @dfn{Killing} text means to delete the text from the line, but to save + it away for later use, usually by @dfn{yanking} it back into the line. + If the description for a command says that it `kills' text, then you can + be sure that you can get the text back in a different (or the same) + place later. + + Here is the list of commands for killing text. + + @table @kbd + @item C-k + Kill the text from the current cursor position to the end of the line. + + @item M-d + Kill from the cursor to the end of the current word, or if between + words, to the end of the next word. + + @item M-DEL + Kill from the cursor to the start of the previous word, or if between + words, to the start of the previous word. + + @item C-w + Kill from the cursor to the previous whitespace. This is different than + @kbd{M-DEL} because the word boundaries differ. + @end table + + And, here is how to @dfn{yank} the text back into the line. Yanking + means to copy the most-recently-killed text from the kill buffer. + + @table @kbd + @item C-y + Yank the most recently killed text back into the buffer at the cursor. + + @item M-y + Rotate the kill-ring, and yank the new top. You can only do this if + the prior command is @kbd{C-y} or @kbd{M-y}. + @end table + + When you use a kill command, the text is saved in a @dfn{kill-ring}. + Any number of consecutive kills save all of the killed text together, so + that when you yank it back, you get it in one clean sweep. The kill + ring is not line specific; the text that you killed on a previously + typed line is available to be yanked back later, when you are typing + another line. + + @node Commands For Text, Commands For Completion, Killing and Yanking, Command Line Editing + @subsection Commands For Changing Text + + The following commands can be used for entering characters that would + otherwise have a special meaning (e.g., @kbd{TAB}, @kbd{C-q}, etc.), or + for quickly correcting typing mistakes. + + @table @kbd + @item C-q + @itemx C-v + Add the next character that you type to the line verbatim. This is + how to insert things like @kbd{C-q} for example. + + @item M-TAB + Insert a tab character. + + @item C-t + Drag the character before the cursor forward over the character at the + cursor, also moving the cursor forward. If the cursor is at the end of + the line, then transpose the two characters before it. + + @item M-t + Drag the word behind the cursor past the word in front of the cursor + moving the cursor over that word as well. + + @item M-u + Uppercase the characters following the cursor to the end of the current + (or following) word, moving the cursor to the end of the word. + + @item M-l + Lowecase the characters following the cursor to the end of the current + (or following) word, moving the cursor to the end of the word. + + @item M-c + Uppercase the character following the cursor (or the beginning of the + next word if the cursor is between words), moving the cursor to the end + of the word. + @end table + + @node Commands For Completion, Commands For History, Commands For Text, Command Line Editing + @subsection Letting Readline Type For You + @cindex command completion + + The following commands allow Octave to complete command and variable + names for you. + + @table @kbd + @item TAB + Attempt to do completion on the text before the cursor. Octave can + complete the names of commands and variables. + + @item M-? + List the possible completions of the text before the cursor. + @end table + + @defvr {Built-in Variable} completion_append_char + The value of @code{completion_append_char} is used as the character to + append to successful command-line completion attempts. The default + value is @code{" "} (a single space). + @end defvr + + @deftypefn {Built-in Function} {} completion_matches (@var{hint}) + Generate possible completions given @var{hint}. + + This function is provided for the benefit of programs like Emacs which + might be controlling Octave and handling user input. The current + command number is not incremented when this function is called. This is + a feature, not a bug. + @end deftypefn + + @node Commands For History, Customizing the Prompt, Commands For Completion, Command Line Editing + @subsection Commands For Manipulating The History + @cindex command history + @cindex input history + @cindex history of commands + + Octave normally keeps track of the commands you type so that you can + recall previous commands to edit or execute them again. When you exit + Octave, the most recent commands you have typed, up to the number + specified by the variable @code{history_size}, are saved in a file. + When Octave starts, it loads an initial list of commands from the file + named by the variable @code{history_file}. + + Here are the commands for simple browsing and searching the history + list. + + @table @kbd + @item LFD + @itemx RET + Accept the line regardless of where the cursor is. If this line is + non-empty, add it to the history list. If this line was a history + line, then restore the history line to its original state. + + @item C-p + Move `up' through the history list. + + @item C-n + Move `down' through the history list. + + @item M-< + Move to the first line in the history. + + @item M-> + Move to the end of the input history, i.e., the line you are entering! + + @item C-r + Search backward starting at the current line and moving `up' through + the history as necessary. This is an incremental search. + + @item C-s + Search forward starting at the current line and moving `down' through + the the history as necessary. + @end table + + On most terminals, you can also use the arrow keys in place of @kbd{C-p} + and @kbd{C-n} to move through the history list. + + In addition to the keyboard commands for moving through the history + list, Octave provides three functions for viewing, editing, and + re-running chunks of commands from the history list. + + @deffn {Command} history options + If invoked with no arguments, @code{history} displays a list of commands + that you have executed. Valid options are: + + @table @code + @item -w file + Write the current history to the named file. If the name is omitted, + use the default history file (normally @file{~/.octave_hist}). + + @item -r file + Read the named file, replacing the current history list with its + contents. If the name is omitted, use the default history file + (normally @file{~/.octave_hist}). + + @item @var{N} + Only display the most recent @var{N} lines of history. + + @item -q + Don't number the displayed lines of history. This is useful for cutting + and pasting commands if you are using the X Window System. + @end table + + For example, to display the five most recent commands that you have + typed without displaying line numbers, use the command + @kbd{history -q 5}. + @end deffn + + @deffn {Command} edit_history options + If invoked with no arguments, @code{edit_history} allows you to edit the + history list using the editor named by the variable @code{EDITOR}. The + commands to be edited are first copied to a temporary file. When you + exit the editor, Octave executes the commands that remain in the file. + It is often more convenient to use @code{edit_history} to define functions + rather than attempting to enter them directly on the command line. + By default, the block of commands is executed as soon as you exit the + editor. To avoid executing any commands, simply delete all the lines + from the buffer before exiting the editor. + + The @code{edit_history} command takes two optional arguments specifying + the history numbers of first and last commands to edit. For example, + the command + + @example + edit_history 13 + @end example + + @noindent + extracts all the commands from the 13th through the last in the history + list. The command + + @example + edit_history 13 169 + @end example + + @noindent + only extracts commands 13 through 169. Specifying a larger number for + the first command than the last command reverses the list of commands + before placing them in the buffer to be edited. If both arguments are + omitted, the previous command in the history list is used. + @end deffn + + @deffn {Command} run_history + Similar to @code{edit_history}, except that the editor is not invoked, + and the commands are simply executed as they appear in the history list. + @end deffn + + @defvr {Built-in Variable} EDITOR + A string naming the editor to use with the @code{edit_history} command. + If the environment variable @code{EDITOR} is set when Octave starts, its + value is used as the default. Otherwise, @code{EDITOR} is set to + @code{"vi"}. + @end defvr + + @defvr {Built-in Variable} history_file + This variable specifies the name of the file used to store command + history. The default value is @code{"~/.octave_hist"}, but may be + overridden by the environment variable @code{OCTAVE_HISTFILE}. + @end defvr + + @defvr {Built-in Variable} history_size + This variable specifies how many entries to store in the history file. + The default value is @code{1024}, but may be overridden by the + environment variable @code{OCTAVE_HISTSIZE}. + @end defvr + + @defvr {Built-in Variable} saving_history + If the value of @code{saving_history} is @code{"true"}, command entered + on the command line are saved in the file specified by the variable + @code{history_file}. + @end defvr + + @node Customizing the Prompt, Diary and Echo Commands, Commands For History, Command Line Editing + @subsection Customizing the Prompt + @cindex prompt customization + @cindex customizing the prompt + + The following variables are available for customizing the appearance of + the command-line prompts. Octave allows the prompt to be customized by + inserting a number of backslash-escaped special characters that are + decoded as follows: + + @table @samp + @item \t + The time. + + @item \d + The date. + + @item \n + Begins a new line by printing the equivalent of a carriage return + followed by a line feed. + + @item \s + The name of the program (usually just @code{octave}). + + @item \w + The current working directory. + + @item \W + The basename of the current working directory. + + @item \u + The username of the current user. + + @item \h + The hostname. + + @item \H + The hostname, up to the first `.'. + + @item \# + The command number of this command, counting from when Octave starts. + + @item \! + The history number of this command. This differs from @samp{\#} by the + number of commands in the history list when Octave starts. + + @item \$ + If the effective UID is 0, a #, otherwise a $. + + @item \nnn + The character whose character code in octal is @samp{nnn}. + + @item \\ + A backslash. + @end table + + @defvr {Built-in Variable} PS1 + The primary prompt string. When executing interactively, Octave + displays the primary prompt @code{PS1} when it is ready to read a + command. + + The default value of @code{PS1} is @code{"\s:\#> "}. To change it, use a + command like + + @example + octave:13> PS1 = "\\u@@\\H> " + @end example + + @noindent + which will result in the prompt @samp{boris@@kremvax> } for the user + @samp{boris} logged in on the host @samp{kremvax.kgb.su}. Note that two + backslashes are required to enter a backslash into a string. + @xref{Strings}. + @end defvr + + @defvr {Built-in Variable} PS2 + The secondary prompt string, which is printed when Octave is + expecting additional input to complete a command. For example, when + defining a function over several lines, Octave will print the value of + @code{PS1} at the beginning of each line after the first. The default + value of @code{PS2} is @code{"> "}. + @end defvr + + @defvr {Built-in Variable} PS4 + If Octave is invoked with the @code{--echo-input} option, the value of + @code{PS4} is printed before each line of input that is echoed. The + default value of @code{PS4} is @code{"+ "}. @xref{Invoking Octave}, for + a description of @code{--echo-input}. + @end defvr + + @node Diary and Echo Commands, , Customizing the Prompt, Command Line Editing + @subsection Diary and Echo Commands + @cindex diary of commands and output + @cindex command and ouput logs + @cindex logging commands and output + @cindex echoing executing commands + @cindex command echoing + + Octave's diary feature allows you to keep a log of all or part of an + interactive session by recording the input you type and the output that + Octave produces in a separate file. + + @deffn {Command} diary options + Create a list of all commands @emph{and} the output they produce, mixed + together just as you see them on your terminal. Valid options are: + + @table @code + @item on + Start recording your session in a file called @file{diary} in your + current working directory. + + @item off + Stop recording your session in the diary file. + + @item @var{file} + Record your session in the file named @var{file}. + @end table + + Without any arguments, @code{diary} toggles the current diary state. + @end deffn + + Sometimes it is useful to see the commands in a function or script as + they are being evaluated. This can be especially helpful for debugging + some kinds of problems. + + @deffn {Command} echo options + Control whether commands are displayed as they are executed. Valid + options are: + + @table @code + @item on + Enable echoing of commands as they are executed in script files. + + @item off + Disable echoing of commands as they are executed in script files. + + @item on all + Enable echoing of commands as they are executed in script files and + functions. + + @item off all + Disable echoing of commands as they are executed in script files and + functions. + @end table + + @noindent + If invoked without any arguments, @code{echo} toggles the current echo + state. + @end deffn + + @defvr {Built-in Variable} echo_executing_commands + This variable is may also be used to control the echo state. It may be + the sum of the following values: + + @table @asis + @item 1 + Echo commands read from script files. + + @item 2 + Echo commands from functions. + + @item 4 + Echo commands read from command line. + @end table + + More than one state can be active at once. For example, a value of 3 is + equivalent to the command @kbd{echo on all}. + + The value of @code{echo_executing_commands} is set by the @kbd{echo} + command and the command line option @code{--echo-input}. + @end defvr + + @node Errors, Executable Octave Programs, Command Line Editing, Getting Started + @section How Octave Reports Errors + @cindex error messages + @cindex messages, error + + There are two classes of errors that Octave produces when it encounters + input that it is unable to understand. + + A @dfn{parse error} occurs if Octave cannot understand something you + have typed. For example, if you misspell a keyword, + + @example + octave:13> functon y = f (x) y = x^2; endfunction + @end example + + @noindent + Octave will respond immediately with a message like this: + + @example + parse error: + + functon y = f (x) y = x^2; endfunction + ^ + @end example + + @noindent + For most parse errors, Octave uses a caret (@samp{^}) to mark the point + on the line where it was unable to make sense of your input. In this + case, Octave generated an error message because the keyword + @code{function} was misspelled. Instead of seeing @samp{function f}, + Octave saw two consecutive variable names, which is invalid in this + context. It marked the error at the @code{y} because the first name by + itself was accepted as valid input. + + Another class of error message occurs occurs at evaluation time. These + errors are called @dfn{run-time errors}, or sometimes + @dfn{evaluation errors} because they occur when your program is being + @dfn{run}, or @dfn{evaluated}. For example, if after correcting the + mistake in the previous function definition, you type + + @example + octave:13> f () + @end example + + @noindent + Octave will respond with + + @example + @group + error: `x' undefined near line 1 column 24 + error: evaluating expression near line 1, column 24 + error: evaluating assignment expression near line 1, column 22 + error: called from `f' + @end group + @end example + + This error message has several parts, and gives you quite a bit of + information to help you locate the source of the error. The messages + are generated from the point of the innermost error, and provide a + traceback of enclosing expressions and function calls. + + In the example above, the first line indicates that a variable named + @samp{x} was found to be undefined near line 1 and column 24 of some + function or expression. For errors occurring within functions, lines + from the beginning of the file containing the function definition. For + errors occurring at the top level, the line number indicates the input + line number, which is usually displayed in the prompt string. + + The second and third lines in the example indicate that the error + occurred within an assignment expression, and the last line of the error + message indicates that the error occurred within the function @code{f}. + If the function @code{f} had been called from another function, for + example, @code{g}, the list of errors would have ended with one more + line: + + @example + error: called from `g' + @end example + + These lists of function calls usually make it fairly easy to trace the + path your program took before the error occurred, and to correct the + error before trying again. + + @node Executable Octave Programs, Comments, Errors, Getting Started + @section Executable Octave Programs + @cindex executable scripts + @cindex scripts + @cindex self contained programs + @cindex program, self contained + @cindex @samp{#!} + + Once you have learned Octave, you may want to write self-contained + Octave scripts, using the @samp{#!} script mechanism. You can do this + on GNU systems and on many Unix systems @footnote{The @samp{#!} + mechanism works on Unix systems derived from Berkeley Unix, System V + Release 4, and some System V Release 3 systems.} + + For example, you could create a text file named @file{hello}, containing + the following lines: + + @example + @group + #! @value{OCTAVEHOME}/bin/octave -qf + # a sample Octave program + printf ("Hello, world!\n"); + @end group + @end example + + @noindent + After making this file executable (with the @code{chmod} command), you + can simply type: + + @example + hello + @end example + + @noindent + at the shell, and the system will arrange to run Octave as if you had + typed: + + @example + octave hello + @end example + + The line beginning with @samp{#!} lists the full file name of an + interpreter to be run, and an optional initial command line argument to + pass to that interpreter. The operating system then runs the + interpreter with the given argument and the full argument list of the + executed program. The first argument in the list is the full file name + of the Octave program. The rest of the argument list will either be + options to Octave, or data files, or both. The @code{-qf} option is + usually specified in stand-alone Octave programs to prevent them from + printing the normal startup message, and to keep them from behaving + differently depending on the contents of a particular user's + @file{~/.octaverc} file. @xref{Invoking Octave}. Note that some + operating systems may place a limit on the number of characters that are + recognized after @samp{#!}. + + Self-contained Octave scripts are useful when you want to write a + program which users can invoke without knowing that the program is + written in the Octave language. + + If you invoke an executable Octave script with command line arguments, + the arguments are available in the built-in variable @code{argv}. + @xref{Command Line Options}. For example, the following program will + reproduce the command line that is used to execute it. + + @example + @group + #! @value{OCTAVEHOME}/bin/octave -qf + printf ("%s", program_name); + for i = 1:nargin + printf (" %s", argv(i,:)); + endfor + printf ("\n"); + @end group + @end example + + @node Comments, , Executable Octave Programs, Getting Started + @section Comments in Octave Programs + @cindex @samp{#} + @cindex @samp{%} + @cindex comments + @cindex use of comments + @cindex documenting Octave programs + @cindex programs + + A @dfn{comment} is some text that is included in a program for the sake + of human readers, and that is not really part of the program. Comments + can explain what the program does, and how it works. Nearly all + programming languages have provisions for comments, because programs are + typically hard to understand without them. + + In the Octave language, a comment starts with either the sharp sign + character, @samp{#}, or the percent symbol @samp{%} and continues to the + end of the line. The Octave interpreter ignores the rest of a + line following a sharp sign or percent symbol. For example, we could + have put the following into the function @code{f}: + + @example + @group + function xdot = f (x, t) + + # usage: f (x, t) + # + # This function defines the right hand + # side functions for a set of nonlinear + # differential equations. + + r = 0.25; + @dots{} + endfunction + @end group + @end example + + The @code{help} command (@pxref{Getting Help}) is able to find the first + block of comments in a function (even those that are composed directly + on the command line). This means that users of Octave can use the same + commands to get help for built-in functions, and for functions that you + have defined. For example, after defining the function @code{f} above, + the command @kbd{help f} produces the output + + @example + @group + usage: f (x, t) + + This function defines the right hand + side functions for a set of nonlinear + differential equations. + @end group + @end example + + Although it is possible to put comment lines into keyboard-composed + throw-away Octave programs, it usually isn't very useful, because the + purpose of a comment is to help you or another person understand the + program at a later time. + diff -cNr octave-2.0.2/doc/interpreter/bugs.texi octave-2.0.3/doc/interpreter/bugs.texi *** octave-2.0.2/doc/interpreter/bugs.texi Sun Jan 26 22:18:31 1997 --- octave-2.0.3/doc/interpreter/bugs.texi Tue Feb 18 01:47:31 1997 *************** *** 1,4 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. --- 1,4 ---- ! @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. *************** *** 6,13 **** @c in the Octave distribution, as well as in the Octave manual. @ifclear BUGSONLY ! @node Trouble, Command Line Editing, Installation, Top ! @appendix Known Causes of Trouble with Octave @end ifclear @ifset BUGSONLY --- 6,13 ---- @c in the Octave distribution, as well as in the Octave manual. @ifclear BUGSONLY ! @node Trouble, Installation, Tips, Top ! @appendix Known Causes of Trouble @end ifclear @ifset BUGSONLY *************** *** 20,26 **** modify it freely as long as you preserve this copyright notice and permission notice. ! @node Trouble, Trouble, Trouble, (dir) @chapter Known Causes of Trouble with Octave @end ifset --- 20,26 ---- modify it freely as long as you preserve this copyright notice and permission notice. ! @node Trouble, , Trouble @chapter Known Causes of Trouble with Octave @end ifset *************** *** 235,249 **** for you. If for some reason you cannot use Octave's @code{bug_report} function, ! send bug reports for Octave to: ! ! @example ! bug-octave@@bevo.che.wisc.edu ! @end example @strong{Do not send bug reports to @samp{help-octave}}. Most users of Octave do not want to receive bug reports. Those that do have asked to ! be on @samp{bug-octave}. As a last resort, send bug reports on paper to: --- 235,245 ---- for you. If for some reason you cannot use Octave's @code{bug_report} function, ! send bug reports for Octave to @email{bug-octave@@bevo.che.wisc.edu}. @strong{Do not send bug reports to @samp{help-octave}}. Most users of Octave do not want to receive bug reports. Those that do have asked to ! be on the mailing list. As a last resort, send bug reports on paper to: *************** *** 360,366 **** If you wish to suggest changes to the Octave source, send them as context diffs. If you even discuss something in the Octave source, refer to it by context, not by line number, because the line numbers in ! the development sources probalby won't match those in your sources. @end itemize Here are some things that are not necessary: --- 356,362 ---- If you wish to suggest changes to the Octave source, send them as context diffs. If you even discuss something in the Octave source, refer to it by context, not by line number, because the line numbers in ! the development sources probably won't match those in your sources. @end itemize Here are some things that are not necessary: *************** *** 462,481 **** @appendixsec How To Get Help with Octave @cindex help, where to find ! If you need help installing, using or changing Octave, the mailing list ! ! @example ! help-octave@@bevo.che.wisc.edu ! @end example ! ! exists for the discussion of Octave matters related to using, ! installing, and porting Octave. If you would like to join the ! discussion, please send a short note to ! ! @example ! help-octave-request@@bevo.che.wisc.edu ! ^^^^^^^ ! @end example @strong{Please do not} send requests to be added or removed from the the mailing list, or other administrative trivia to the list itself. --- 458,472 ---- @appendixsec How To Get Help with Octave @cindex help, where to find ! The mailing list @email{help-octave@@bevo.che.wisc.edu} exists for the ! discussion of matters related to using and installing Octave. If would ! like to join the discussion, please send a short note to ! @email{help-octave@strong{-request}@@bevo.che.wisc.edu}. @strong{Please do not} send requests to be added or removed from the the mailing list, or other administrative trivia to the list itself. + + If you think you have found a bug in the installation procedure, + however, you should send a complete bug report for the problem to + @email{bug-octave@@bevo.che.wisc.edu}. @xref{Bug Reporting} for + information that will help you to submit a useful report. diff -cNr octave-2.0.2/doc/interpreter/conf.texi octave-2.0.3/doc/interpreter/conf.texi *** octave-2.0.2/doc/interpreter/conf.texi Mon Jan 27 00:18:18 1997 --- octave-2.0.3/doc/interpreter/conf.texi Tue Feb 18 00:00:28 1997 *************** *** 2,6 **** @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @set VERSION 2.0.2 @set OCTAVEHOME /usr/local --- 2,7 ---- @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @set VERSION 2.0.3 @set OCTAVEHOME /usr/local + @set TARGETHOSTTYPE i586-pc-linux-gnu diff -cNr octave-2.0.2/doc/interpreter/control.texi octave-2.0.3/doc/interpreter/control.texi *** octave-2.0.2/doc/interpreter/control.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/control.texi Tue Feb 18 01:44:30 1997 *************** *** 1,24 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Control Theory, Signal Processing, Quadrature, Top @chapter Control Theory ! @deftypefn {Function File} {} abcddim (@var{a}, @var{b}, @var{c}, @var{d}) Check for compatibility of the dimensions of the matrices defining ! the linear system [A, B, C, D] corresponding to @iftex @tex $$ ! {dx\over dt} = A x + B u ! $$ ! $$ ! y = C x + D u $$ @end tex @end iftex @ifinfo @example dx/dt = a x + b u --- 1,32 ---- ! @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 Control Theory, Signal Processing, Polynomial Manipulations, Top @chapter Control Theory ! Most of the functions described in this chapter were contributed by ! A. Scottedward Hodel @email{A.S.Hodel@@eng.auburn.edu} and R. Bruce Tenison ! @email{Bruce.Tenison@@eng.auburn.edu}. They have also written a larger ! collection of functions for solving linear control problems. It is ! currently being updated for Octave version 2, with snapshots of the ! sources available from @url{ftp://ftp.eng.auburn.edu/pub/hodel}. ! ! @deftypefn {Function File} {[@var{n}, @var{m}, @var{p}] =} abcddim (@var{a}, @var{b}, @var{c}, @var{d}) Check for compatibility of the dimensions of the matrices defining ! the linear system @iftex @tex + $[A, B, C, D]$ corresponding to $$ ! \eqalign{ ! {dx\over dt} &= A x + B u\cr ! y &= C x + D u} $$ @end tex @end iftex @ifinfo + [A, B, C, D] corresponding to @example dx/dt = a x + b u *************** *** 29,61 **** or a similar discrete-time system. If the matrices are compatibly dimensioned, then @code{abcddim} returns ! @var{n} = number of system states, @var{m} = number of system inputs, ! and @var{p} = number of system outputs. Otherwise @code{abcddim} ! returns @var{n} = @var{m} = @var{p} = @minus{}1. @end deftypefn @deftypefn {Function File} {} are (@var{a}, @var{b}, @var{c}, @var{opt}) ! Returns the solution, @var{x}, of the algebraic Riccati equation @example ! a' x + x a - x b x + c = 0 @end example @noindent ! for identically dimensioned square matrices @var{a}, @var{b}, @var{c}. ! If @var{b} (@var{c}) is not square, then the function attempts to use ! @code{@var{b}*@var{b}'} (@code{@var{c}'*@var{c}}) instead. ! Solution method: apply Laub's Schur method (IEEE Transactions on ! Automatic Control, 1979) to the appropriate Hamiltonian matrix. ! @var{opt} is an option passed to the eigenvalue balancing routine. ! Default is @code{"B"}. @end deftypefn @deftypefn {Function File} {} c2d (@var{a}, @var{b}, @var{t}) ! Converts the continuous time system described by: @iftex @tex $$ --- 37,90 ---- or a similar discrete-time system. If the matrices are compatibly dimensioned, then @code{abcddim} returns ! ! @table @var ! @item n ! The number of system states. ! ! @item m ! The number of system inputs. ! ! @item p ! The number of system outputs. ! @end table ! ! Otherwise @code{abcddim} returns @var{n} = @var{m} = @var{p} = @minus{}1. @end deftypefn @deftypefn {Function File} {} are (@var{a}, @var{b}, @var{c}, @var{opt}) ! Return the solution, @var{x}, of the algebraic Riccati equation ! @iftex ! @tex ! $$ ! A^TX + XA - XBX + C = 0 ! $$ ! @end tex ! @end iftex ! @ifinfo @example ! a' * x + x * a - x * b * x + c = 0 @end example + @end ifinfo @noindent ! for identically dimensioned square matrices @var{a}, @var{b}, and ! @var{c}. If @var{b} is not square, @code{are} attempts to use ! @code{@var{b}*@var{b}'} instead. If @var{c} is not square, @code{are} ! attempts to use @code{@var{c}'*@var{c}}) instead. ! To form the solution, Laub's Schur method (IEEE Transactions on ! Automatic Control, 1979) is applied to the appropriate Hamiltonian ! matrix. ! The optional argument @var{opt} is passed to the eigenvalue balancing ! routine. If it is omitted, a value of @code{"B"} is assumed. @end deftypefn @deftypefn {Function File} {} c2d (@var{a}, @var{b}, @var{t}) ! Convert the continuous time system described by: @iftex @tex $$ *************** *** 92,130 **** @deftypefn {Function File} {} dare (@var{a}, @var{b}, @var{c}, @var{r}, @var{opt}) ! Returns the solution, @var{x} of the discrete-time algebraic Riccati equation @example a' x a - x + a' x b (r + b' x b)^(-1) b' x a + c = 0 @end example @noindent for matrices with dimensions: ! @example ! @var{a}: @var{n} by @var{n} ! @var{b}: @var{n} by @var{m} ! @var{c}: @var{n} by @var{n}, symmetric positive semidefinite ! @var{r}: @var{m} by @var{m}, symmetric positive definite (invertible) ! @end example If @var{c} is not square, then the function attempts to use @code{@var{c}'*@var{c}} instead. ! Solution method: Laub's Schur method (IEEE Transactions on Automatic ! Control, 1979) is applied to the appropriate symplectic matrix. ! See also: Ran and Rodman, @cite{Stable Hermitian Solutions of Discrete Algebraic Riccati Equations}, Mathematics of Control, Signals and Systems, Volume 5, Number 2 (1992). ! @var{opt} is an option passed to the eigenvalue balancing routine. ! The default is @code{"B"}. @end deftypefn @deftypefn {Function File} {} dgram (@var{a}, @var{b}) ! Returns the discrete controllability and observability gramian for the discrete time system described by @iftex @tex --- 121,176 ---- @deftypefn {Function File} {} dare (@var{a}, @var{b}, @var{c}, @var{r}, @var{opt}) ! Return the solution, @var{x} of the discrete-time algebraic Riccati equation + @iftex + @tex + $$ + A^TXA - X + A^TXB (R + B^TXB)^{-1} B^TXA + C = 0 + $$ + @end tex + @end iftex + @ifinfo @example a' x a - x + a' x b (r + b' x b)^(-1) b' x a + c = 0 @end example + @end ifinfo @noindent for matrices with dimensions: ! @table @var ! @item a ! @var{n} by @var{n}. ! ! @item b ! @var{n} by @var{m}. ! ! @item c ! @var{n} by @var{n}, symmetric positive semidefinite. ! ! @item r ! @var{m} by @var{m}, symmetric positive definite (invertible). ! @end table If @var{c} is not square, then the function attempts to use @code{@var{c}'*@var{c}} instead. ! To form the solution, Laub's Schur method (IEEE Transactions on ! Automatic Control, 1979) is applied to the appropriate symplectic ! matrix. ! See also Ran and Rodman, @cite{Stable Hermitian Solutions of Discrete Algebraic Riccati Equations}, Mathematics of Control, Signals and Systems, Volume 5, Number 2 (1992). ! The optional argument @var{opt} is passed to the eigenvalue balancing ! routine. If it is omitted, a value of @code{"B"} is assumed. @end deftypefn @deftypefn {Function File} {} dgram (@var{a}, @var{b}) ! Return the discrete controllability or observability gramian for the discrete time system described by @iftex @tex *************** *** 144,157 **** @end example @end ifinfo ! @code{dgram (@var{a}, @var{b})} returns the discrete controllability ! gramian and @code{dgram (@var{a}', @var{c}')} returns the observability ! gramian. @end deftypefn ! @deftypefn {Function File} {} dlqe (@var{a}, @var{g}, @var{c}, @var{sigw}, @var{sigv} [, @var{z}]) ! Linear quadratic estimator (Kalman filter) design for the discrete time ! system @iftex @tex $$ --- 190,203 ---- @end example @end ifinfo ! For example, @code{dgram (@var{a}, @var{b})} returns the discrete ! controllability gramian and @code{dgram (@var{a}', @var{c}')} returns ! the observability gramian. @end deftypefn ! @deftypefn {Function File} {[@var{l}, @var{m}, @var{p}, @var{e}] =} dlqe (@var{a}, @var{g}, @var{c}, @var{sigw}, @var{sigv}, @var{z}) ! Construct the linear quadratic estimator (Kalman filter) for the ! discrete time system @iftex @tex $$ *************** *** 193,211 **** @end ifinfo @noindent ! Returns: ! @var{l} is the observer gain, @code{(A - A L C)} is stable. ! @var{m} is the Ricatti equation solution. ! @var{p} is the estimate error covariance after the measurement update. ! @var{e} are the closed loop poles of @code{(A - A L C)}. @end deftypefn ! @deftypefn {Function File} {} dlqr (@var{a}, @var{b}, @var{q}, @var{r} [, @var{z}]) ! Linear quadratic regulator design for the discrete time system @iftex @tex $$ --- 239,280 ---- @end ifinfo @noindent ! The following values are returned: ! @table @var ! @item l ! The observer gain, ! @iftex ! @tex ! $(A - ALC)$. ! @end tex ! @end iftex ! @ifinfo ! (@var{a} - @var{a}@var{l}@var{c}). ! @end ifinfo ! is stable. ! @item m ! The Riccati equation solution. ! @item p ! The estimate error covariance after the measurement update. ! @item e ! The closed loop poles of ! @iftex ! @tex ! $(A - ALC)$. ! @end tex ! @end iftex ! @ifinfo ! (@var{a} - @var{a}@var{l}@var{c}). ! @end ifinfo ! @end table @end deftypefn ! @deftypefn {Function File} {[@var{k}, @var{p}, @var{e}] =} dlqr (@var{a}, @var{b}, @var{q}, @var{r}, @var{z}) ! Construct the linear quadratic regulator for the discrete time system @iftex @tex $$ *************** *** 221,271 **** @end ifinfo to minimize the cost functional @example ! J = Sum [ x' Q x + u' R u ], Z omitted @end example @noindent ! or @example ! J = Sum [ x' Q x + u' R u +2 x' Z u ], Z included @end example ! @noindent ! Returns: ! @var{k} is the state feedback gain, @code{(A - B K)} is stable. ! @var{p} is the solution of algebraic Riccati equation. ! @var{e} are the closed loop poles of @var{(A - B K)}. @end deftypefn @deftypefn {Function File} {} dlyap (@var{a}, @var{b}) Solve the discrete-time Lyapunov equation ! ! @example ! a x a' - x + b = 0 ! @end example ! ! @noindent for square matrices @var{a}, @var{b}. If @var{b} is not square, then the function attempts to solve either ! ! @example ! a x a' - x + b b' = 0 ! @end example ! ! @noindent ! or ! ! @example ! a' x a - x + b' b = 0 ! @end example ! ! @noindent whichever is appropriate. Uses Schur decomposition method as in Kitagawa, International Journal of --- 290,377 ---- @end ifinfo to minimize the cost functional + @iftex + @tex + $$ + J = \sum x^T Q x + u^T R u + $$ + @end tex + @end iftex + @ifinfo @example ! J = Sum (x' Q x + u' R u) @end example + @end ifinfo @noindent ! @var{z} omitted or ! @iftex ! @tex ! $$ ! J = \sum x^T Q x + u^T R u + 2 x^T Z u ! $$ ! @end tex ! @end iftex ! @ifinfo @example ! J = Sum (x' Q x + u' R u + 2 x' Z u) @end example ! @end ifinfo ! @var{z} included. ! The following values are returned: ! @table @var ! @item k ! The state feedback gain, ! @iftex ! @tex ! $(A - B K)$ ! @end tex ! @end iftex ! @ifinfo ! (@var{a} - @var{b}@var{k}) ! @end ifinfo ! is stable. ! ! @item p ! The solution of algebraic Riccati equation. ! @item e ! The closed loop poles of ! @iftex ! @tex ! $(A - B K)$. ! @end tex ! @end iftex ! @ifinfo ! (@var{a} - @var{b}@var{k}). ! @end ifinfo ! @end table @end deftypefn @deftypefn {Function File} {} dlyap (@var{a}, @var{b}) Solve the discrete-time Lyapunov equation ! @iftex ! @tex ! $AXA^T - X + B = 0$ ! @end tex ! @end iftex ! @ifinfo ! @code{a x a' - x + b = 0} ! @end ifinfo for square matrices @var{a}, @var{b}. If @var{b} is not square, then the function attempts to solve either ! @iftex ! $AXA^T - X + B B^T = 0$ or $A^TXA - X + B^TB = 0$, ! @tex ! @end tex ! @ifinfo ! @code{a x a' - x + b b' = 0} or @code{a' x a - x + b' b = 0}, ! @end ifinfo whichever is appropriate. Uses Schur decomposition method as in Kitagawa, International Journal of *************** *** 274,320 **** @end deftypefn @deftypefn {Function File} {} is_controllable (@var{a}, @var{b}, @var{tol}) ! If the pair (a, b) is controllable, then return value 1. ! Otherwise, returns a value of 0. ! @var{tol} is a roundoff parameter, set to @code{2*eps} if omitted. ! ! Currently just constructs the controllability matrix and checks rank. ! A better method is as follows (Boley and Golub, Systems and Control ! Letters, 1984): Controllability is determined by applying Arnoldi ! iteration with complete re-orthogonalization to obtain an orthogonal ! basis of the Krylov subspace ! @iftex ! @tex ! $$ ! {\rm span} \left(\left[b~ab~\ldots~a^{n-1}b\right]\right) ! $$ ! @end tex ! @end iftex ! @ifinfo ! ! @example ! n-1 ! span ([b, a*b, ..., a^ *b]). ! @end example ! @end ifinfo @end deftypefn @deftypefn {Function File} {} is_observable (@var{a}, @var{c}, @var{tol}) ! Returns 1 if the pair @code{(a, c)} is observable. ! Otherwise, returns a value of 0. ! @end deftypefn ! ! @deftypefn {Function File} {} lqe (@var{a}, @var{g}, @var{c}, @var{sigw}, @var{sigv}, @var{z}) ! @example ! [k, p, e] = lqe (a, g, c, sigw, sigv, z) ! @end example ! Linear quadratic estimator (Kalman filter) design for the continuous ! time system @iftex @tex $$ --- 380,407 ---- @end deftypefn @deftypefn {Function File} {} is_controllable (@var{a}, @var{b}, @var{tol}) + Return 1 if the pair (@var{a}, @var{b}) is controllable. Otherwise, + return 0. ! The optional argument @var{tol} is a roundoff parameter. If it is ! omitted, a value of @code{2*eps} is used. ! Currently, @code{is_controllable} just constructs the controllability ! matrix and checks rank. @end deftypefn @deftypefn {Function File} {} is_observable (@var{a}, @var{c}, @var{tol}) ! Return 1 if the pair (@var{a}, @var{c}) is observable. ! Otherwise, return0. ! The optional argument @var{tol} is a roundoff parameter. If it is ! omitted, a value of @code{2*eps} is used. ! @end deftypefn ! @deftypefn {Function File} {[@var{k}, @var{p}, @var{e}] =} lqe (@var{a}, @var{g}, @var{c}, @var{sigw}, @var{sigv}, @var{z}) ! Construct the linear quadratic estimator (Kalman filter) for the ! continuous time system @iftex @tex $$ *************** *** 336,342 **** @end example @end ifinfo ! where @var{w}, @var{v} are zero-mean gaussian noise processes with respective intensities @example --- 423,429 ---- @end example @end ifinfo ! where @var{w} and @var{v} are zero-mean gaussian noise processes with respective intensities @example *************** *** 344,368 **** sigv = cov (v, v) @end example ! @noindent ! @var{z} (if specified) is the cross-covariance ! @code{cov (@var{w}, @var{v})}; the default value is ! @code{cov (@var{w}, @var{v}) = 0}. Observer structure is @code{dz/dt = A z + B u + k (y - C z - D u)} ! returns: ! @var{k} is observer gain: @code{(A - K C)} is stable. ! @var{p} is solution of algebraic Riccati equation. ! @var{e} is the vector of closed loop poles of @code{(A - K C)}. @end deftypefn ! @deftypefn {Function File} {} lqr (@var{a}, @var{b}, @var{q}, @var{r}, @var{z}) ! @deftypefnx {Function File} {[@var{k}, @var{p}, @var{e}] =} lqr (@var{a}, @var{b}, @var{q}, @var{r}, @var{z}) ! Linear quadratic regulator design for the continuous time system @iftex @tex $$ --- 431,475 ---- sigv = cov (v, v) @end example ! The optional argument @var{z} is the cross-covariance ! @code{cov (@var{w}, @var{v})}. If it is omitted, ! @code{cov (@var{w}, @var{v}) = 0} is assumed. Observer structure is @code{dz/dt = A z + B u + k (y - C z - D u)} ! The following values are returned: ! @table @var ! @item k ! The observer gain, ! @iftex ! @tex ! $(A - K C)$ ! @end tex ! @end iftex ! @ifinfo ! (@var{a} - @var{k}@var{c}) ! @end ifinfo ! is stable. ! @item p ! The solution of algebraic Riccati equation. ! @item e ! The vector of closed loop poles of ! @iftex ! @tex ! $(A - K C)$. ! @end tex ! @end iftex ! @ifinfo ! (@var{a} - @var{k}@var{c}). ! @end ifinfo ! @end table @end deftypefn ! @deftypefn {Function File} {[@var{k}, @var{p}, @var{e}] =} lqr (@var{a}, @var{b}, @var{q}, @var{r}, @var{z}) ! construct the linear quadratic regulator for the continuous time system @iftex @tex $$ *************** *** 383,389 **** @iftex @tex $$ ! J = \int_0^\infty x' Q x + u' R u $$ @end tex @end iftex --- 490,496 ---- @iftex @tex $$ ! J = \int_0^\infty x^T Q x + u^T R u $$ @end tex @end iftex *************** *** 403,409 **** @iftex @tex $$ ! J = \int_0^\infty x' Q x + u' R u + 2 x' Z u $$ @end tex @end iftex --- 510,516 ---- @iftex @tex $$ ! J = \int_0^\infty x^T Q x + u^T R u + 2 x^T Z u $$ @end tex @end iftex *************** *** 418,479 **** @end example @end ifinfo ! @var{z} included ! @noindent ! Returns: ! @var{k} is state feedback gain: @code{(A - B K)} is stable. ! @var{p} is the stabilizing solution of appropriate algebraic Riccati ! equation. ! @var{e} is the vector of the closed loop poles of @code{(A - B K)}. @end deftypefn @deftypefn {Function File} {} lyap (@var{a}, @var{b}, @var{c}) Solve the Lyapunov (or Sylvester) equation via the Bartels-Stewart algorithm (Communications of the ACM, 1972). ! If @code{(a, b, c)} are specified, then @code{lyap} returns the solution ! of the Sylvester equation @example a x + x b + c = 0 @end example If only @code{(a, b)} are specified, then @code{lyap} returns the solution of the Lyapunov equation @example a' x + x a + b = 0 @end example If @var{b} is not square, then @code{lyap} returns the solution of either @example a' x + x a + b' b = 0 @end example @noindent or @example a x + x a' + b b' = 0 @end example @noindent whichever is appropriate. - - Solves by using the Bartels-Stewart algorithm (1972). @end deftypefn ! @deftypefn {Function File} {} tzero (@var{a}, @var{b}, @var{c}, @var{d}, @var{bal}) ! Compute the transmission zeros of [A, B, C, D]. ! ! @var{bal} = balancing option (see balance); default is @code{"B"}. ! Needs to incorporate @code{mvzero} algorithm to isolate finite zeros; ! see Hodel, @cite{Computation of System Zeros with Balancing}, Linear ! Algebra and its Applications, July 1993. @end deftypefn --- 525,645 ---- @end example @end ifinfo ! @var{z} included. ! The following values are returned: ! @table @var ! @item k ! The state feedback gain, ! @iftex ! $(A - B K)$ ! @tex ! @end tex ! @end iftex ! @ifinfo ! (@var{a} - @var{b}@var{k}) ! @end ifinfo ! is stable. ! @item p ! The stabilizing solution of appropriate algebraic Riccati equation. ! @item e ! The vector of the closed loop poles of ! @iftex ! @tex ! $(A - B K)$. ! @end tex ! @end iftex ! @ifinfo ! (@var{a} - @var{b}@var{k}). ! @end ifinfo ! @end table @end deftypefn @deftypefn {Function File} {} lyap (@var{a}, @var{b}, @var{c}) Solve the Lyapunov (or Sylvester) equation via the Bartels-Stewart algorithm (Communications of the ACM, 1972). ! If @var{a}, @var{b}, and @var{c} are specified, then @code{lyap} returns ! the solution of the Sylvester equation ! @iftex ! @tex ! $$ ! A X + X B + C = 0 ! $$ ! @end tex ! @end iftex ! @ifinfo @example a x + x b + c = 0 @end example + @end ifinfo If only @code{(a, b)} are specified, then @code{lyap} returns the solution of the Lyapunov equation + @iftex + @tex + $$ + A^T X + X A + B = 0 + $$ + @end tex + @end iftex + @ifinfo @example a' x + x a + b = 0 @end example + @end ifinfo If @var{b} is not square, then @code{lyap} returns the solution of either + @iftex + @tex + $$ + A^T X + X A + B^T B = 0 + $$ + @end tex + @end iftex + @ifinfo @example a' x + x a + b' b = 0 @end example + @end ifinfo @noindent or + @iftex + @tex + $$ + A X + X A^T + B B^T = 0 + $$ + @end tex + @end iftex + @ifinfo @example a x + x a' + b b' = 0 @end example + @end ifinfo @noindent whichever is appropriate. @end deftypefn ! @deftypefn {Function File} {} tzero (@var{a}, @var{b}, @var{c}, @var{d}, @var{opt}) ! Compute the transmission zeros of ! @iftex ! @tex ! $[A, B, C, D]$. ! @end tex ! @end iftex ! @ifinfo ! [A, B, C, D]. ! @end ifinfo ! The optional argument @var{opt} is passed to the eigenvalue balancing ! routine. If it is omitted, a value of @code{"B"} is assumed. @end deftypefn diff -cNr octave-2.0.2/doc/interpreter/cp-idx.texi octave-2.0.3/doc/interpreter/cp-idx.texi *** octave-2.0.2/doc/interpreter/cp-idx.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/cp-idx.texi Sun Feb 16 22:48:25 1997 *************** *** 1,4 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. --- 1,4 ---- ! @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. diff -cNr octave-2.0.2/doc/interpreter/data.texi octave-2.0.3/doc/interpreter/data.texi *** octave-2.0.2/doc/interpreter/data.texi Wed Dec 31 18:00:00 1969 --- octave-2.0.3/doc/interpreter/data.texi Tue Feb 18 01:25:35 1997 *************** *** 0 **** --- 1,176 ---- + @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 Data Types, Numeric Data Types, Getting Started, Top + @chapter Data Types + @cindex data types + + All versions of Octave include a number of built-in data types, + including real and complex scalars and matrices, character strings, and + a data structure type. + + It is also possible to define new specialized data types by writing a + small amount of C++ code. On some systems, new data types can be loaded + dynamically while Octave is running, so it is not necessary to recompile + all of Octave just to add a new type. @xref{Dynamically Linked + Functions} for more information about Octave's dynamic linking + capabilities. @ref{User-defined Data Types} describes what you must do + to define a new data type for Octave. + + @menu + * Built-in Data Types:: + * User-defined Data Types:: + * Object Sizes:: + @end menu + + @node Built-in Data Types, User-defined Data Types, Data Types, Data Types + @section Built-in Data Types + @cindex data types, built-in + @cindex built-in data types + + The standard built-in data types are real and complex scalars and + matrices, ranges, character strings, and a data structure type. + Additional built-in data types may be added in future versions. If you + need a specialized data type that is not currently provided as a + built-in type, you are encouraged to write your own user-defined data + type and contribute it for distribution in a future release of Octave. + + @menu + * Numeric Objects:: + * String Objects:: + * Data Structure Objects:: + @end menu + + @node Numeric Objects, String Objects, Built-in Data Types, Built-in Data Types + @subsection Numeric Objects + @cindex numeric constant + @cindex numeric value + + Octave's built-in numeric objects include real and complex scalars and + matrices. All built-in numeric data is currently stored as double + precision numbers. On systems that use the IEEE floating point format, + values in the range of approximately + @iftex + @tex + $2.2251\times10^{-308}$ to $1.7977\times10^{308}$ + @end tex + @end iftex + @ifinfo + 2.2251e-308 to 1.7977e+308 + @end ifinfo + can be stored, and the relative precision is approximately + @iftex + @tex + $2.2204\times10^{-16}$. + @end tex + @end iftex + @ifinfo + 2.2204e-16. + @end ifinfo + The exact values are given by the variables @code{realmin}, + @code{realmax}, and @code{eps}, respectively. + + Matrix objects can be of any size, and can be dynamically reshaped and + resized. It is easy to extract individual rows, columns, or submatrices + is using a variety of powerful indexing features. @xref{Index Expressions}. + + @xref{Numeric Data Types}, for more information. + + @node String Objects, Data Structure Objects, Numeric Objects, Built-in Data Types + @subsection String Objects + @cindex strings + @cindex character strings + @opindex " + @opindex ' + + A character string in Octave consists of a sequence of characters + enclosed in either double-quote or single-quote marks. Internally, + Octave currently stores strings as matrices of characters. All the + indexing operations that work for matrix objects also work for strings. + + @xref{Strings}, for more information. + + @node Data Structure Objects, , String Objects, Built-in Data Types + @subsection Data Structure Objects + @cindex structures + @cindex data structures + + Octave's data structure type can help you to organize related objects of + different types. The current implementation uses an associative array + with indices limited to strings, but the syntax is more like C-style + structures. + + @xref{Data Structures}, for more information. + + @node User-defined Data Types, Object Sizes, Built-in Data Types, Data Types + @section User-defined Data Types + @cindex user-defined data types + @cindex data types, user-defined + + Someday I hope to expand this to include a complete description of + Octave's mechanism for managing user-defined data types. Until this + feature is documented here, you will have to make do by reading the code + in the @file{ov.h}, @file{ops.h}, and related files from Octave's + @file{src} directory. + + @node Object Sizes, , User-defined Data Types, Data Types + @section Object Sizes + + The following functions allow you to determine the size of a variable or + expression. These functions are defined for all objects. They return + @minus{}1 when the operation doesn't make sense. For example, Octave's + data structure type doesn't have rows or columns, so the @code{rows} and + @code{columns} functions return @minus{}1 for structure arguments. + + @deftypefn {Function File} {} columns (@var{a}) + Return the number of columns of @var{a}. + @end deftypefn + + @deftypefn {Function File} {} rows (@var{a}) + Return the number of rows of @var{a}. + @end deftypefn + + @deftypefn {Function File} {} length (@var{a}) + Return the number of rows of @var{a} or the number of columns of + @var{a}, whichever is larger. + @end deftypefn + + @deftypefn {Function File} {} size (@var{a}, @var{n}) + Return the number rows and columns of @var{a}. + + With one input argument and one output argument, the result is returned + in a 2 element row vector. If there are two output arguments, the + number of rows is assigned to the first, and the number of columns to + the second. For example, + + @example + @group + size ([1, 2; 3, 4; 5, 6]) + @result{} [ 3, 2 ] + + [nr, nc] = size ([1, 2; 3, 4; 5, 6]) + + @result{} nr = 3 + + @result{} nc = 2 + @end group + @end example + + If given a second argument of either 1 or 2, @code{size} will return + only the row or column dimension. For example + + @example + size ([1, 2; 3, 4; 5, 6], 2) + @result{} 2 + @end example + + @noindent + returns the number of columns in the given matrix. + @end deftypefn + + @deftypefn {Function File} {} isempty (@var{a}) + Return 1 if @var{a} is an empty matrix (either the number of rows, or + the number of columns, or both are zero). Otherwise, return 0. + @end deftypefn + diff -cNr octave-2.0.2/doc/interpreter/diffeq.texi octave-2.0.3/doc/interpreter/diffeq.texi *** octave-2.0.2/doc/interpreter/diffeq.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/diffeq.texi Tue Feb 18 01:45:32 1997 *************** *** 1,8 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Differential Equations, Optimization, Nonlinear Equations, Top @chapter Differential Equations Octave has two built-in functions for solving differential equations. --- 1,8 ---- ! @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 Differential Equations, Optimization, Quadrature, Top @chapter Differential Equations Octave has two built-in functions for solving differential equations. *************** *** 38,48 **** @end ifinfo @noindent ! using Hindmarsh's ODE solver LSODE. ! @deftypefn {Lodable Function} {} lsode (@var{fcn}, @var{x0}, @var{t_out}, @var{t_crit}) ! The first argument is the name of the function to call to ! compute the vector of right hand sides. It must have the form @example @var{xdot} = f (@var{x}, @var{t}) --- 38,55 ---- @end ifinfo @noindent ! using Hindmarsh's ODE solver @sc{Lsode}. ! @deftypefn {Loadable Function} {} lsode (@var{fcn}, @var{x0}, @var{t}, @var{t_crit}) ! Return a matrix of @var{x} as a function of @var{t}, given the initial ! state of the system @var{x0}. Each row in the result matrix corresponds ! to one of the elements in the vector @var{t}. The first element of ! @var{t} corresponds to the initial state @var{x0}, so that the first row ! of the output is @var{x0}. ! ! The first argument, @var{fcn}, is a string that names the function to ! call to compute the vector of right hand sides for the set of equations. ! It must have the form @example @var{xdot} = f (@var{x}, @var{t}) *************** *** 51,104 **** @noindent where @var{xdot} and @var{x} are vectors and @var{t} is a scalar. - The second argument specifies the initial condition, and the third - specifies a vector of output times at which the solution is desired, - including the time corresponding to the initial condition. - The fourth argument is optional, and may be used to specify a set of times that the ODE solver should not integrate past. It is useful for avoiding difficulties with singularities and points where there is a discontinuity in the derivative. ! Here is an example of solving a set of two differential equations using ! @code{lsode}. The function @example ! function xdot = f (x, t) ! r = 0.25; ! k = 1.4; ! a = 1.5; ! b = 0.16; ! c = 0.9; ! d = 0.8; ! xdot(1) = r*x(1)*(1 - x(1)/k) - a*x(1)*x(2)/(1 + b*x(1)); ! xdot(2) = c*a*x(1)*x(2)/(1 + b*x(1)) - d*x(2); endfunction @end example @noindent ! is integrated with the command @example ! x = lsode ("f", [1; 2], (t = linspace (0, 50, 200)')); @end example ! @noindent ! producing a set of 200 values stored in the variable @var{x}. Note that ! this example takes advantage of the fact that an assignment produces a ! value to store the values of the output times in the variable @var{t} ! directly in the function call The results can then be plotted using ! the command @example ! plot (t, x) @end example - @end deftypefn ! @deftypefn {Lodable Function} {} lsode_options (@var{opt}, @var{val}) When called with two arguments, this function allows you set options parameters for the function @code{lsode}. Given one argument, @code{lsode_options} returns the value of the corresponding option. If --- 58,113 ---- @noindent where @var{xdot} and @var{x} are vectors and @var{t} is a scalar. The fourth argument is optional, and may be used to specify a set of times that the ODE solver should not integrate past. It is useful for avoiding difficulties with singularities and points where there is a discontinuity in the derivative. + @end deftypefn ! Here is an example of solving a set of three differential equations using ! @code{lsode}. Given the function ! ! @cindex oregonator @example ! @group ! function xdot = f (x, t) ! xdot = zeros (3,1); ! xdot(1) = 77.27 * (x(2) - x(1)*x(2) + x(1) \ ! - 8.375e-06*x(1)^2); ! xdot(2) = (x(3) - x(1)*x(2) - x(2)) / 77.27; ! xdot(3) = 0.161*(x(1) - x(3)); endfunction + @end group @end example @noindent ! and the initial condition @code{x0 = [ 4; 1.1; 4 ]}, the set of ! equations can be integrated using the command @example ! @group ! t = linspace (0, 500, 1000); ! ! y = lsode ("f", x0, t); ! @end group @end example ! If you try this, you will see that the value of the result changes ! dramatically between @var{t} = 0 and 5, and again around @var{t} = 305. ! A more efficient set of output points might be @example ! @group ! t = [0, logspace (-1, log10(303), 150), \ ! logspace (log10(304), log10(500), 150)]; ! @end group @end example ! @deftypefn {Loadable Function} {} lsode_options (@var{opt}, @var{val}) When called with two arguments, this function allows you set options parameters for the function @code{lsode}. Given one argument, @code{lsode_options} returns the value of the corresponding option. If *************** *** 108,114 **** See Alan C. Hindmarsh, @cite{ODEPACK, A Systematized Collection of ODE Solvers}, in Scientific Computing, R. S. Stepleman, editor, (1983) for ! more information about this family of ODE solvers. @node Differential-Algebraic Equations, , Ordinary Differential Equations, Differential Equations @section Differential-Algebraic Equations --- 117,123 ---- See Alan C. Hindmarsh, @cite{ODEPACK, A Systematized Collection of ODE Solvers}, in Scientific Computing, R. S. Stepleman, editor, (1983) for ! more information about the inner workings of @code{lsode}. @node Differential-Algebraic Equations, , Ordinary Differential Equations, Differential Equations @section Differential-Algebraic Equations *************** *** 128,136 **** @end example @end ifinfo ! @deftypefn {Loadable Function} {[@var{x}, @var{xdot}] =} dassl (@var{fcn}, @var{x_0}, @var{xdot_0}, @var{t_out}, @var{t_crit}) ! The first argument is the name of the function to call to ! compute the vector of residuals. It must have the form @example @var{res} = f (@var{x}, @var{xdot}, @var{t}) --- 137,156 ---- @end example @end ifinfo ! @noindent ! using Petzold's DAE solver @sc{Dassl}. ! ! @deftypefn {Loadable Function} {[@var{x}, @var{xdot}] =} dassl (@var{fcn}, @var{x0}, @var{xdot0}, @var{t}, @var{t_crit}) ! Return a matrix of states and their first derivatives with respect to ! @var{t}. Each row in the result matrices correspond to one of the ! elements in the vector @var{t}. The first element of @var{t} ! corresponds to the initial state @var{x0} and derivative @var{xdot0}, so ! that the first row of the output @var{x} is @var{x0} and the first row ! of the output @var{xdot} is @var{xdot0}. ! ! The first argument, @var{fcn}, is a string that names the function to ! call to compute the vector of residuals for the set of equations. ! It must have the form @example @var{res} = f (@var{x}, @var{xdot}, @var{t}) *************** *** 146,152 **** including the time corresponding to the initial condition. The set of initial states and derivatives are not strictly required to ! be consistent. In practice, however, DASSL is not very good at determining a consistent set for you, so it is best if you ensure that the initial values result in the function evaluating to zero. --- 166,172 ---- including the time corresponding to the initial condition. The set of initial states and derivatives are not strictly required to ! be consistent. In practice, however, @sc{Dassl} is not very good at determining a consistent set for you, so it is best if you ensure that the initial values result in the function evaluating to zero. *************** *** 166,169 **** See K. E. Brenan, et al., @cite{Numerical Solution of Initial-Value Problems in Differential-Algebraic Equations}, North-Holland (1989) for ! more information about the implementation of DASSL. --- 186,189 ---- See K. E. Brenan, et al., @cite{Numerical Solution of Initial-Value Problems in Differential-Algebraic Equations}, North-Holland (1989) for ! more information about the implementation of @sc{Dassl}. diff -cNr octave-2.0.2/doc/interpreter/emacs.texi octave-2.0.3/doc/interpreter/emacs.texi *** octave-2.0.2/doc/interpreter/emacs.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/emacs.texi Mon Feb 17 00:48:12 1997 *************** *** 4,11 **** @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Emacs, Installation, Amusements, Top ! @chapter Using Emacs With Octave The development of Octave code can greatly be facilitated using Emacs with Octave mode, a major mode for editing Octave files which can e.g.@: --- 4,11 ---- @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Emacs, Grammar, Installation, Top ! @appendix Using Emacs With Octave The development of Octave code can greatly be facilitated using Emacs with Octave mode, a major mode for editing Octave files which can e.g.@: *************** *** 24,31 **** All functionality is provided by the Emacs Lisp package @file{octave}. This chapter describes how to set up and use this package. ! Please contact if you have any questions ! or suggestions on using Emacs with Octave. @menu * Installing the Emacs Octave Package:: --- 24,31 ---- All functionality is provided by the Emacs Lisp package @file{octave}. This chapter describes how to set up and use this package. ! Please contact @email{Kurt.Hornik@@ci.tuwien.ac.at} if you have any ! questions or suggestions on using Emacs with Octave. @menu * Installing the Emacs Octave Package:: *************** *** 35,46 **** @end menu @node Installing the Emacs Octave Package, Using Octave Mode, Emacs, Emacs ! @section Installing the Emacs Octave Package ! The Emacs package @file{octave} consists of the three files ! @file{octave-mod.el}, @file{octave-inf.el}, and @file{octave-hlp.el}. ! These files, or better yet their byte-compiled versions, should be ! somewhere in your Emacs load-path. If you have GNU Emacs with a version number at least as high as 19.35, you are all set up, because the package is respectively will be part of --- 35,46 ---- @end menu @node Installing the Emacs Octave Package, Using Octave Mode, Emacs, Emacs ! @appendixsec Installing the Emacs Octave Package ! The Emacs package @file{octave} consists of @file{octave-mod.el}, ! @file{octave-inf.el}, and @file{octave-hlp.el}. These files, or better ! yet their byte-compiled versions, should be somewhere in your Emacs ! load-path. If you have GNU Emacs with a version number at least as high as 19.35, you are all set up, because the package is respectively will be part of *************** *** 52,58 **** if you want. @node Using Octave Mode, Running Octave From Within Emacs, Installing the Emacs Octave Package, Emacs ! @section Using Octave Mode If you are lucky, your sysadmins have already arranged everything so that Emacs automatically goes into Octave mode whenever you visit an --- 52,58 ---- if you want. @node Using Octave Mode, Running Octave From Within Emacs, Installing the Emacs Octave Package, Emacs ! @appendixsec Using Octave Mode If you are lucky, your sysadmins have already arranged everything so that Emacs automatically goes into Octave mode whenever you visit an *************** *** 68,74 **** @lisp (autoload 'octave-mode "octave-mod" nil t) (setq auto-mode-alist ! (cons '(\"\\\\.m$\" . octave-mode) auto-mode-alist)) @end lisp @item --- 68,74 ---- @lisp (autoload 'octave-mode "octave-mod" nil t) (setq auto-mode-alist ! (cons '("\\.m$" . octave-mode) auto-mode-alist)) @end lisp @item *************** *** 267,278 **** (defun RET-behaves-as-LFD () (let ((x (key-binding "\C-j"))) (local-set-key "\C-m" x))) ! (add-hook 'octave-mode-hook 'return-behaves-as-LFD) @end lisp @noindent (this works for all modes by adding to the startup hooks, without having to know the particular binding of @key{RET} in that mode!). Similar ! considerations apply for using @key{M-RET} as @key{M-LFD}. As Barry A. Warsaw says in the documentation for his @code{cc-mode}, ``This is a very common question. @code{:-)} If you want this to be the default behavior, don't lobby me, lobby RMS!'' --- 267,278 ---- (defun RET-behaves-as-LFD () (let ((x (key-binding "\C-j"))) (local-set-key "\C-m" x))) ! (add-hook 'octave-mode-hook 'RET-behaves-as-LFD) @end lisp @noindent (this works for all modes by adding to the startup hooks, without having to know the particular binding of @key{RET} in that mode!). Similar ! considerations apply for using @kbd{M-RET} as @kbd{M-LFD}. As Barry A. Warsaw says in the documentation for his @code{cc-mode}, ``This is a very common question. @code{:-)} If you want this to be the default behavior, don't lobby me, lobby RMS!'' *************** *** 343,349 **** reproducible test case and send the message. @node Running Octave From Within Emacs, Using the Emacs Info Reader for Octave, Using Octave Mode, Emacs ! @section Running Octave From Within Emacs The package @file{octave} provides commands for running an inferior Octave process in a special Emacs buffer. Use --- 343,349 ---- reproducible test case and send the message. @node Running Octave From Within Emacs, Using the Emacs Info Reader for Octave, Using Octave Mode, Emacs ! @appendixsec Running Octave From Within Emacs The package @file{octave} provides commands for running an inferior Octave process in a special Emacs buffer. Use *************** *** 454,470 **** @end quotation @node Using the Emacs Info Reader for Octave, , Running Octave From Within Emacs, Emacs ! @section Using the Emacs Info Reader for Octave ! You can also set up the Emacs Info reader for dealing with the results ! of Octave's @samp{help -i}. For this, the package @file{gnuserv} needs ! to be installed, which unfortunately still does not come with GNU Emacs ! (it does with XEmacs). It can be retrieved from any GNU Emacs Lisp Code ! Directory archive, e.g.@: ! @file{ftp://ftp.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive}, in the @file{packages} subdirectory. The alpha version of an enhanced version of gnuserv is available at ! @file{ftp://ftp.wellfleet.com/netman/psmith/emacs/gnuserv-2.1alpha.tar.gz}. If @file{gnuserv} is installed, add the lines @lisp --- 454,468 ---- @end quotation @node Using the Emacs Info Reader for Octave, , Running Octave From Within Emacs, Emacs ! @appendixsec Using the Emacs Info Reader for Octave ! You can also have Octave's @kbd{help -i} command invoke the Emacs Info ! reader. To do this, you'll need @file{gnuserv}, which can be retrieved ! from any GNU Emacs Lisp Code Directory archive, e.g.@: ! @url{ftp://ftp.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive}, in the @file{packages} subdirectory. The alpha version of an enhanced version of gnuserv is available at ! @url{ftp://ftp.wellfleet.com/netman/psmith/emacs/gnuserv-2.1alpha.tar.gz}. If @file{gnuserv} is installed, add the lines @lisp *************** *** 484,490 **** this case, set @code{INFO_PROGRAM} to @code{"info-emacs-octave-help"}. If you use Octave from within Emacs, these settings are best done in the ! @file{~/.emacs-octave} startup file (or the file pointed to by the Emacs variable @code{inferior-octave-startup-file}). @c Local Variables: --- 482,488 ---- this case, set @code{INFO_PROGRAM} to @code{"info-emacs-octave-help"}. If you use Octave from within Emacs, these settings are best done in the ! startup file @file{~/.emacs-octave} (or the file pointed to by the Emacs variable @code{inferior-octave-startup-file}). @c Local Variables: diff -cNr octave-2.0.2/doc/interpreter/errors.texi octave-2.0.3/doc/interpreter/errors.texi *** octave-2.0.2/doc/interpreter/errors.texi Wed Dec 31 18:00:00 1969 --- octave-2.0.3/doc/interpreter/errors.texi Tue Feb 18 01:47:22 1997 *************** *** 0 **** --- 1,140 ---- + @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 Error Handling, Input and Output, Functions and Scripts, Top + @chapter Error Handling + + Octave includes several functions for printing error and warning + messages. When you write functions that need to take special action + when they encounter abnormal conditions, you should print the error + messages using the functions described in this chapter. + + @deftypefn {Built-in Function} {} error (@var{template}, @dots{}) + The @code{error} function formats the optional arguments under the + control of the template string @var{template} using the same rules as + the @code{printf} family of functions (@pxref{Formatted Output}). + The resulting message is prefixed by the string @samp{error: } and + printed on the @code{stderr} stream. + + Calling @code{error} also sets Octave's internal error state such that + control will return to the top level without evaluating any more + commands. This is useful for aborting from functions or scripts. + + If the error message does not end with a new line character, Octave will + print a traceback of all the function calls leading to the error. For + example, given the following function definitions: + + @example + @group + function f () g () end + function g () h () end + function h () nargin == 1 || error ("nargin != 1"); end + @end group + @end example + + @noindent + calling the function @code{f} will result in a list of messages that + can help you to quickly locate the exact location of the error: + + @example + @group + f () + error: nargin != 1 + error: evaluating index expression near line 1, column 30 + error: evaluating binary operator `||' near line 1, column 27 + error: called from `h' + error: called from `g' + error: called from `f' + @end group + @end example + + If the error message ends in a new line character, Octave will print the + message but will not display any traceback messages as it returns + control to the top level. For example, modifying the error message + in the previous example to end in a new line causes Octave to only print + a single message: + + @example + @group + function h () nargin == 1 || error ("nargin != 1\n"); end + f () + error: nargin != 1 + @end group + @end example + @end deftypefn + + @defvr {Built-in Variable} error_text + This variable contains the the text of error messages that would have + been printed in the body of the most recent @code{unwind_protect} or + @code{try} statement or the @var{try} part of the most recent call to + the @code{eval} function. Outside of the @code{unwind_protect} and + @code{try} statements or the @code{eval} function, or if no error has + occurred within them, the value of @code{error_text} is guaranteed to be + the empty string. + + Note that the message does not include the first @samp{error: } prefix, + so that it may easily be passed to the @code{error} function without + additional processing@footnote{Yes, it's a kluge, but it seems to be a + reasonably useful one.}. + + @xref{The try Statement} and @ref{The unwind_protect Statement}. + @end defvr + + @defvr {Built-in Variable} beep_on_error + If the value of @code{beep_on_error} is nonzero, Octave will try + to ring your terminal's bell before printing an error message. The + default value is 0. + @end defvr + + @deftypefn {Built-in Function} {} warning (@var{msg}) + Print a warning message @var{msg} prefixed by the string @samp{warning: }. + After printing the warning message, Octave will continue to execute + commands. You should use this function should when you want to notify + the user of an unusual condition, but only when it makes sense for your + program to go on. + @end deftypefn + + @deftypefn {Built-in Function} {} usage (@var{msg}) + Print the message @var{msg}, prefixed by the string @samp{usage: }, and + set Octave's internal error state such that control will return to the + top level without evaluating any more commands. This is useful for + aborting from functions. + + After @code{usage} is evaluated, Octave will print a traceback of all + the function calls leading to the usage message. + + You should use this function for reporting problems errors that result + from an improper call to a function, such as calling a function with an + incorrect number of arguments, or with arguments of the wrong type. For + example, most functions distributed with Octave begin with code like + this + + @example + @group + if (nargin != 2) + usage ("foo (a, b)"); + endif + @end group + @end example + + @noindent + to check for the proper number of arguments. + @end deftypefn + + The following pair of functions are of limited usefulness, and may be + removed from future versions of Octave. + + @deftypefn {Function File} {} perror (@var{name}, @var{num}) + Print the error message for function @var{name} corresponding to the + error number @var{num}. This function is intended to be used to print + useful error messages for those functions that return numeric error + codes. + @end deftypefn + + @deftypefn {Function File} {} strerror (@var{name}, @var{num}) + Return the text of an error message for function @var{name} + corresponding to the error number @var{num}. This function is intended + to be used to print useful error messages for those functions that + return numeric error codes. + @end deftypefn diff -cNr octave-2.0.2/doc/interpreter/eval.texi octave-2.0.3/doc/interpreter/eval.texi *** octave-2.0.2/doc/interpreter/eval.texi Wed Dec 31 18:00:00 1969 --- octave-2.0.3/doc/interpreter/eval.texi Tue Feb 18 01:45:55 1997 *************** *** 0 **** --- 1,109 ---- + @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 Evaluation, Statements, Expressions, Top + @chapter Evaluation + + Normally, you evaluate expressions simply by typing them at the Octave + prompt, or by asking Octave to interpret commands that you have saved in + a file. + + Sometimes, you may find it necessary to evaluate an expression that has + been computed and stored in a string, or use a string as the name of a + function to call. The @code{eval} and @code{feval} functions allow you + to do just that, and are necessary in order to evaluate commands that + are not known until run time, or to write functions that will need to + call user-supplied functions. + + @deftypefn {Built-in Function} {} eval (@var{command}) + Parse the string @var{command} and evaluate it as if it were an Octave + program, returning the last value computed. The @var{command} is + evaluated in the current context, so any results remain available after + @code{eval} returns. For example, + + @example + @group + eval ("a = 13") + + @print{} a = 13 + + @result{} 13 + @end group + @end example + + In this case, the value of the evaluated expression is printed and it is + also returned returned from @code{eval}. Just as with any other + expression, you can turn printing off by ending the expression in a + semicolon. For example, + + @example + eval ("a = 13;") + @result{} 13 + @end example + + In this example, the variable @code{a} has been given the value 13, but + the value of the expression is not printed. + @end deftypefn + + @deftypefn {Built-in Function} {} feval (@var{name}, @dots{}) + Evaluate the function named @var{name}. Any arguments after the first + are passed on to the named function. For example, + + @example + feval ("acos", -1) + @result{} 3.1416 + @end example + + @noindent + calls the function @code{acos} with the argument @samp{-1}. + + The function @code{feval} is necessary in order to be able to write + functions that call user-supplied functions, because Octave does not + have a way to declare a pointer to a function (like C) or to declare a + special kind of variable that can be used to hold the name of a function + (like @code{EXTERNAL} in Fortran). Instead, you must refer to functions + by name, and use @code{feval} to call them. + @end deftypefn + + @cindex Fordyce, A. P. + @findex newtroot + Here is a simple-minded function using @code{feval} that finds the root + of a user-supplied function of one variable using Newton's method. + + @example + @group + function result = newtroot (fname, x) + + # usage: newtroot (fname, x) + # + # fname : a string naming a function f(x). + # x : initial guess + + delta = tol = sqrt (eps); + maxit = 200; + fx = feval (fname, x); + for i = 1:maxit + if (abs (fx) < tol) + result = x; + return; + else + fx_new = feval (fname, x + delta); + deriv = (fx_new - fx) / delta; + x = x - fx / deriv; + fx = fx_new; + endif + endfor + + result = x; + + endfunction + @end group + @end example + + Note that this is only meant to be an example of calling user-supplied + functions and should not be taken too seriously. In addition to using a + more robust algorithm, any serious code would check the number and type + of all the arguments, ensure that the supplied function really was a + function, etc. + diff -cNr octave-2.0.2/doc/interpreter/expr.texi octave-2.0.3/doc/interpreter/expr.texi *** octave-2.0.2/doc/interpreter/expr.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/expr.texi Tue Feb 18 01:49:16 1997 *************** *** 1,8 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Expressions, Statements, Invoking Octave, Top @chapter Expressions @cindex expressions --- 1,8 ---- ! @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 Expressions, Evaluation, Variables, Top @chapter Expressions @cindex expressions *************** *** 18,32 **** combinations of these with various operators. @menu - * Constant Expressions:: - * Matrices:: - * Ranges:: - * Variables:: * Index Expressions:: - * Data Structures:: * Calling Functions:: - * Global Variables:: - * Keywords:: * Arithmetic Ops:: * Comparison Ops:: * Boolean Expressions:: --- 18,25 ---- *************** *** 35,712 **** * Operator Precedence:: @end menu ! @node Constant Expressions, Matrices, Expressions, Expressions ! @section Constant Expressions ! ! The simplest type of expression is the @dfn{constant}, which always has ! the same value. There are two types of constants: numeric constants and ! string constants. ! ! @menu ! * Numeric Constants:: ! * String Constants:: ! @end menu ! ! @node Numeric Constants, String Constants, Constant Expressions, Constant Expressions ! @subsection Numeric Constants ! @cindex numeric constant ! @cindex numeric value ! ! A @dfn{numeric constant} may be a scalar, a vector, or a matrix, and it ! may contain complex values. ! ! The simplest form of a numeric constant, a scalar, is a single number ! that can be an integer, a decimal fraction, a number in scientific ! (exponential) notation, or a complex number. Note that all numeric ! values are represented within Octave in double-precision floating point ! format (complex constants are stored as pairs of double-precision ! floating point values). Here are some examples of real-valued numeric ! constants, which all have the same value: ! ! @example ! @group ! 105 ! 1.05e+2 ! 1050e-1 ! @end group ! @end example ! ! To specify complex constants, you can write an expression of the form ! ! @example ! @group ! 3 + 4i ! 3.0 + 4.0i ! 0.3e1 + 40e-1i ! @end group ! @end example ! ! all of which are equivalent. The letter @samp{i} in the previous example ! stands for the pure imaginary constant, defined as ! @iftex ! @tex ! $\sqrt{-1}$. ! @end tex ! @end iftex ! @ifinfo ! @code{sqrt (-1)}. ! @end ifinfo ! ! For Octave to recognize a value as the imaginary part of a complex ! constant, a space must not appear between the number and the @samp{i}. ! If it does, Octave will print an error message, like this: ! ! @example ! @group ! octave:13> 3 + 4 i ! ! parse error: ! ! 3 + 4 i ! ^ ! @end group ! @end example ! ! You may also use @samp{j}, @samp{I}, or @samp{J} in place of the ! @samp{i} above. All four forms are equivalent. ! ! @node String Constants, , Numeric Constants, Constant Expressions ! @subsection String Constants ! @cindex strings ! @cindex character strings ! ! @opindex " ! @opindex ' ! ! A @dfn{string constant} consists of a sequence of characters enclosed in ! either double-quote or single-quote marks. For example, both of the ! following expressions ! ! @example ! @group ! "parrot" ! 'parrot' ! @end group ! @end example ! ! @noindent ! represent the string whose contents are @samp{parrot}. Strings in ! Octave can be of any length. ! ! Since the single-quote mark is also used for the transpose operator ! (@pxref{Arithmetic Ops}) but double-quote marks have no other purpose in ! Octave, it is best to use double-quote marks to denote strings. ! ! @c XXX FIXME XXX -- this is probably pretty confusing. ! ! @cindex escape sequence notation ! Some characters cannot be included literally in a string constant. You ! represent them instead with @dfn{escape sequences}, which are character ! sequences beginning with a backslash (@samp{\}). ! ! One use of an escape sequence is to include a double-quote ! (single-quote) character in a string constant that has been defined ! using double-quote (single-quote) marks. Since a plain double-quote ! would end the string, you must use @samp{\"} to represent a single ! double-quote character as a part of the string. The backslash character ! itself is another character that cannot be included normally. You must ! write @samp{\\} to put one backslash in the string. Thus, the string ! whose contents are the two characters @samp{"\} must be written ! @code{"\"\\"}. ! ! Another use of backslash is to represent unprintable characters ! such as newline. While there is nothing to stop you from writing most ! of these characters directly in a string constant, they may look ugly. ! ! Here is a table of all the escape sequences used in Octave. They are ! the same as those used in the C programming langauge. ! ! @table @code ! @item \\ ! Represents a literal backslash, @samp{\}. ! ! @item \" ! Represents a literal double-quote character, @samp{"}. ! ! @item \' ! Represents a literal single-quote character, @samp{'}. ! ! @item \a ! Represents the ``alert'' character, control-g, ASCII code 7. ! ! @item \b ! Represents a backspace, control-h, ASCII code 8. ! ! @item \f ! Represents a formfeed, control-l, ASCII code 12. ! ! @item \n ! Represents a newline, control-j, ASCII code 10. ! ! @item \r ! Represents a carriage return, control-m, ASCII code 13. ! ! @item \t ! Represents a horizontal tab, control-i, ASCII code 9. ! ! @item \v ! Represents a vertical tab, control-k, ASCII code 11. ! ! @c We don't do octal or hex this way yet. ! @c ! @c @item \@var{nnn} ! @c Represents the octal value @var{nnn}, where @var{nnn} are one to three ! @c digits between 0 and 7. For example, the code for the ASCII ESC ! @c (escape) character is @samp{\033}.@refill ! @c ! @c @item \x@var{hh}@dots{} ! @c Represents the hexadecimal value @var{hh}, where @var{hh} are hexadecimal ! @c digits (@samp{0} through @samp{9} and either @samp{A} through @samp{F} or ! @c @samp{a} through @samp{f}). Like the same construct in @sc{ansi} C, ! @c the escape ! @c sequence continues until the first non-hexadecimal digit is seen. However, ! @c using more than two hexadecimal digits produces undefined results. (The ! @c @samp{\x} escape sequence is not allowed in @sc{posix} @code{awk}.)@refill ! @end table ! ! Strings may be concatenated using the notation for defining matrices. ! For example, the expression ! ! @example ! [ "foo" , "bar" , "baz" ] ! @end example ! ! @noindent ! produces the string whose contents are @samp{foobarbaz}. The next ! section explains more about how to create matrices. ! ! @node Matrices, Ranges, Constant Expressions, Expressions ! @section Matrices ! @cindex matrices ! ! @opindex [ ! @opindex ] ! @opindex ; ! @opindex , ! ! It is easy to define a matrix of values in Octave. The size of the ! matrix is determined automatically, so it is not necessary to explicitly ! state the dimensions. The expression ! ! @example ! a = [1, 2; 3, 4] ! @end example ! ! @noindent ! results in the matrix ! ! @iftex ! @tex ! $$ a = \left[ \matrix{ 1 & 2 \cr 3 & 4 } \right] $$ ! @end tex ! @end iftex ! @ifinfo ! @example ! @group ! ! / \ ! | 1 2 | ! a = | | ! | 3 4 | ! \ / ! ! @end group ! @end example ! @end ifinfo ! ! Elements of a matrix may be arbitrary expressions, provided that the ! dimensions all make sense when combining the various pieces. For ! example, given the above matrix, the expression ! ! @example ! [ a, a ] ! @end example ! ! @noindent ! produces the matrix ! ! @example ! @group ! ans = ! ! 1 2 1 2 ! 3 4 3 4 ! @end group ! @end example ! ! @noindent ! but the expression ! ! @example ! [ a, 1 ] ! @end example ! ! @noindent ! produces the error ! ! @example ! error: number of rows must match near line 13, column 6 ! @end example ! ! @noindent ! (assuming that this expression was entered as the first thing on line ! 13, of course). ! ! Commas and semicolons are not always required to separate matrix ! elements and rows. The expression ! ! @example ! @group ! a = [ 1 2 ! 3 4 ] ! @end group ! @end example ! ! @noindent ! is equivalent to the one above. ! ! Inside the square brackets that delimit a matrix expression, Octave ! looks at the surrounding context to determine whether spaces and newline ! characters should be converted into element and row separators, or ! simply ignored, so commands like ! ! @example ! [ linspace (1, 2) ] ! @end example ! ! @noindent ! and ! ! @example ! @group ! octave:13> a = [ 1 2 ! > 3 4 ] ! @end group ! @end example ! ! @noindent ! will work. However, some possible sources of confusion remain. For ! example, in the expression ! ! @example ! [ 1 - 1 ] ! @end example ! ! @noindent ! the @samp{-} is treated as a binary operator and the result is the ! scalar 0, but in the expression ! ! @example ! [ 1 -1 ] ! @end example ! ! @noindent ! the @samp{-} is treated as a unary operator and the result is the ! vector @code{[ 1 -1 ]}. ! ! Given @code{a = 1}, the expression ! ! @example ! [ 1 a' ] ! @end example ! ! @noindent ! results in the single quote character @samp{'} being treated as a ! transpose operator and the result is the vector @code{[ 1 1 ]}, but the ! expression ! ! @example ! [ 1 a ' ] ! @end example ! ! @noindent ! produces the error message ! ! @example ! error: unterminated string constant ! @end example ! ! @noindent ! because to not do so would make it impossible to correctly parse the ! valid expression ! ! @example ! [ a 'foo' ] ! @end example ! ! For clarity, it is probably best to always use commas and semicolons to ! separate matrix elements and rows. It is possible to enforce this style ! by setting the built-in variable @code{whitespace_in_literal_matrix} to ! @code{"ignore"}. ! ! @defvr {Built-in Variable} whitespace_in_literal_matrix ! This variable allows some control over how Octave decides to convert ! spaces to commas and semicolons in matrix expressions like ! @samp{[m (1)]} or ! ! @example ! [ 1, 2, ! 3, 4 ] ! @end example ! ! If the value of @code{whitespace_in_literal_matrix} is @code{"ignore"}, ! Octave will never insert a comma or a semicolon in a literal matrix ! list. For example, the expression @samp{[1 2]} will result in an error ! instead of being treated the same as @samp{[1, 2]}, and the expression ! ! @example ! [ 1, 2, ! 3, 4 ] ! @end example ! ! @noindent ! will result in the vector [1 2 3 4] instead of a matrix. ! ! If the value of @code{whitespace_in_literal_matrix} is @code{"traditional"}, ! Octave will convert spaces to a comma between identifiers and @samp{(}. For ! example, given the matrix ! ! @example ! m = [3 2] ! @end example ! ! @noindent ! the expression ! ! @example ! [m (1)] ! @end example ! ! @noindent ! will be parsed as ! ! @example ! [m, (1)] ! @end example ! ! @noindent ! and will result in ! ! @example ! [3 2 1] ! @end example ! ! @noindent ! and the expression ! ! @example ! [ 1, 2, ! 3, 4 ] ! @end example ! ! @noindent ! will result in a matrix because the newline character is converted to a ! semicolon (row separator) even though there is a comma at the end of the ! first line (trailing commas or semicolons are ignored). This is ! apparently how @sc{Matlab} behaves. ! ! Any other value for @code{whitespace_in_literal_matrix} results in behavior ! that is the same as traditional, except that Octave does not ! convert spaces to a comma between identifiers and @samp{(}. For ! example, the expression ! ! @example ! [m (1)] ! @end example ! ! will produce @samp{3}. This is the way Octave has always behaved. ! @end defvr ! ! When you type a matrix or the name of a variable whose value is a ! matrix, Octave responds by printing the matrix in with neatly aligned ! rows and columns. If the rows of the matrix are too large to fit on the ! screen, Octave splits the matrix and displays a header before each ! section to indicate which columns are being displayed. ! ! @noindent ! You can use the following variables to control the format of the output. ! ! @defvr {Built-in Variable} output_max_field_width ! This variable specifies the maximum width of a numeric output field. ! The default value is 10. ! @end defvr ! ! @defvr {Built-in Variable} output_precision ! This variable specifies the minimum number of significant figures to ! display for numeric output. The default value is 5. ! @end defvr ! ! It is possible to achieve a wide range of output styles by using ! different values of @code{output_precision} and ! @code{output_max_field_width}. Reasonable combinations can be set using ! the @code{format} function. @xref{Basic Input and Output}. ! ! @defvr {Built-in Variable} split_long_rows ! For large matrices, Octave may not be able to display all the columns of ! a given row on one line of your screen. This can result in missing ! information or output that is nearly impossible to decipher, depending ! on whether your terminal truncates or wraps long lines. ! ! If the value of @code{split_long_rows} is nonzero, Octave will display ! the matrix in a series of smaller pieces, each of which can fit within ! the limits of your terminal width. Each set of rows is labeled so that ! you can easily see which columns are currently being displayed. ! For example: ! ! @smallexample ! @group ! octave:13> rand (2,10) ! ans = ! ! Columns 1 through 6: ! ! 0.75883 0.93290 0.40064 0.43818 0.94958 0.16467 ! 0.75697 0.51942 0.40031 0.61784 0.92309 0.40201 ! ! Columns 7 through 10: ! ! 0.90174 0.11854 0.72313 0.73326 ! 0.44672 0.94303 0.56564 0.82150 ! @end group ! @end smallexample ! ! @noindent ! The default value of @code{split_long_rows} is nonzero. ! @end defvr ! ! @menu ! * Empty Matrices:: ! @end menu ! ! @node Empty Matrices, , Matrices, Matrices ! @subsection Empty Matrices ! ! A matrix may have one or both dimensions zero, and operations on empty ! matrices are handled as described by Carl de Boor in @cite{An Empty ! Exercise}, SIGNUM, Volume 25, pages 2--6, 1990 and C. N. Nett and W. M. ! Haddad, in @cite{A System-Theoretic Appropriate Realization of the Empty ! Matrix Concept}, IEEE Transactions on Automatic Control, Volume 38, ! Number 5, May 1993. Briefly, given a scalar @code{s}, and an @var{m} by ! @var{n} matrix @code{M(mxn)}, and an @var{m} by @var{n} empty matrix ! @code{[](mxn)} (with either one or both dimensions equal to zero), the ! following are true: ! ! @example ! @group ! s * [](mxn) = [](mxn) * s = [](mxn) ! ! [](mxn) + [](mxn) = [](mxn) ! ! [](0xm) * M(mxn) = [](0xn) ! ! M(mxn) * [](nx0) = [](mx0) ! ! [](mx0) * [](0xn) = 0(mxn) ! @end group ! @end example ! ! By default, dimensions of the empty matrix are printed along with the ! empty matrix symbol, @samp{[]}. For example: ! ! @example ! @group ! octave:13> zeros (3, 0) ! ans = ! ! [](3x0) ! @end group ! @end example ! ! The built-in variable @code{print_empty_dimensions} controls this ! behavior. ! ! @defvr {Built-in Variable} print_empty_dimensions ! If the value of @code{print_empty_dimensions} is nonzero, the ! dimensions of empty matrices are printed along with the empty matrix ! symbol, @samp{[]}. For example, the expression ! ! @example ! zeros (3, 0) ! @end example ! ! @noindent ! will print ! ! @example ! ans = ! ! [](3x0) ! @end example ! @end defvr ! ! Empty matrices may also be used in assignment statements as a convenient ! way to delete rows or columns of matrices. ! @xref{Assignment Ops, ,Assignment Expressions}. ! ! Octave will normally issue a warning if it finds an empty matrix in the ! list of elements that make up another matrix. You can use the variable ! @code{empty_list_elements_ok} to suppress the warning or to treat it as ! an error. ! ! @defvr {Built-in Variable} empty_list_elements_ok ! This variable controls whether Octave ignores empty matrices in a matrix ! list. ! ! For example, if the value of @code{empty_list_elements_ok} is ! nonzero, Octave will ignore the empty matrices in the expression ! ! @example ! a = [1, [], 3, [], 5] ! @end example ! ! @noindent ! and the variable @samp{a} will be assigned the value @samp{[ 1 3 5 ]}. ! ! The default value is @code{"warn"}. ! @end defvr ! ! @node Ranges, Variables, Matrices, Expressions ! @section Ranges ! @cindex range expressions ! @cindex expression, range ! ! @opindex : ! ! A @dfn{range} is a convenient way to write a row vector with evenly ! spaced elements. A range constant is defined by the value of the first ! element in the range, an optional value for the increment between ! elements, and a maximum value which the elements of the range will not ! exceed. The base, increment, and limit are separated by colons (the ! @samp{:} character) and may contain any arithmetic expressions and ! function calls. If the increment is omitted, it is assumed to be 1. ! For example, the range ! ! @example ! 1 : 5 ! @end example ! ! @noindent ! defines the set of values @samp{[ 1 2 3 4 5 ]}, and the range ! ! @example ! 1 : 3 : 5 ! @end example ! ! @noindent ! defines the set of values @samp{[ 1 4 ]}. ! ! Although a range constant specifies a row vector, Octave does @emph{not} ! convert range constants to vectors unless it is necessary to do so. ! This allows you to write a constant like @samp{1 : 10000} without using ! up 80,000 bytes of storage on a typical 32-bit workstation. ! ! Note that the upper (or lower, if the increment is negative) bound on ! the range is not always included in the set of values, and that ranges ! defined by floating point values can produce surprising results because ! Octave uses floating point arithmetic to compute the values in the ! range. If it is important to include the endpoints of a range and the ! number of elements is known, you should use the @code{linspace} function ! instead (@pxref{Special Matrices}). ! ! @node Variables, Index Expressions, Ranges, Expressions ! @section Variables ! @cindex variables, user-defined ! @cindex user-defined variables ! ! Variables let you give names to values and refer to them later. You have ! already seen variables in many of the examples. The name of a variable ! must be a sequence of letters, digits and underscores, but it may not begin ! with a digit. Octave does not enforce a limit on the length of variable ! names, but it is seldom useful to have variables with names longer than ! about 30 characters. The following are all valid variable names ! ! @cindex job hunting ! @cindex getting a good job ! @cindex flying high and fast ! @example ! @group ! x ! x15 ! __foo_bar_baz__ ! fucnrdthsucngtagdjb ! @end group ! @end example ! ! @noindent ! However, names like @code{__foo_bar_baz__} that begin and end with two ! underscores are understood to be reserved for internal use by Octave. ! You should not use them in code you write, except to access Octave's ! documented internal variables and built-in symbolic constants. ! ! Case is significant in variable names. The symbols @code{a} and ! @code{A} are distinct variables. ! ! A variable name is a valid expression by itself. It represents the ! variable's current value. Variables are given new values with ! @dfn{assignment operators} and @dfn{increment operators}. ! @xref{Assignment Ops, ,Assignment Expressions}. ! ! A number of variables have special built-in meanings. For example, ! @code{PWD} holds the current working directory, and @code{pi} names the ! ratio of the circumference of a circle to its diameter. @xref{Built-in ! Variables}, for a list of all the predefined variables. Some of these ! built-in symbols are constants and may not be changed. Others can be ! used and assigned just like all other variables, but their values are ! also used or changed automatically by Octave. ! ! Variables in Octave do not have fixed types, so it is possible to first ! store a numeric value in a variable and then to later use the same name ! to hold a string value in the same program. Variables may not be used ! before they have been given a value. Doing so results in an error. ! ! @node Index Expressions, Data Structures, Variables, Expressions @section Index Expressions An @dfn{index expression} allows you to reference or extract selected elements of a matrix or vector. --- 28,39 ---- * Operator Precedence:: @end menu ! @node Index Expressions, Calling Functions, Expressions, Expressions @section Index Expressions + @opindex ( + @opindex ) + An @dfn{index expression} allows you to reference or extract selected elements of a matrix or vector. *************** *** 758,764 **** @end example @noindent ! selects the first row of the matrix @samp{a}. This operation can be useful for selecting elements of a matrix based on some condition, since the comparison operators return matrices of ones --- 85,91 ---- @end example @noindent ! selects the first row of the matrix @code{a}. This operation can be useful for selecting elements of a matrix based on some condition, since the comparison operators return matrices of ones *************** *** 800,808 **** @end example @noindent ! results in the matrix @samp{[ 1 2 3 4 ]}. If the value of @code{prefer_zero_one_indexing} set to 0, the result would be ! the matrix @samp{[ 1 1 1 1 ]}. In the first case, Octave is selecting each element corresponding to a @samp{1} in the index vector. In the second, Octave is selecting the --- 127,135 ---- @end example @noindent ! results in the matrix @code{[ 1, 2, 3, 4 ]}. If the value of @code{prefer_zero_one_indexing} set to 0, the result would be ! the matrix @code{[ 1, 1, 1, 1 ]}. In the first case, Octave is selecting each element corresponding to a @samp{1} in the index vector. In the second, Octave is selecting the *************** *** 839,847 **** create a 2 by 3 matrix with all elements equal to 13. This is an obscure notation and should be avoided. It is better to ! use the function @samp{ones} to generate a matrix of the appropriate size whose elements are all one, and then to scale it to produce the ! desired result. @xref{Special Matrices}. @defvr {Built-in Variable} prefer_column_vectors If @code{prefer_column_vectors} is nonzero, operations like --- 166,174 ---- create a 2 by 3 matrix with all elements equal to 13. This is an obscure notation and should be avoided. It is better to ! use the function @code{ones} to generate a matrix of the appropriate size whose elements are all one, and then to scale it to produce the ! desired result. @xref{Special Utility Matrices}. @defvr {Built-in Variable} prefer_column_vectors If @code{prefer_column_vectors} is nonzero, operations like *************** *** 853,859 **** @end example @noindent ! (for @samp{a} previously undefined) produce column vectors. Otherwise, row vectors are preferred. The default value is 0. If a variable is already defined to be a vector (a matrix with a single --- 180,186 ---- @end example @noindent ! (for @code{a} previously undefined) produce column vectors. Otherwise, row vectors are preferred. The default value is 0. If a variable is already defined to be a vector (a matrix with a single *************** *** 867,1080 **** @example for i = 1:10 ! a (i) = i; endfor @end example @noindent ! (for @samp{a} previously undefined) result in the variable @samp{a} ! being resized to be just large enough to hold the new value. Otherwise ! uninitialized elements are set to zero. If the value of ! @code{resize_on_range_error} is 0, an error message is ! printed and control is returned to the top level. The default value is ! 1. @end defvr ! @node Data Structures, Calling Functions, Index Expressions, Expressions ! @section Data Structures ! @cindex structures ! @cindex data structures ! ! Octave includes support for organizing data in structures. The current ! implementation uses an associative array with indices limited to ! strings, but the syntax is more like C-style structures. Here are some ! examples of using data structures in Octave. ! ! Elements of structures can be of any value type. For example, the list ! of statements @example ! octave:1> x.a = 1; x.b = [1, 2; 3, 4]; x.c = "string"; @end example @noindent ! creates a structure with three elements. To print the value of the ! structure, you can type its name, just as for any other variable: @example @group ! octave:2> x ! x = ! @{ ! a = 1 ! b = ! ! 1 2 ! 3 4 ! ! c = string ! @} @end group @end example @noindent ! Note that Octave may print the elements in any order. ! ! Structures may be copied. @example @group ! octave:1> y = x ! y = ! @{ ! a = 1 ! b = ! ! 1 2 ! 3 4 ! ! c = string ! @} ! @end group ! @end example ! ! Since structures are themselves values, structure elements may reference ! other structures. The following statements change the value of the ! element @code{b} of the structure @code{x} to be a data structure ! containing the single element @code{d}, which has a value of 3. ! ! @example ! @group ! octave:1> x.b.d = 3 ! x.b.d = 3 ! octave:2> x.b ! ans = ! @{ ! d = 3 ! @} ! octave:3> x ! x = ! @{ ! a = 1 ! b = ! @{ ! d = 3 ! @} ! ! c = string ! @} ! @end group ! @end example ! ! Note that when Octave prints the value of a structure that contains ! other structures, only a few levels are displayed. For example, ! ! @example ! @group ! octave:1> a.b.c.d.e = 1; ! octave:2> a ! a = ! @{ ! b = ! @{ ! c = ! @} ! @} @end group @end example @noindent ! This prevents long and confusing output from large deeply nested ! structures. ! @defvr {Built-in Variable} struct_levels_to_print ! You can tell Octave how many structure levels to display by setting the ! built-in variable @code{struct_levels_to_print}. The default value is 2. ! @end defvr ! ! Functions can return structures. For example, the following function ! separates the real and complex parts of a matrix and stores them in two ! elements of the same structure variable. ! ! @example ! @group ! octave:1> function y = f (x) ! > y.re = real (x); ! > y.im = imag (x); ! > endfunction ! @end group ! @end example ! ! When called with a complex-valued argument, @code{f} returns the data ! structure containing the real and imaginary parts of the original ! function argument. ! ! @example ! @group ! octave:2> f (rand (3) + rand (3) * I); ! ans = ! @{ ! im = ! ! 0.26475 0.14828 ! 0.18436 0.83669 ! ! re = ! ! 0.040239 0.242160 ! 0.238081 0.402523 ! @} ! @end group ! @end example ! ! Function return lists can include structure elements, and they may be ! indexed like any other variable. For example, ! ! @example ! @group ! octave:1> [ x.u, x.s(2:3,2:3), x.v ] = svd ([1, 2; 3, 4]) ! x.u = ! ! -0.40455 -0.91451 ! -0.91451 0.40455 ! ! x.s = ! ! 0.00000 0.00000 0.00000 ! 0.00000 5.46499 0.00000 ! 0.00000 0.00000 0.36597 ! ! x.v = ! ! -0.57605 0.81742 ! -0.81742 -0.57605 ! @end group ! @end example ! ! It is also possible to cycle through all the elements of a structure in ! a loop, using a special form of the @code{for} statement ! (@pxref{The for Statement}) ! ! The following functions and variableare available to ! give you information about structures. ! ! @deftypefn {Built-in Function} {} is_struct (@var{expr}) ! Returns 1 if the value of the expression @var{expr} is a structure. ! @end deftypefn ! ! @deftypefn {Built-in Function} {} struct_contains (@var{expr}, @var{name}) ! This function returns 1 if the expression @var{expr} is a structure and it ! includes an element named @var{name}. The first argument must be a ! structure and the second must be a string. ! @end deftypefn ! ! @deftypefn {Built-in Function} {} struct_elements (@var{expr}) ! If the expression @var{expr} is a structure, this function returns a ! list of strings naming the elements of the structure. It is an error to ! call @code{struct_elements} with an argument that is not a structure. ! @end deftypefn ! ! @node Calling Functions, Global Variables, Data Structures, Expressions @section Calling Functions A @dfn{function} is a name for a particular calculation. Because it has --- 194,253 ---- @example for i = 1:10 ! a (i) = sqrt (i); endfor @end example @noindent ! (for @code{a} previously undefined) result in the variable @code{a} ! being resized to be just large enough to hold the new value. New ! elements that have not been given a value are set to zero. If the value ! of @code{resize_on_range_error} is 0, an error message is printed and ! control is returned to the top level. The default value is 1. @end defvr ! Note that it is quite inefficient to create a vector using a loop like ! the one shown in the example above. In this particular case, it would ! have been much more efficient to use the expression @example ! a = sqrt (1:10); @end example @noindent ! thus avoiding the loop entirely. In cases where a loop is still ! required, or a number of values must be combined to form a larger ! matrix, it is generally much faster to set the size of the matrix first, ! and then insert elements using indexing commands. For example, given a ! matrix @code{a}, @example @group ! [nr, nc] = size (a); ! x = zeros (nr, n * nc); ! for i = 1:n ! x(:,(i-1)*n+1:i*n) = a; ! endfor @end group @end example @noindent ! is considerably faster than @example @group ! x = a; ! for i = 1:n-1 ! x = [x, a]; ! endfor @end group @end example @noindent ! particularly for large matrices because Octave does not have to ! repeatedly resize the result. ! @node Calling Functions, Arithmetic Ops, Index Expressions, Expressions @section Calling Functions A @dfn{function} is a name for a particular calculation. Because it has *************** *** 1130,1137 **** @end example @noindent ! computes the singular value decomposition of the matrix @samp{a} and ! assigns the three result matrices to @samp{u}, @samp{s}, and @samp{v}. The left side of a multiple assignment expression is itself a list of expressions, and is allowed to be a list of variable names or index --- 303,310 ---- @end example @noindent ! computes the singular value decomposition of the matrix @code{a} and ! assigns the three result matrices to @code{u}, @code{s}, and @code{v}. The left side of a multiple assignment expression is itself a list of expressions, and is allowed to be a list of variable names or index *************** *** 1212,1219 **** With some restrictions@footnote{Some of Octave's function are implemented in terms of functions that cannot be called recursively. ! For example, the ODE solver @code{lsode} is ultimiately implemented in a ! Fortran subroutine which cannot be called recursively, so @code{lsode} should not be called either directly or indirectly from within the user-supplied function that @code{lsode} requires. Doing so will result in undefined behavior.}, recursive function calls are allowed. A --- 385,392 ---- With some restrictions@footnote{Some of Octave's function are implemented in terms of functions that cannot be called recursively. ! For example, the ODE solver @code{lsode} is ultimately implemented in a ! Fortran subroutine that cannot be called recursively, so @code{lsode} should not be called either directly or indirectly from within the user-supplied function that @code{lsode} requires. Doing so will result in undefined behavior.}, recursive function calls are allowed. A *************** *** 1249,1375 **** of Octave by allowing users to specify a maximum allowable recursion depth. ! @cindex global variables ! @cindex @code{global} statement ! @cindex variables, global ! ! @node Global Variables, Keywords, Calling Functions, Expressions ! @section Global Variables ! ! A variable that has been declared @dfn{global} may be accessed from ! within a function body without having to pass it as a formal parameter. ! ! A variable may be declared global using a @code{global} declaration ! statement. The following statements are all global declarations. ! ! @example ! @group ! global a ! global b = 2 ! global c = 3, d, e = 5 ! @end group ! @end example ! ! It is necessary declare a variable as global within a function body in ! order to access it. For example, ! ! @example ! @group ! global x ! function f () ! x = 1; ! endfunction ! f () ! @end group ! @end example ! ! @noindent ! does @emph{not} set the value of the global variable @samp{x} to 1. In ! order to change the value of the global variable @samp{x}, you must also ! declare it to be global within the function body, like this ! ! @example ! @group ! function f () ! global x; ! x = 1; ! endfunction ! @end group ! @end example ! ! Passing a global variable in a function parameter list will ! make a local copy and not modify the global value. For example: ! ! @example ! @group ! octave:1> function f (x) ! > x = 3 ! > endfunction ! octave:2> global x = 0 ! octave:3> x # This is the value of the global variable. ! x = 0 ! octave:4> f (x) ! x = 3 # The value of the local variable x is 3. ! octave:5> x # But it was a *copy* so the global variable ! x = 0 # remains unchanged. ! @end group ! @end example ! ! @defvr {Built-in Variable} warn_comma_in_global_decl ! If the value of @code{warn_comma_in_global_decl} is nonzero, a ! warning is issued for statements like ! ! @example ! global a = 1, b ! @end example ! ! @noindent ! which makes the variables @samp{a} and @samp{b} global and assigns the ! value 1 to the variable @samp{a}, because in this context, the comma is ! not interpreted as a statement separator. ! ! The default value of @code{warn_comma_in_global_decl} is nonzero. ! @end defvr ! ! @node Keywords, Arithmetic Ops, Global Variables, Expressions ! @section Keywords ! @cindex keywords ! ! The following identifiers are keywords, and may not be used as variable ! or function names: ! ! @example ! @group ! all_va_args endwhile ! break for ! catch function ! continue global ! else gplot ! elseif gsplot ! end if ! end_try_catch return ! end_unwind_protect try ! endfor unwind_protect ! endfunction unwind_protect_cleanup ! endif while ! @end group ! @end example ! ! The following command-like functions are also reserved, and may not be ! used as variable or function names: ! ! @example ! @group ! casesen echo load show ! cd edit_history ls type ! chdir format more which ! clear help run_history who ! diary history save whos ! dir hold set ! @end group ! @end example ! ! @node Arithmetic Ops, Comparison Ops, Keywords, Expressions @section Arithmetic Operators @cindex arithmetic operators @cindex operators, arithmetic --- 422,428 ---- of Octave by allowing users to specify a maximum allowable recursion depth. ! @node Arithmetic Ops, Comparison Ops, Calling Functions, Expressions @section Arithmetic Operators @cindex arithmetic operators @cindex operators, arithmetic *************** *** 1387,1422 **** @cindex transpose, complex-conjugate @cindex complex-conjugate transpose - @opindex + - @opindex - - @opindex * - @opindex / - @opindex \ - @opindex ** - @opindex ^ - @opindex ' - @opindex .+ - @opindex .- - @opindex .* - @opindex ./ - @opindex .\ - @opindex .** - @opindex .^ - @opindex .' - The following arithmetic operators are available, and work on scalars and matrices. @table @code @item @var{x} + @var{y} Addition. If both operands are matrices, the number of rows and columns must both agree. If one operand is a scalar, its value is added to all the elements of the other operand. @item @var{x} .+ @var{y} Element by element addition. This operator is equivalent to @code{+}. @item @var{x} - @var{y} Subtraction. If both operands are matrices, the number of rows and columns of both must agree. --- 440,461 ---- @cindex transpose, complex-conjugate @cindex complex-conjugate transpose The following arithmetic operators are available, and work on scalars and matrices. @table @code @item @var{x} + @var{y} + @opindex + Addition. If both operands are matrices, the number of rows and columns must both agree. If one operand is a scalar, its value is added to all the elements of the other operand. @item @var{x} .+ @var{y} + @opindex .+ Element by element addition. This operator is equivalent to @code{+}. @item @var{x} - @var{y} + @opindex - Subtraction. If both operands are matrices, the number of rows and columns of both must agree. *************** *** 1424,1437 **** Element by element subtraction. This operator is equivalent to @code{-}. @item @var{x} * @var{y} ! Matrix multiplication. The number of columns of @samp{x} must agree ! with the number of rows of @samp{y}. @item @var{x} .* @var{y} Element by element multiplication. If both operands are matrices, the number of rows and columns must both agree. @item @var{x} / @var{y} Right division. This is conceptually equivalent to the expression @example --- 463,479 ---- Element by element subtraction. This operator is equivalent to @code{-}. @item @var{x} * @var{y} ! @opindex * ! Matrix multiplication. The number of columns of @var{x} must agree ! with the number of rows of @var{y}. @item @var{x} .* @var{y} + @opindex .* Element by element multiplication. If both operands are matrices, the number of rows and columns must both agree. @item @var{x} / @var{y} + @opindex / Right division. This is conceptually equivalent to the expression @example *************** *** 1439,1453 **** @end example @noindent ! but it is computed without forming the inverse of @samp{y'}. If the system is not square, or if the coefficient matrix is singular, a minimum norm solution is computed. @item @var{x} ./ @var{y} Element by element right division. @item @var{x} \ @var{y} Left division. This is conceptually equivalent to the expression @example --- 481,497 ---- @end example @noindent ! but it is computed without forming the inverse of @var{y'}. If the system is not square, or if the coefficient matrix is singular, a minimum norm solution is computed. @item @var{x} ./ @var{y} + @opindex ./ Element by element right division. @item @var{x} \ @var{y} + @opindex \ Left division. This is conceptually equivalent to the expression @example *************** *** 1455,1471 **** @end example @noindent ! but it is computed without forming the inverse of @samp{x}. If the system is not square, or if the coefficient matrix is singular, a minimum norm solution is computed. @item @var{x} .\ @var{y} ! Element by element left division. Each element of @samp{y} is divided ! by each corresponding element of @samp{x}. @item @var{x} ^ @var{y} @itemx @var{x} ** @var{y} Power operator. If @var{x} and @var{y} are both scalars, this operator returns @var{x} raised to the power @var{y}. If @var{x} is a scalar and @var{y} is a square matrix, the result is computed using an eigenvalue --- 499,518 ---- @end example @noindent ! but it is computed without forming the inverse of @var{x}. If the system is not square, or if the coefficient matrix is singular, a minimum norm solution is computed. @item @var{x} .\ @var{y} ! @opindex .\ ! Element by element left division. Each element of @var{y} is divided ! by each corresponding element of @var{x}. @item @var{x} ^ @var{y} @itemx @var{x} ** @var{y} + @opindex ** + @opindex ^ Power operator. If @var{x} and @var{y} are both scalars, this operator returns @var{x} raised to the power @var{y}. If @var{x} is a scalar and @var{y} is a square matrix, the result is computed using an eigenvalue *************** *** 1478,1493 **** --- 525,545 ---- @item @var{x} .^ @var{y} @item @var{x} .** @var{y} + @opindex .** + @opindex .^ Element by element power operator. If both operands are matrices, the number of rows and columns must both agree. @item -@var{x} + @opindex - Negation. @item +@var{x} + @opindex + Unary plus. This operator has no effect on the operand. @item @var{x}' + @opindex ' Complex conjugate transpose. For real arguments, this operator is the same as the transpose operator. For complex arguments, this operator is equivalent to the expression *************** *** 1497,1502 **** --- 549,555 ---- @end example @item @var{x}.' + @opindex .' Transpose. @end table *************** *** 1547,1616 **** @cindex tests for equality @cindex equality, tests for - @opindex < - @opindex <= - @opindex == - @opindex >= - @opindex > - @opindex != - @opindex ~= - @opindex <> - @dfn{Comparison operators} compare numeric values for relationships such as equality. They are written using ! @emph{relational operators}, which are a superset of those in C. All of Octave's comparison operators return a value of 1 if the comparison is true, or 0 if it is false. For matrix values, they all ! work on an element-by-element basis. For example, evaluating the ! expression ! ! @example ! [1, 2; 3, 4] == [1, 3; 2, 4] ! @end example ! ! @noindent ! returns the result @example @group ! ans = ! 1 0 ! 0 1 @end group @end example @table @code @item @var{x} < @var{y} True if @var{x} is less than @var{y}. @item @var{x} <= @var{y} True if @var{x} is less than or equal to @var{y}. @item @var{x} == @var{y} True if @var{x} is equal to @var{y}. @item @var{x} >= @var{y} True if @var{x} is greater than or equal to @var{y}. @item @var{x} > @var{y} True if @var{x} is greater than @var{y}. @item @var{x} != @var{y} @itemx @var{x} ~= @var{y} @itemx @var{x} <> @var{y} True if @var{x} is not equal to @var{y}. @end table ! For matrix and vector arguments, the above table should be read as ! ``an element of the result matrix (vector) is true if the corresponding ! elements of the argument matrices (vectors) satisfy the specified ! condition'' ! ! String comparisons should be performed with the @code{strcmp} function, ! not with the comparison operators listed above. ! @xref{String Functions}. @node Boolean Expressions, Assignment Ops, Comparison Ops, Expressions @section Boolean Expressions --- 600,659 ---- @cindex tests for equality @cindex equality, tests for @dfn{Comparison operators} compare numeric values for relationships such as equality. They are written using ! @emph{relational operators}. All of Octave's comparison operators return a value of 1 if the comparison is true, or 0 if it is false. For matrix values, they all ! work on an element-by-element basis. For example, @example @group ! [1, 2; 3, 4] == [1, 3; 2, 4] ! @result{} 1 0 ! 0 1 @end group @end example + If one operand is a scalar and the other is a matrix, the scalar is + compared to each element of the matrix in turn, and the result is the + same size as the matrix. + @table @code @item @var{x} < @var{y} + @opindex < True if @var{x} is less than @var{y}. @item @var{x} <= @var{y} + @opindex <= True if @var{x} is less than or equal to @var{y}. @item @var{x} == @var{y} + @opindex == True if @var{x} is equal to @var{y}. @item @var{x} >= @var{y} + @opindex >= True if @var{x} is greater than or equal to @var{y}. @item @var{x} > @var{y} + @opindex > True if @var{x} is greater than @var{y}. @item @var{x} != @var{y} @itemx @var{x} ~= @var{y} @itemx @var{x} <> @var{y} + @opindex != + @opindex ~= + @opindex <> True if @var{x} is not equal to @var{y}. @end table ! String comparisons may also be performed with the @code{strcmp} ! function, not with the comparison operators listed above. ! @xref{Strings}. @node Boolean Expressions, Assignment Ops, Comparison Ops, Expressions @section Boolean Expressions *************** *** 1635,1647 **** @subsection Element-by-element Boolean Operators @cindex element-by-element evaluation - @opindex | - @opindex & - @opindex ~ - @opindex ! - An @dfn{element-by-element boolean expression} is a combination of ! comparison expressions or matching expressions, using the boolean operators ``or'' (@samp{|}), ``and'' (@samp{&}), and ``not'' (@samp{!}), along with parentheses to control nesting. The truth of the boolean expression is computed by combining the truth values of the --- 678,685 ---- @subsection Element-by-element Boolean Operators @cindex element-by-element evaluation An @dfn{element-by-element boolean expression} is a combination of ! comparison expressions using the boolean operators ``or'' (@samp{|}), ``and'' (@samp{&}), and ``not'' (@samp{!}), along with parentheses to control nesting. The truth of the boolean expression is computed by combining the truth values of the *************** *** 1650,1659 **** Element-by-element boolean expressions can be used wherever comparison expressions can be used. They can be used in @code{if} and @code{while} ! statements. However, before being used in the condition of an @code{if} ! or @code{while} statement, an implicit conversion from a matrix value to ! a scalar value occurs using the equivalent of ! @code{all (all (@var{x}))}. That is, a value used as the condition in an @code{if} or @code{while} statement is only true if @emph{all} of its elements are nonzero. --- 688,694 ---- Element-by-element boolean expressions can be used wherever comparison expressions can be used. They can be used in @code{if} and @code{while} ! statements. However, if a matrix value used as the condition in an @code{if} or @code{while} statement is only true if @emph{all} of its elements are nonzero. *************** *** 1666,1680 **** --- 701,719 ---- @table @code @item @var{boolean1} & @var{boolean2} + @opindex & Elements of the result are true if both corresponding elements of @var{boolean1} and @var{boolean2} are true. @item @var{boolean1} | @var{boolean2} + @opindex | Elements of the result are true if either of the corresponding elements of @var{boolean1} or @var{boolean2} is true. @item ! @var{boolean} @itemx ~ @var{boolean} + @opindex ~ + @opindex ! Each element of the result is true if the corresponding element of @var{boolean} is false. @end table *************** *** 1714,1722 **** @subsection Short-circuit Boolean Operators @cindex short-circuit evaluation - @opindex || - @opindex && - Combined with the implicit conversion to scalar values in @code{if} and @code{while} conditions, Octave's element-by-element boolean operators are often sufficient for performing most logical operations. However, --- 753,758 ---- *************** *** 1726,1747 **** @table @code @item @var{boolean1} && @var{boolean2} The expression @var{boolean1} is evaluated and converted to a scalar using the equivalent of the operation @code{all (all (@var{boolean1}))}. ! If it is false, the result of the expression is 0. If it is true, the ! expression @var{boolean2} is evaluated and converted to a scalar ! using the equivalent of the operation @code{all (all (@var{boolean1}))}. ! If it is true, the result of the expression is 1. Otherwise, the result ! of the expression is 0. @item @var{boolean1} || @var{boolean2} The expression @var{boolean1} is evaluated and converted to a scalar using the equivalent of the operation @code{all (all (@var{boolean1}))}. ! If it is true, the result of the expression is 1. If it is false, the ! expression @var{boolean2} is evaluated and converted to a scalar ! using the equivalent of the operation @code{all (all (@var{boolean1}))}. ! If it is true, the result of the expression is 1. Otherwise, the result ! of the expression is 0. @end table The fact that both operands may not be evaluated before determining the --- 762,785 ---- @table @code @item @var{boolean1} && @var{boolean2} + @opindex && The expression @var{boolean1} is evaluated and converted to a scalar using the equivalent of the operation @code{all (all (@var{boolean1}))}. ! If it is false, the result of the overall expression is 0. If it is ! true, the expression @var{boolean2} is evaluated and converted to a ! scalar using the equivalent of the operation @code{all (all ! (@var{boolean1}))}. If it is true, the result of the overall expression ! is 1. Otherwise, the result of the overall expression is 0. @item @var{boolean1} || @var{boolean2} + @opindex || The expression @var{boolean1} is evaluated and converted to a scalar using the equivalent of the operation @code{all (all (@var{boolean1}))}. ! If it is true, the result of the overall expression is 1. If it is ! false, the expression @var{boolean2} is evaluated and converted to a ! scalar using the equivalent of the operation @code{all (all ! (@var{boolean1}))}. If it is true, the result of the overall expression ! is 1. Otherwise, the result of the overall expression is 0. @end table The fact that both operands may not be evaluated before determining the *************** *** 1763,1785 **** @group function f (a, b, c) if (nargin > 2 && isstr (c)) ! ... @end group @end example @noindent instead of having to use two @code{if} statements to avoid attempting to ! evaluate an argument that doesn't exist. @example @group function f (a, b, c) if (nargin > 2) if (isstr (c)) ! ... @end group @end example @node Assignment Ops, Increment Ops, Boolean Expressions, Expressions @section Assignment Expressions @cindex assignment expressions --- 801,839 ---- @group function f (a, b, c) if (nargin > 2 && isstr (c)) ! @dots{} @end group @end example @noindent instead of having to use two @code{if} statements to avoid attempting to ! evaluate an argument that doesn't exist. For example, without the ! short-circuit feature, it would be necessary to write @example @group function f (a, b, c) if (nargin > 2) if (isstr (c)) ! @dots{} @end group @end example + Writing + + @example + @group + function f (a, b, c) + if (nargin > 2 & isstr (c)) + @dots{} + @end group + @end example + + @noindent + would result in an error if @code{f} were called with one or two + arguments because Octave would be forced to try to evaluate both of the + operands for the operator @samp{&}. + @node Assignment Ops, Increment Ops, Boolean Expressions, Expressions @section Assignment Expressions @cindex assignment expressions *************** *** 1799,1804 **** --- 853,859 ---- After this expression is executed, the variable @code{z} has the value 1. Whatever old value @code{z} had before the assignment is forgotten. + The @samp{=} sign is called an @dfn{assignment operator}. Assignments can store string values also. For example, the following expression would store the value @code{"this food is good"} in the *************** *** 1815,1824 **** @noindent (This also illustrates concatenation of strings.) - The @samp{=} sign is called an @dfn{assignment operator}. It is the - simplest assignment operator because the value of the right-hand - operand is stored unchanged. - @cindex side effect Most operators (addition, concatenation, and so on) have no effect except to compute a value. If you ignore the value, you might as well --- 870,875 ---- *************** *** 1855,1860 **** --- 906,924 ---- When the second assignment gives @code{foo} a string value, the fact that it previously had a numeric value is forgotten. + Assignment of a scalar to an indexed matrix sets all of the elements + that are referenced by the indices to the scalar value. For example, if + @code{a} is a matrix with at least two columns, + + @example + @group + a(:, 2) = 5 + @end group + @end example + + @noindent + sets all the elements in the second column of @code{a} to 5. + Assigning an empty matrix @samp{[]} works in most cases to allow you to delete rows or columns of matrices and vectors. @xref{Empty Matrices}. For example, given a 4 by 5 matrix @var{A}, the assignment *************** *** 1942,1950 **** @cindex operators, increment @cindex operators, decrement - @opindex ++ - @opindex -- - @node Increment Ops, Operator Precedence, Assignment Ops, Expressions @section Increment Operators --- 1006,1011 ---- *************** *** 1971,1990 **** --- 1032,1055 ---- @table @code @item ++@var{x} + @opindex ++ This expression increments the variable @var{x}. The value of the expression is the @emph{new} value of @var{x}. It is equivalent to the expression @code{@var{x} = @var{x} + 1}. @item --@var{x} + @opindex @code{--} This expression decrements the variable @var{x}. The value of the expression is the @emph{new} value of @var{x}. It is equivalent to the expression @code{@var{x} = @var{x} - 1}. @item @var{x}++ + @opindex ++ This expression causes the variable @var{x} to be incremented. The value of the expression is the @emph{old} value of @var{x}. @item @var{x}-- + @opindex @code{--} This expression causes the variable @var{x} to be decremented. The value of the expression is the @emph{old} value of @var{x}. @end table *************** *** 1995,2004 **** results in a parse error. This problem may be fixed in a future release of Octave. - @cindex operator precedence - @node Operator Precedence, , Increment Ops, Expressions @section Operator Precedence @dfn{Operator precedence} determines how operators are grouped, when different operators appear close by in one expression. For example, --- 1060,1068 ---- results in a parse error. This problem may be fixed in a future release of Octave. @node Operator Precedence, , Increment Ops, Expressions @section Operator Precedence + @cindex operator precedence @dfn{Operator precedence} determines how operators are grouped, when different operators appear close by in one expression. For example, *************** *** 2016,2022 **** any such mistake. When operators of equal precedence are used together, the leftmost ! operator groups first, except for the assignment, and exponentiation operators, which group in the opposite order. Thus, the expression @code{a - b + c} groups as @code{(a - b) + c}, but the expression @code{a = b = c} groups as @code{a = (b = c)}. --- 1080,1086 ---- any such mistake. When operators of equal precedence are used together, the leftmost ! operator groups first, except for the assignment and exponentiation operators, which group in the opposite order. Thus, the expression @code{a - b + c} groups as @code{(a - b) + c}, but the expression @code{a = b = c} groups as @code{a = (b = c)}. diff -cNr octave-2.0.2/doc/interpreter/fn-idx.texi octave-2.0.3/doc/interpreter/fn-idx.texi *** octave-2.0.2/doc/interpreter/fn-idx.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/fn-idx.texi Sun Feb 16 22:48:25 1997 *************** *** 1,4 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. --- 1,4 ---- ! @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. diff -cNr octave-2.0.2/doc/interpreter/func.texi octave-2.0.3/doc/interpreter/func.texi *** octave-2.0.2/doc/interpreter/func.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/func.texi Tue Feb 18 01:49:27 1997 *************** *** 1,8 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Functions and Scripts, Built-in Variables, Statements, Top @chapter Functions and Script Files @cindex defining functions @cindex user-defined functions --- 1,8 ---- ! @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 Functions and Scripts, Error Handling, Statements, Top @chapter Functions and Script Files @cindex defining functions @cindex user-defined functions *************** *** 12,18 **** Complicated Octave programs can often be simplified by defining functions. Functions can be defined directly on the command line during interactive Octave sessions, or in external files, and can be called just ! like built-in ones. @menu * Defining Functions:: --- 12,18 ---- Complicated Octave programs can often be simplified by defining functions. Functions can be defined directly on the command line during interactive Octave sessions, or in external files, and can be called just ! like built-in functions. @menu * Defining Functions:: *************** *** 64,70 **** The @code{printf} statement (@pxref{Input and Output}) simply tells Octave to print the string @code{"\a"}. The special character @samp{\a} ! stands for the alert character (ASCII 7). @xref{String Constants}. Once this function is defined, you can ask Octave to evaluate it by typing the name of the function. --- 64,70 ---- The @code{printf} statement (@pxref{Input and Output}) simply tells Octave to print the string @code{"\a"}. The special character @samp{\a} ! stands for the alert character (ASCII 7). @xref{Strings}. Once this function is defined, you can ask Octave to evaluate it by typing the name of the function. *************** *** 196,202 **** function retval = avg (v) retval = 0; if (nargin != 1) ! error ("usage: avg (vector)"); endif if (is_vector (v)) retval = sum (v) / length (v); --- 196,202 ---- function retval = avg (v) retval = 0; if (nargin != 1) ! usage ("avg (vector)"); endif if (is_vector (v)) retval = sum (v) / length (v); *************** *** 218,238 **** @defvr {Automatic Variable} nargin When a function is called, this local variable is automatically initialized to the number of arguments passed to the function. At the ! top level, it holds the number of command line arguments that were ! passed to Octave. ! @end defvr ! ! @defvr {Automatic Variable} nargout ! When a function is called, this local variable is automatically ! initialized to the number of arguments expected to be returned. For ! example, ! ! @example ! @group ! f () # nargout is 0 ! [s, t] = f () # nargout is 2 ! @end group ! @end example @end defvr @defvr {Built-in Variable} silent_functions --- 218,225 ---- @defvr {Automatic Variable} nargin When a function is called, this local variable is automatically initialized to the number of arguments passed to the function. At the ! top level, @code{nargin} holds the number of command line arguments that ! were passed to Octave. @end defvr @defvr {Built-in Variable} silent_functions *************** *** 347,356 **** @noindent provided that the built-in variable @code{define_all_return_values} is ! nonzero. @xref{Built-in Variables}. @defvr {Built-in Variable} default_return_value ! The value given to otherwise unitialized return values if @code{define_all_return_values} is nonzero. The default value is @code{[]}. @end defvr --- 334,368 ---- @noindent provided that the built-in variable @code{define_all_return_values} is ! nonzero and the value of @code{default_return_value} is @samp{[]}. ! @xref{Summary of Built-in Variables}. ! ! @defvr {Automatic Variable} nargout ! When a function is called, this local variable is automatically ! initialized to the number of arguments expected to be returned. For ! example, ! ! @example ! f () ! @end example ! ! @noindent ! will result in @code{nargout} being set to 0 inside the function ! @code{f} and ! ! @example ! [s, t] = f () ! @end example ! ! @noindent ! will result in @code{nargout} being set to 2 inside the function ! @code{f}. ! ! At the top level, @code{nargout} is undefined. ! @end defvr @defvr {Built-in Variable} default_return_value ! The value given to otherwise uninitialized return values if @code{define_all_return_values} is nonzero. The default value is @code{[]}. @end defvr *************** *** 362,367 **** --- 374,388 ---- default value is 0. @end defvr + @deftypefn {Function File} {} nargchk (@var{nargin_min}, @var{nargin_max}, @var{n}) + If @var{n} is in the range @var{nargin_min} through @var{nargin_max} + inclusive, return the empty matrix. Otherwise, return a message + indicating whether @var{n} is too large or too small. + + This is useful for checking to see that the number of arguments supplied + to a function is within an acceptable range. + @end deftypefn + @node Variable-length Argument Lists, Variable-length Return Lists, Multiple Return Values, Functions and Scripts @section Variable-length Argument Lists @cindex Variable-length argument lists *************** *** 372,377 **** --- 393,401 ---- upper bound on the number of optional arguments that a function can accept. + @c XXX FIXME XXX -- should we add a note about why this feature is not + @c compatible with Matlab 5? + Here is an example of a function that uses the new syntax to print a header followed by an unspecified number of values: *************** *** 391,445 **** @deftypefn {Built-in Function} {} va_start () Position an internal pointer to the first unnamed argument and allows you to cycle through the arguments more than once. It is not necessary ! to call @code{va_start()} if you do not plan to cycle through the arguments more than once. This function may only be called inside functions that have been declared to accept a variable number of input arguments. @end deftypefn @deftypefn {Built-in Function} {} va_arg () ! Return the value of the next available argument and moves the internal pointer to the next argument. It is an error to call @code{va_arg()} when there are no more arguments available. @end deftypefn Sometimes it is useful to be able to pass all unnamed arguments to another function. The keyword @var{all_va_args} makes this very easy to ! do. For example, given the functions @example function f (...) while (nargin--) disp (va_arg ()) endwhile endfunction function g (...) f ("begin", all_va_args, "end") endfunction - @end example - - @noindent - the statement - @example g (1, 2, 3) - @end example - - @noindent - prints ! @example ! begin ! 1 ! 2 ! 3 ! end @end example @defvr {Keyword} all_va_args This keyword stands for the entire list of optional argument, so it is possible to use it more than once within the same function without ! having to call @code{va_start ()}. It can only be used within functions that take a variable number of arguments. It is an error to use it in other contexts. @end defvr --- 415,462 ---- @deftypefn {Built-in Function} {} va_start () Position an internal pointer to the first unnamed argument and allows you to cycle through the arguments more than once. It is not necessary ! to call @code{va_start} if you do not plan to cycle through the arguments more than once. This function may only be called inside functions that have been declared to accept a variable number of input arguments. @end deftypefn @deftypefn {Built-in Function} {} va_arg () ! Return the value of the next available argument and move the internal pointer to the next argument. It is an error to call @code{va_arg()} when there are no more arguments available. @end deftypefn Sometimes it is useful to be able to pass all unnamed arguments to another function. The keyword @var{all_va_args} makes this very easy to ! do. For example, @example + @group function f (...) while (nargin--) disp (va_arg ()) endwhile endfunction + function g (...) f ("begin", all_va_args, "end") endfunction g (1, 2, 3) ! @print{} begin ! @print{} 1 ! @print{} 2 ! @print{} 3 ! @print{} end ! @end group @end example @defvr {Keyword} all_va_args This keyword stands for the entire list of optional argument, so it is possible to use it more than once within the same function without ! having to call @code{va_start}. It can only be used within functions that take a variable number of arguments. It is an error to use it in other contexts. @end defvr *************** *** 453,467 **** unspecified number of values, so it is no longer necessary to place an upper bound on the number of outputs that a function can produce. ! Here is an example of a function that uses the new syntax to produce ! @var{n} values: @example ! function [...] = foo (n, x) for i = 1:n vr_val (i * x); endfor endfunction @end example As with variable argument lists, the ellipsis that marks the variable --- 470,492 ---- unspecified number of values, so it is no longer necessary to place an upper bound on the number of outputs that a function can produce. ! Here is an example of a function that uses a variable-length return list ! to produce @var{n} values: @example ! @group ! function [...] = f (n, x) for i = 1:n vr_val (i * x); endfor endfunction + + [dos, quatro] = f (2, 2) + + @result{} dos = 2 + + @result{} quatro = 4 + @end group @end example As with variable argument lists, the ellipsis that marks the variable *************** *** 471,477 **** @deftypefn {Built-in Function} {} vr_val (@var{val}) Each time this function is called, it places the value of its argument at the end of the list of values to return from the current function. ! Once @code{vr_val()} has been called, there is no way to go back to the beginning of the list and rewrite any of the return values. This function may only be called within functions that have been declared to return an unspecified number of output arguments (by using the special --- 496,502 ---- @deftypefn {Built-in Function} {} vr_val (@var{val}) Each time this function is called, it places the value of its argument at the end of the list of values to return from the current function. ! Once @code{vr_val} has been called, there is no way to go back to the beginning of the list and rewrite any of the return values. This function may only be called within functions that have been declared to return an unspecified number of output arguments (by using the special *************** *** 520,529 **** does contain a nonzero element. @defvr {Keyword} return ! When Octave encounters the keyword return, it returns control to be ! calling function immediately. It is only valid within a function and ! will result in an error if used at the top level. A @code{return} ! statement is assumed at the end of every function definition. @end defvr @defvr {Built-in Variable} return_last_computed_value --- 545,554 ---- does contain a nonzero element. @defvr {Keyword} return ! When Octave encounters the keyword @code{return} inside a function or ! script, it returns control to be caller immediately. At the top level, ! the return statement is ignored. A @code{return} statement is assumed ! at the end of every function definition. @end defvr @defvr {Built-in Variable} return_last_computed_value *************** *** 541,548 **** @end example @noindent ! will either return nothing, if @code{return_last_computed_value} is ! 0, or 4, if it is nonzero. @end defvr @node Function Files, Script Files, Returning From a Function, Functions and Scripts --- 566,574 ---- @end example @noindent ! will either return nothing, if the value of ! @code{return_last_computed_value} is 0, or 4, if the value of ! @code{return_last_computed_value} is nonzero. @end defvr @node Function Files, Script Files, Returning From a Function, Functions and Scripts *************** *** 582,593 **** time stamp every time a function is used is rather inefficient, but it has to be done to ensure that the correct function definition is used. ! Octave assumes that function files in the ! @file{@value{OCTAVEHOME}/share/octave/@value{VERSION}/m} directory tree ! will not change, so it doesn't have to check their time stamps every ! time the functions defined in those files are used. This is normally a ! very good assumption and provides a significant improvement in ! performance for the function files that are distributed with Octave. If you know that your own function files will not change while you are running Octave, you can improve performance by setting the variable --- 608,621 ---- time stamp every time a function is used is rather inefficient, but it has to be done to ensure that the correct function definition is used. ! To avoid degrading performance unnecessarily by checking the time stamps ! on functions that are not likely to change, Octave assumes that function ! files in the directory tree ! @file{@value{OCTAVEHOME}/share/octave/@value{VERSION}/m} will not ! change, so it doesn't have to check their time stamps every time the ! functions defined in those files are used. This is normally a very good ! assumption and provides a significant improvement in performance for the ! function files that are distributed with Octave. If you know that your own function files will not change while you are running Octave, you can improve performance by setting the variable *************** *** 596,601 **** --- 624,631 ---- @code{"system"} gives the default behavior. If you set it to anything else, Octave will check the time stamps on all function files. + @c XXX FIXME XXX -- note about time stamps on files in NFS environments? + @defvr {Built-in Variable} LOADPATH A colon separated list of directories in which to search for function files. @xref{Functions and Scripts}. The value of @code{LOADPATH} *************** *** 624,633 **** @defvr {Built-in Variable} ignore_function_time_stamp This variable can be used to prevent Octave from making the system call ! @code{stat()} each time it looks up functions defined in function files. If @code{ignore_function_time_stamp} to @code{"system"}, Octave will not automatically recompile function files in subdirectories of ! @code{@value{OCTAVEHOME}/lib/@value{VERSION}} if they have changed since they were last compiled, but will recompile other function files in the @code{LOADPATH} if they change. If set to @code{"all"}, Octave will not recompile any function files unless their definitions are removed with --- 654,663 ---- @defvr {Built-in Variable} ignore_function_time_stamp This variable can be used to prevent Octave from making the system call ! @code{stat} each time it looks up functions defined in function files. If @code{ignore_function_time_stamp} to @code{"system"}, Octave will not automatically recompile function files in subdirectories of ! @file{@value{OCTAVEHOME}/lib/@value{VERSION}} if they have changed since they were last compiled, but will recompile other function files in the @code{LOADPATH} if they change. If set to @code{"all"}, Octave will not recompile any function files unless their definitions are removed with *************** *** 638,647 **** @end defvr @defvr {Built-in Variable} warn_function_name_clash ! If the value of @code{warn_function_name_clash} is nonzero, a ! warning is issued when Octave finds that the name of a function defined ! in a function file differs from the name of the file. If the value is ! 0, the warning is omitted. The default value is 1. @end defvr @node Script Files, Dynamically Linked Functions, Function Files, Functions and Scripts --- 668,678 ---- @end defvr @defvr {Built-in Variable} warn_function_name_clash ! If the value of @code{warn_function_name_clash} is nonzero, a warning is ! issued when Octave finds that the name of a function defined in a ! function file differs from the name of the file. (If the names ! disagree, the name declared inside the file is ignored.) If the value ! is 0, the warning is omitted. The default value is 1. @end defvr @node Script Files, Dynamically Linked Functions, Function Files, Functions and Scripts *************** *** 694,700 **** message warning about any non-whitespace characters that appear after the function definition. ! Note that Octave does not try to lookup the definition of any identifier until it needs to evaluate it. This means that Octave will compile the following statements if they appear in a script file, or are typed at the command line, --- 725,731 ---- message warning about any non-whitespace characters that appear after the function definition. ! Note that Octave does not try to look up the definition of any identifier until it needs to evaluate it. This means that Octave will compile the following statements if they appear in a script file, or are typed at the command line, *************** *** 714,720 **** @noindent even though the function @code{do_something} is not defined before it is ! referenced in the function @code{foo}. This is not an error because the Octave does not need to resolve all symbols that are referenced by a function until the function is actually evaluated. --- 745,751 ---- @noindent even though the function @code{do_something} is not defined before it is ! referenced in the function @code{foo}. This is not an error because Octave does not need to resolve all symbols that are referenced by a function until the function is actually evaluated. *************** *** 735,816 **** definitions were resolved as the function was being compiled. It would be virtually impossible to make Octave clever enough to evaluate this code in a consistent fashion. The parser would have to be able to ! perform the @samp{eval ()} statement at compile time, and that would be impossible unless all the references in the string to be evaluated could also be resolved, and requiring that would be too restrictive (the string might come from user input, or depend on things that are not known until the function is evaluated). @deftypefn {Built-in Function} {} source (@var{file}) Parse and execute the contents of @var{file}. This is equivalent to ! executing commands from a script file, but without requiring the file ot ! be name @var{file}.m. @end deftypefn @node Dynamically Linked Functions, Organization of Functions, Script Files, Functions and Scripts @section Dynamically Linked Functions On some systems, Octave can dynamically load and execute functions ! written in C++ or other compiled languages. This currently only works ! on systems that have a working version of the GNU dynamic linker, ! @code{dld}. Unfortunately, @code{dld} does not work on very many ! systems, but someone is working on making @code{dld} use the GNU Binary ! File Descriptor library, @code{BFD}, so that may soon change. In any ! case, it should not be too hard to make Octave's dynamic linking ! features work on other systems using system-specific dynamic linking ! facilities. ! ! Here is an example of how to write a C++ function that Octave can load. ! ! @example ! #include ! ! #include "defun-dld.h" ! #include "tree-const.h" ! ! DEFUN_DLD ("hello", Fhello, Shello, -1, -1, ! "hello (...)\n\ ! \n\ ! Print greeting followed by the values of all the arguments passed.\n\ ! Returns all the arguments passed.") @{ ! Octave_object retval; ! cerr << "Hello, world!\n"; ! int nargin = args.length (); ! for (int i = 1; i < nargin; i++) ! retval (nargin-i-1) = args(i).eval (1); ! return retval; @} @end example ! Octave's dynamic linking features currently have the following ! limitations. ! @itemize @bullet ! @item ! Dynamic linking only works on systems that support the GNU dynamic ! linker, @code{dld}. ! @item ! Clearing dynamically linked functions doesn't work. ! ! @item ! Configuring Octave with @code{--enable-lite-kernel} seems to mostly work ! to make nonessential built-in functions dynamically loaded, but there ! also seem to be some problems. For example, fsolve seems to always ! return @code{info == 3}. This is difficult to debug since @code{gdb} ! won't seem to allow breakpoints to be set inside dynamically loaded ! functions. ! ! @item ! Octave uses a lot of memory if the dynamically linked functions are ! compiled to include debugging symbols. This appears to be a limitation ! with @code{dld}, and can be avoided by not using @code{-g} to compile ! functions that will be linked dynamically. ! @end itemize ! ! If you would like to volunteer to help improve Octave's ability to ! dynamically link externally compiled functions, please contact ! @code{bug-octave@@bevo.che.wisc.edu}. @node Organization of Functions, , Dynamically Linked Functions, Functions and Scripts @section Organization of Functions Distributed with Octave --- 766,983 ---- definitions were resolved as the function was being compiled. It would be virtually impossible to make Octave clever enough to evaluate this code in a consistent fashion. The parser would have to be able to ! perform the call to @code{eval} at compile time, and that would be impossible unless all the references in the string to be evaluated could also be resolved, and requiring that would be too restrictive (the string might come from user input, or depend on things that are not known until the function is evaluated). + Although Octave normally executes commands from script files that have + the name @file{@var{file}.m}, you can use the function @code{source} to + execute commands from any file. + @deftypefn {Built-in Function} {} source (@var{file}) Parse and execute the contents of @var{file}. This is equivalent to ! executing commands from a script file, but without requiring the file to ! be named @file{@var{file}.m}. @end deftypefn @node Dynamically Linked Functions, Organization of Functions, Script Files, Functions and Scripts @section Dynamically Linked Functions + @cindex dynamic linking On some systems, Octave can dynamically load and execute functions ! written in C++. Octave can only directly call functions written in C++, ! but you can also load functions written in other languages ! by calling them from a simple wrapper function written in C++. ! ! Here is an example of how to write a C++ function that Octave can load, ! with commentary. The source for this function is included in the source ! distributions of Octave, in the file @file{examples/oregonator.cc}. It ! defines the same set of differential equations that are used in the ! example problem of @ref{Ordinary Differential Equations}. By running ! that example and this one, we can compare the execution times to see ! what sort of increase in speed you can expect by using dynamically ! linked functions. ! ! The function defined in @file{oregonator.cc} contains just 8 statements, ! and is not much different than the code defined in the corresponding ! M-file (also distributed with Octave in the file ! @file{examples/oregonator.m}). ! ! Here is the complete text of @file{oregonator.cc}: ! ! just ! ! @example ! @group ! #include ! ! DEFUN_DLD (oregonator, args, , ! "The `oregonator'.") @{ ! ColumnVector dx (3); ! ! ColumnVector x = args(0).vector_value (); ! ! dx(0) = 77.27 * (x(1) - x(0)*x(1) + x(0) ! - 8.375e-06*pow (x(0), 2)); ! ! dx(1) = (x(2) - x(0)*x(1) - x(1)) / 77.27; ! ! dx(2) = 0.161*(x(0) - x(2)); ! ! return octave_value (dx); @} + @end group + @end example + + The first line of the file, + + @example + #include + @end example + + @noindent + includes declarations for all of Octave's internal functions that you + will need. If you need other functions from the standard C++ or C + libraries, you can include the necessary headers here. + + The next two lines + @example + @group + DEFUN_DLD (oregonator, args, , + "The `oregonator'.") + @end group + @end example + + @noindent + declares the function. The macro @code{DEFUN_DLD} and the macros that + it depends on are defined in the files @file{defun-dld.h}, + @file{defun.h}, and @file{defun-int.h} (these files are included in the + header file @file{octave/oct.h}). + + Note that the third parameter to @code{DEFUN_DLD} (@code{nargout}) is + not used, so it is omitted from the list of arguments to in order to + avoid the warning from gcc about an unused function parameter. + + @noindent + simply declares an object to store the right hand sides of the + differential equation, and + + The statement + + @example + ColumnVector x = args(0).vector_value (); + @end example + + @noindent + extracts a column vector from the input arguments. The variable + @code{args} is passed to functions defined with @code{DEFUN_DLD} as an + @code{octave_value_list} object, which includes methods for getting the + length of the list and extracting individual elements. + + In this example, we don't check for errors, but that is not difficult. + All of the Octave's built-in functions do some form of checking on their + arguments, so you can check the source code for those functions for + examples of various strategies for verifying that the correct number and + types of arguments have been supplied. + + The next statements + + @example + @group + ColumnVector dx (3); + + dx(0) = 77.27 * (x(1) - x(0)*x(1) + x(0) + - 8.375e-06*pow (x(0), 2)); + + dx(1) = (x(2) - x(0)*x(1) - x(1)) / 77.27; + + dx(2) = 0.161*(x(0) - x(2)); + @end group + @end example + + @noindent + define the right hand side of the differential equation. Finally, we + can return @code{dx}: + + @example + return octave_value (dx); + @end example + + @noindent + The actual return type is @code{octave_value_list}, but it is only + necessary to convert the return type to an @code{octave_value} because + there is a default constructor that can automatically create an object + of that type from an @code{octave_value} object, so we can just use that + instead. + + To use this file, your version of Octave must support dynamic linking. + To find out if it does, type the command + @kbd{octave_config_info ("dld")} at the Octave prompt. Support for + dynamic linking is included if this command returns 1. + + To compile the example file, type the command @kbd{mkoctfile + oregonator.cc} at the shell prompt. The script @code{mkoctfile} should + have been installed along with Octave. Running it will create a file + called @file{oregonator.oct} that can be loaded by Octave. To test the + @file{oregonator.oct} file, start Octave and type the command + + @example + oregonator ([1, 2, 3], 0) + @end example + + @noindent + at the Octave prompt. Octave should respond by printing + + @example + @group + ans = + + 77.269353 + -0.012942 + -0.322000 + @end group @end example ! You can now use the @file{oregonator.oct} file just as you would the ! @code{oregonator.m} file to solve the set of differential equations. ! On a 133 MHz Pentium running Linux, Octave can solve the problem shown ! in @ref{Ordinary Differential Equations} in about 1.4 second using the ! dynamically linked function, compared to about 19 seconds using the ! M-file. Similar decreases in execution time can be expected for other ! functions, particularly those that rely on functions like @code{lsode} ! that require user-supplied functions. ! ! Additional examples are available in the files in the @file{src} ! directory of the Octave distribution. Currently, this includes the ! files ! ! @example ! @group ! balance.cc fft.cc hess.cc lu.cc schur.cc ! chol.cc fft2.cc ifft.cc minmax.cc sort.cc ! colloc.cc filter.cc ifft2.cc pinv.cc svd.cc ! dassl.cc find.cc inv.cc qr.cc syl.cc ! det.cc fsolve.cc log.cc quad.cc ! eig.cc fsqp.cc lsode.cc qzval.cc ! expm.cc givens.cc lu.cc rand.cc ! @end group ! @end example ! ! @noindent ! These files use the macro @code{DEFUN_DLD_BUILTIN} instead of ! @code{DEFUN_DLD}. The difference between these two macros is just that ! @code{DEFUN_DLD_BUILTIN} can define a built-in function that is not ! dynamically loaded if the operating system does not support dynamic ! linking. To define your own dynamically linked functions you should use ! @code{DEFUN_DLD}. ! ! There is currently no detailed description of all the functions that you ! can call in a built-in function. For the time being, you will have to ! read the source code for Octave. @node Organization of Functions, , Dynamically Linked Functions, Functions and Scripts @section Organization of Functions Distributed with Octave *************** *** 824,829 **** --- 991,999 ---- types of functions you will find there. @table @file + @item audio + Functions for playing and recording sounds. + @item control Functions for design and simulation of automatic control systems. *************** *** 838,843 **** --- 1008,1016 ---- @item image Image processing tools. These functions require the X Window System. + @item io + Input-ouput functions. + @item linear-algebra Functions for linear algebra. *************** *** 870,873 **** --- 1043,1049 ---- @item strings Miscellaneous string-handling functions. + + @item time + Functions related to time keeping. @end table diff -cNr octave-2.0.2/doc/interpreter/gpl.texi octave-2.0.3/doc/interpreter/gpl.texi *** octave-2.0.2/doc/interpreter/gpl.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/gpl.texi Sun Feb 16 22:48:25 1997 *************** *** 1,10 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. @cindex warranty @cindex copyright ! @node Copying, Concept Index, Using Info, Top @appendix GNU GENERAL PUBLIC LICENSE @center Version 2, June 1991 --- 1,10 ---- ! @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 warranty @cindex copyright ! @node Copying, Concept Index, Grammar, Top @appendix GNU GENERAL PUBLIC LICENSE @center Version 2, June 1991 diff -cNr octave-2.0.2/doc/interpreter/grammar.texi octave-2.0.3/doc/interpreter/grammar.texi *** octave-2.0.2/doc/interpreter/grammar.texi Wed Dec 31 18:00:00 1969 --- octave-2.0.3/doc/interpreter/grammar.texi Sun Feb 16 22:48:25 1997 *************** *** 0 **** --- 1,53 ---- + @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 Grammar, Copying, Emacs, Top + @chapter Grammar + @cindex grammar rules + @cindex language definition + + Someday I hope to expand this to include a semi-formal description of + Octave's language. + + @menu + * Keywords:: + @end menu + + @node Keywords, , Grammar, Grammar + @section Keywords + @cindex keywords + + The following identifiers are keywords, and may not be used as variable + or function names: + + @example + @group + all_va_args endwhile + break for + catch function + continue global + else gplot + elseif gsplot + end if + end_try_catch return + end_unwind_protect try + endfor unwind_protect + endfunction unwind_protect_cleanup + endif while + @end group + @end example + + The following command-like functions are also reserved, and may not be + used as variable or function names: + + @example + @group + casesen echo load show + cd edit_history ls type + chdir format more which + clear help run_history who + diary history save whos + dir hold set + @end group + @end example diff -cNr octave-2.0.2/doc/interpreter/image.texi octave-2.0.3/doc/interpreter/image.texi *** octave-2.0.2/doc/interpreter/image.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/image.texi Mon Feb 17 00:42:54 1997 *************** *** 1,8 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Image Processing, Audio Processing, Plotting, Top @chapter Image Processing To display images using these functions, you must be using Octave with --- 1,8 ---- ! @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 Image Processing, Audio Processing, Signal Processing, Top @chapter Image Processing To display images using these functions, you must be using Octave with *************** *** 11,17 **** manipulate images, however, so some of these functions may be useful even if you are not able to view the results. ! @deftypefn {Function File} {} colormap Set the current colormap. @code{colormap (@var{map})} sets the current colormap to @var{map}. The --- 11,25 ---- manipulate images, however, so some of these functions may be useful even if you are not able to view the results. ! Loading images only works with Octave's image format (a file with a ! matrix containing the image data, and a matrix containing the ! colormap). Contributions of robust, well-written functions to read ! other image formats are welcome. If you can provide them, or would like ! to improve Octave's image processing capabilities in other ways, please ! contact @email{bug-octave@@bevo.che.wisc.edu}. ! ! @deftypefn {Function File} {} colormap (@var{map}) ! @deftypefnx {Function File} {} colormap ("default") Set the current colormap. @code{colormap (@var{map})} sets the current colormap to @var{map}. The *************** *** 26,62 **** @end deftypefn @deftypefn {Function File} {} gray (@var{n}) ! Create a gray colormap with values from 0 to @var{n}. The argument ! @var{n} should be a scalar. If it is omitted, 64 is assumed. @end deftypefn ! @deftypefn {Function File} {} gray2ind Convert a gray scale intensity image to an Octave indexed image. @end deftypefn ! @deftypefn {Function File} {} image ! Display an Octave image matrix. ! ! @code{image (@var{x})} displays a matrix as a color image. The elements ! of @var{x} are indices into the current colormap and should have values ! between 1 and the length of the colormap. ! ! @code{image (@var{x}, @var{zoom})} changes the zoom factor. The default ! value is 4. ! @end deftypefn ! ! @deftypefn {Function File} {} imagesc ! Scale and display a matrix as an image. ! ! @code{imagesc (@var{x})} displays a scaled version of the matrix ! @var{x}. The matrix is scaled so that its entries are indices into the ! current colormap. The scaled matrix is returned. ! ! @code{imagesc (@var{x}, @var{zoom})} sets the magnification, the default ! value is 4. ! @end deftypefn ! ! @deftypefn {Function File} {} imshow Display images. @code{imshow (@var{x})} displays an indexed image using the current --- 34,66 ---- @end deftypefn @deftypefn {Function File} {} gray (@var{n}) ! Return a gray colormap with @var{n} entries corresponding to values from ! 0 to @var{n}. The argument @var{n} should be a scalar. If it is ! omitted, 64 is assumed. @end deftypefn ! @deftypefn {Function File} {[@var{img}, @var{map}] =} gray2ind (@var{}) Convert a gray scale intensity image to an Octave indexed image. @end deftypefn ! @deftypefn {Function File} {} image (@var{x}, @var{zoom}) ! Display a matrix as a color image. The elements of @var{x} are indices ! into the current colormap and should have values between 1 and the ! length of the colormap. If @var{zoom} is omitted, a value of 4 is ! assumed. ! @end deftypefn ! ! @deftypefn {Function File} {} imagesc (@var{x}, @var{zoom}) ! Display a scaled version of the matrix @var{x} as a color image. The ! matrix is scaled so that its entries are indices into the current ! colormap. The scaled matrix is returned. If @var{zoom} is omitted, a ! value of 4 is assumed. ! @end deftypefn ! ! @deftypefn {Function File} {} imshow (@var{x}, @var{map}) ! @deftypefnx {Function File} {} imshow (@var{x}, @var{n}) ! @deftypefnx {Function File} {} imshow (@var{i}, @var{n}) ! @deftypefnx {Function File} {} imshow (@var{r}, @var{g}, @var{b}) Display images. @code{imshow (@var{x})} displays an indexed image using the current *************** *** 70,140 **** @code{imshow (@var{r}, @var{g}, @var{b})} displays an RGB image. @end deftypefn ! @deftypefn {Function File} {} ind2gray Convert an Octave indexed image to a gray scale intensity image. ! ! @code{@var{y} = ind2gray (@var{x})} converts an indexed image to a gray ! scale intensity image. The current colormap is used to determine the ! intensities. The intensity values lie between 0 and 1 inclusive. ! ! @code{@var{y} = ind2gray (@var{x}, @var{map})} uses the specified ! colormap instead of the current one in the conversion process. @end deftypefn ! @deftypefn {Function File} {} ind2rgb Convert an indexed image to red, green, and blue color components. ! ! @code{[@var{r}, @var{g}, @var{b}] = ind2rgb (@var{x})} uses the current ! colormap for the conversion. ! ! @code{[@var{r}, @var{g}, @var{b}] = ind2rgb (@var{x}, @var{map})} uses ! the specified colormap. @end deftypefn ! @deftypefn {Function File} {} loadimage ! Load an image file. ! ! @code{[@var{x}, @var{map}] = loadimage (@var{file})} loads an image and ! it's associated color map from the specified @var{file}. The image must ! be stored in Octave's image format. @end deftypefn ! @c @deftypefn {Function File} {} rgb2ntsc ! @c @end deftypefn ! @c @c @deftypefn {Function File} {} ntsc2rgb ! @c @end deftypefn @deftypefn {Function File} {} ocean (@var{n}) Create color colormap. The argument @var{n} should be a scalar. If it is omitted, 64 is assumed. @end deftypefn ! @deftypefn {Function File} {} rgb2ind Convert and RGB image to an Octave indexed image. - - @code{[@var{x}, @var{map}] = rgb2ind (@var{r}, @var{g}, @var{b})} @end deftypefn ! @deftypefn {Function File} {} saveimage ! Save a matrix to disk in image format. ! ! @code{saveimage (@var{file}, @var{x})} saves matrix @var{x} to @var{file} ! in Octave's image format. The current colormap is also saved in the file. ! ! @code{saveimage (@var{file}, @var{x}, "img")} saves the image in the ! default format and is the same as @code{saveimage (@var{file}, @var{x})}. ! ! @code{saveimage (@var{file}, @var{x}, "ppm")} saves the image in ppm ! format instead of the default Octave image format. ! ! @code{saveimage (@var{file}, @var{x}, "ps")} saves the image in ! PostScript format instead of the default Octave image format. (Note: ! images saved in PostScript format can not be read back into Octave with ! loadimage.) ! @code{saveimage (@var{file}, @var{x}, @var{fmt}, @var{map})} saves the ! image along with the specified colormap in the specified format. Note: if the colormap contains only two entries and these entries are black and white, the bitmap ppm and PostScript formats are used. If the --- 74,130 ---- @code{imshow (@var{r}, @var{g}, @var{b})} displays an RGB image. @end deftypefn ! @deftypefn {Function File} {} ind2gray (@var{x}, @var{map}) Convert an Octave indexed image to a gray scale intensity image. ! If @var{map} is omitted, the current colormap is used to determine the ! intensities. @end deftypefn ! @deftypefn {Function File} {[@var{r}, @var{g}, @var{b}] =} ind2rgb (@var{x}, @var{map}) Convert an indexed image to red, green, and blue color components. ! If @var{map} is omitted, the current colormap is used for the conversion. @end deftypefn ! @deftypefn {Function File} {[@var{x}, @var{map}] =} loadimage (@var{file}) ! Load an image file and it's associated color map from the specified ! @var{file}. The image must be stored in Octave's image format. @end deftypefn ! @deftypefn {Function File} {} rgb2ntsc (@var{rgb}) ! Image format conversion. ! @end deftypefn ! @deftypefn {Function File} {} ntsc2rgb (@var{yiq}) ! Image format conversion. ! @end deftypefn @deftypefn {Function File} {} ocean (@var{n}) Create color colormap. The argument @var{n} should be a scalar. If it is omitted, 64 is assumed. @end deftypefn ! @deftypefn {Function File} {[@var{x}, @var{map}] =} rgb2ind (@var{r}, @var{g}, @var{b}) Convert and RGB image to an Octave indexed image. @end deftypefn ! @deftypefn {Function File} {} saveimage (@var{file}, @var{x}, @var{fmt}, @var{map}) ! Save the matrix @var{x} to @var{file} in image format @var{fmt}. Valid ! values for @var{fmt} are ! ! @table @code ! @item "img" ! Octave's image format. The current colormap is also saved in the file. ! ! @item "ppm" ! Portable pixmap format. ! ! @item "ps" ! PostScript format. Note that images saved in PostScript format can not ! be read back into Octave with loadimage. ! @end table ! If the fourth argument is supplied, the specified colormap will also be ! saved along with the image. Note: if the colormap contains only two entries and these entries are black and white, the bitmap ppm and PostScript formats are used. If the diff -cNr octave-2.0.2/doc/interpreter/install.texi octave-2.0.3/doc/interpreter/install.texi *** octave-2.0.2/doc/interpreter/install.texi Sun Jan 26 23:39:25 1997 --- octave-2.0.3/doc/interpreter/install.texi Tue Feb 18 01:46:23 1997 *************** *** 1,4 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. --- 1,4 ---- ! @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. *************** *** 6,12 **** @c in the Octave distribution, as well as in the Octave manual. @ifclear INSTALLONLY ! @node Installation, Trouble, Emacs, Top @appendix Installing Octave @end ifclear --- 6,12 ---- @c in the Octave distribution, as well as in the Octave manual. @ifclear INSTALLONLY ! @node Installation, Emacs, Trouble, Top @appendix Installing Octave @end ifclear *************** *** 19,25 **** under the terms of the GNU General Public License as published by the Free Software Foundation. ! @node Installation, Installation, Installation, (dir) @chapter Installing Octave @end ifset --- 19,25 ---- under the terms of the GNU General Public License as published by the Free Software Foundation. ! @node Installation, , Installation @chapter Installing Octave @end ifset *************** *** 47,62 **** Look for Octave sources in the directory @var{dir}. @item --with-f2c ! Use f2c even if Fortran compiler is available. ! @item --enable-dld ! Use DLD to make Octave capable of dynamically linking ! externally compiled functions. This only works on systems that have a ! working port of DLD. @item --enable-lite-kernel ! Compile smaller kernel. This currently requires DLD so that Octave can ! load functions at run time that are not loaded at compile time. @item --help Print a summary of the options recognized by the configure script. --- 47,71 ---- Look for Octave sources in the directory @var{dir}. @item --with-f2c ! Use @code{f2c} even if a Fortran compiler is available. ! @item --with-g77 ! Use @code{g77} to compile Fortran code. ! ! @item --enable-dl ! Use @code{dlopen} and friends to make Octave capable of dynamically ! linking externally compiled functions. This only works on systems that ! actually have these functions. ! ! @item --enable-shl ! Use @code{shl_load} and friends to make Octave capable of dynamically ! linking externally compiled functions. This only works on systems that ! actually have these functions (only HP-UX systems). @item --enable-lite-kernel ! Compile smaller kernel. This currently requires the dynamic linking ! functions @code{dlopen} or @code{shl_load} and friends so that Octave ! can load functions at run time that are not loaded at compile time. @item --help Print a summary of the options recognized by the configure script. *************** *** 69,77 **** @item Run make. ! You will need a recent version of GNU make. Modifying Octave's makefiles to work with other make programs is probably not worth ! your time. We recommend you get and compile GNU make instead. For plotting, you will need to have gnuplot installed on your system. Gnuplot is a command-driven interactive function plotting program. --- 78,86 ---- @item Run make. ! You will need a recent version of GNU Make. Modifying Octave's makefiles to work with other make programs is probably not worth ! your time. We recommend you get and compile GNU Make instead. For plotting, you will need to have gnuplot installed on your system. Gnuplot is a command-driven interactive function plotting program. *************** *** 79,110 **** is a coincidence---it is not related to the GNU project or the FSF in any but the most peripheral sense. ! For version @value{VERSION}, you must have the GNU C++ compiler (gcc) ! version 2.7.2 or later to compile Octave. You will also need version ! 2.7.1 or 2.7.2 of the GNU C++ class library (libg++). If you plan to ! modify the parser you will also need GNU bison and fles. If you modify ! the documentation, you will need GNU Texinfo, along with the patch for ! the makeinfo program that is distributed with Octave. ! ! GNU make, gcc, and libg++, gnuplot, bison, flex, and Texinfo are all ! available from many anonymous ftp archives. The primary site is ! prep.ai.mit.edu, but it is often very busy. A list of sites that mirror ! the software on prep is available by anonymous ftp from prep.ai.mit.edu ! in the file @file{/pub/gnu/GNUinfo/FTP}, or by fingering ! fsf@@prep.ai.mit.edu. If you don't have a Fortran compiler, or if your Fortran compiler doesn't work like the traditional Unix f77, you will need to have the ! Fortran to C translator f2c. You can get f2c from any ! number of anonymous ftp archives. The most recent version of f2c ! is always available from netlib.att.com. ! ! On an otherwise idle SPARCstation II, it will take somewhere between 60 ! and 90 minutes to compile everything, depending on whether you are ! compiling the Fortran libraries with f2c or using the Fortran compiler ! directly. You will need about 50 megabytes of disk storage to work with ! (considerably less if you don't compile with debugging symbols). To do ! that, use the command @example make CFLAGS=-O CXXFLAGS=-O LDFLAGS= --- 88,120 ---- is a coincidence---it is not related to the GNU project or the FSF in any but the most peripheral sense. ! For version @value{VERSION}, you must have the GNU C++ compiler ! (@code{gcc}) version 2.7.2 or later to compile Octave. You will also ! need version 2.7.1 or 2.7.2 of the GNU C++ class library ! (@code{libg++}). If you plan to modify the parser you will also need ! GNU @code{bison} and @code{flex}. If you modify the documentation, you ! will need GNU Texinfo, along with the patch for the @code{makeinfo} ! program that is distributed with Octave. ! ! GNU Make, @code{gcc}, and @code{libg++}, @code{gnuplot}, @code{bison}, ! @code{flex}, and Texinfo are all available from many anonymous ftp ! archives. The primary site is @url{prep.ai.mit.edu}, but it is often ! very busy. A list of sites that mirror the software on @code{prep} is ! available by anonymous ftp from ! @url{ftp://prep.ai.mit.edu/pub/gnu/GNUinfo/FTP}, or by fingering ! @email{fsf@@prep.ai.mit.edu}. If you don't have a Fortran compiler, or if your Fortran compiler doesn't work like the traditional Unix f77, you will need to have the ! Fortran to C translator @code{f2c}. You can get @code{f2c} from any ! number of anonymous ftp archives. The most recent version of @code{f2c} ! is always available from @url{netlib.att.com}. ! ! On an otherwise idle Pentium 133 running Linux, it will take somewhere ! between 1-1/2 to 3 hours to compile everything, depending on whether you ! are building shared libraries. You will need about 100 megabytes of disk ! storage to work with (considerably less if you don't compile with debugging ! symbols). To do that, use the command @example make CFLAGS=-O CXXFLAGS=-O LDFLAGS= *************** *** 194,200 **** find the source for the header file and install it in the directory @file{usr/include}. This is reportedly a problem with Slackware 3.1. For Linux/GNU systems, the source for @file{dlfcn.h} is in the ! @samp{ldso} package. @item If you encounter errors like --- 204,210 ---- find the source for the header file and install it in the directory @file{usr/include}. This is reportedly a problem with Slackware 3.1. For Linux/GNU systems, the source for @file{dlfcn.h} is in the ! @code{ldso} package. @item If you encounter errors like *************** *** 215,223 **** @noindent while compiling @file{sighandlers.cc}, you may need to edit some files ! in the gcc include subdirectory to add proper prototypes for functions there. For example, Ultrix 4.2 needs proper declarations for the ! @code{signal()} and the @code{SIG_IGN} macro in the file @file{signal.h}. On some systems the @code{SIG_IGN} macro is defined to be something like this: --- 225,234 ---- @noindent while compiling @file{sighandlers.cc}, you may need to edit some files ! in the @code{gcc} include subdirectory to add proper prototypes for functions there. For example, Ultrix 4.2 needs proper declarations for the ! @code{signal} function and the @code{SIG_IGN} macro in the file ! @file{signal.h}. On some systems the @code{SIG_IGN} macro is defined to be something like this: *************** *** 234,267 **** @end example @noindent ! to match the prototype declaration for @code{signal()}. This change ! should also be made for the @code{SIG_DFL} and @code{SIG_ERR} symbols. ! It may be necessary to change the definitions in @file{sys/signal.h} as ! well. ! ! The gcc fixincludes/fixproto script should probably fix these problems ! when gcc installs its modified set of header files, but I don't think ! that's been done yet. @strong{You should not change the files in @file{/usr/include}}. You ! can find the gcc include directory tree by running the command @example gcc -print-libgcc-file-name @end example @noindent ! The directory of gcc include files normally begins in the same directory that contains the file @file{libgcc.a}. @item ! There is a bug with the makeinfo program that is distributed with Texinfo (through version 3.9) that causes the indices in Octave's on-line manual to be generated incorrectly. If you need to recreate the ! on-line documentation, you should get the makeinfo program that is ! distributed with texinfo-3.9 and apply the patch for makeinfo that is ! distributed with Octave. See the file @file{MAKEINFO.PATCH} for more ! details. @item Some of the Fortran subroutines may fail to compile with older versions --- 245,278 ---- @end example @noindent ! to match the prototype declaration for the @code{signal} function. This ! change should also be made for the @code{SIG_DFL} and @code{SIG_ERR} ! symbols. It may be necessary to change the definitions in ! @file{sys/signal.h} as well. ! ! The @code{gcc} @code{fixincludes} and @code{fixproto} scripts should ! probably fix these problems when @code{gcc} installs its modified set of ! header files, but I don't think that's been done yet. @strong{You should not change the files in @file{/usr/include}}. You ! can find the @code{gcc} include directory tree by running the command @example gcc -print-libgcc-file-name @end example @noindent ! The directory of @code{gcc} include files normally begins in the same directory that contains the file @file{libgcc.a}. @item ! There is a bug with the @code{makeinfo} program that is distributed with Texinfo (through version 3.9) that causes the indices in Octave's on-line manual to be generated incorrectly. If you need to recreate the ! on-line documentation, you should get the @code{makeinfo} program that ! is distributed with texinfo-3.9 and apply the patch for @code{makeinfo} ! that is distributed with Octave. See the file @file{MAKEINFO.PATCH} for ! more details. @item Some of the Fortran subroutines may fail to compile with older versions *************** *** 304,310 **** Some people have reported that calls to shell_cmd and the pager do not work on SunOS systems. This is apparently due to having @code{G_HAVE_SYS_WAIT} defined to be 0 instead of 1 when compiling ! libg++. @item On NeXT systems, linking to @file{libsys_s.a} may fail to resolve the --- 315,321 ---- Some people have reported that calls to shell_cmd and the pager do not work on SunOS systems. This is apparently due to having @code{G_HAVE_SYS_WAIT} defined to be 0 instead of 1 when compiling ! @code{libg++}. @item On NeXT systems, linking to @file{libsys_s.a} may fail to resolve the *************** *** 355,367 **** proper thing to do. @item ! If you don't have NPSOL but you still want to be able to solve NLPs, or ! if you don't have QPSOL but you still want to solve QPs, you'll need to ! find replacements or order them from Stanford. If you know of a freely ! redistributable replacement, please let us know---we might be interested ! in distributing it with Octave. ! You can get more information about NPSOL and QPSOL from @quotation Stanford Business Sofrtware, Inc.@* --- 366,378 ---- proper thing to do. @item ! If you don't have @sc{Npsol} but you still want to be able to solve ! NLPs, or if you don't have @sc{Qpsol} but you still want to solve QPs, ! you'll need to find replacements or order them from Stanford. If you ! know of a freely redistributable replacement, please let us know---we ! might be interested in distributing it with Octave. ! You can get more information about @sc{Npsol} and @sc{Qpsol} from @quotation Stanford Business Sofrtware, Inc.@* *************** *** 371,387 **** Fax: (415) 962-1869 @end quotation ! Octave may soon support FSQP, an NLP solver from Andre Tits ! (andre@@src.umd.edu) of the University of Maryland. FSQP is available ! free of charge to academic sites, but can not be redistributed to third ! parties. @end itemize @node Binary Distributions, , Installation Problems, Installation @appendixsec Binary Distributions ! This section contains instructions for creating and installing a ! binary distribution. @menu * Installing Octave from a Binary Distribution:: --- 382,418 ---- Fax: (415) 962-1869 @end quotation ! Octave may soon support @sc{Fsqp}, an NLP solver from Andre Tits ! @email{andre@@src.umd.edu} of the University of Maryland. @sc{Fsqp} is ! available free of charge to academic sites, but can not be redistributed ! to third parties. @end itemize @node Binary Distributions, , Installation Problems, Installation @appendixsec Binary Distributions ! Although Octave is not very difficult to build from its sources, it is a ! relatively large program that does require a significant amount of time ! and disk space to compile and install. Because of this, many people ! want to be able to obtain binary distributions so they can start using ! Octave immediately, without having to bother with the details of ! compiling it first. This is understandable, so I try to maintain a ! current collection of binary distributions at ! @url{ftp://ftp.che.wisc.edu/pub/octave/BINARIES}. ! ! Please understand, however, that there is only a limited amount of time ! available to devote to making binaries, so binaries may not be ! immediately available for some platforms. (Please contact ! @email{bug-octave@@bevo.che.wisc.edu} if you are interested in helping ! make a binary distributions available for your system.) ! ! Also, binary distributions are limited to static binaries that do not ! support dynamic linking. For earlier versions of Octave, I tried ! distributing dynamically linked binaries but that proved to be too much ! trouble to support. If you want to have a copy of Octave that includes ! all the features described in this manual, you will have to build it ! from the sources yourself, or find someone else who is willing to do it ! for you. @menu * Installing Octave from a Binary Distribution:: *************** *** 391,398 **** @node Installing Octave from a Binary Distribution, Creating a Binary Distribution, Binary Distributions, Binary Distributions @appendixsubsec Installing Octave from a Binary Distribution - @itemize @bullet - @item To install Octave from a binary distribution, execute the command @example --- 422,427 ---- *************** *** 438,446 **** @noindent where @var{version} stands for the current version number of the interpreter, and @var{host_type} is the type of computer on which Octave ! is installed (for example, @samp{i486-unknown-gnu}). ! If these directories don't exist, the script @file{install-octave} will create them for you. The installation script also creates the following subdirectories of @file{/usr/local} that are intended for locally installed functions: --- 467,475 ---- @noindent where @var{version} stands for the current version number of the interpreter, and @var{host_type} is the type of computer on which Octave ! is installed (for example, @samp{@value{TARGETHOSTTYPE}}). ! If these directories don't exist, the script @code{install-octave} will create them for you. The installation script also creates the following subdirectories of @file{/usr/local} that are intended for locally installed functions: *************** *** 450,456 **** Locally installed M-files. @item libexec/octave/site/exec/@var{host_type} ! Locally installed binaries intendec to be run by Octave rather than by the user. @item libexec/octave/site/octave/@var{host_type} --- 479,485 ---- Locally installed M-files. @item libexec/octave/site/exec/@var{host_type} ! Locally installed binaries intended to be run by Octave rather than by the user. @item libexec/octave/site/octave/@var{host_type} *************** *** 469,525 **** @noindent will install Octave in subdirectories of the directory @file{/some/other/directory}. - @end itemize @node Creating a Binary Distribution, , Installing Octave from a Binary Distribution, Binary Distributions @appendixsubsec Creating a Binary Distribution ! Here is how to build a binary distribution for others. @itemize @bullet @item ! Unpack the source distribution. ! ! @item ! Configure Octave using the command @example ! ./configure --disable-dl --disable-shl --disable-shared @end example - If your system supports shared libraries and dynamic linking, you should - also build a binary that supports those features, but it is important to - create a statically linked executable that will run no matter what - versions of the libraries are installed on the target system. - @item ! Build the binaries using the command @example ! make LDFLAGS=-static @end example @item ! Type @samp{make static-binary-dist}. This will create a compressed tar ! file ready for distribution. The file will have a name like ! @file{octave-@var{version}-@var{host_type}-static.tar.gz}. ! ! @item ! If your system supports dynamic linking and shared libraries, build ! another version of Octave that supports these features. Use the ! commands @example ! @group ! configure --enable-shared ! make ! make dynamic-binary-dist ! @end group @end example ! @noindent ! This will create a compressed tar file ready for distribution. The file ! will have a name like ! @file{octave-@var{version}-@var{host_type}-dynamic.tar.gz}. ! @end itemize --- 498,538 ---- @noindent will install Octave in subdirectories of the directory @file{/some/other/directory}. @node Creating a Binary Distribution, , Installing Octave from a Binary Distribution, Binary Distributions @appendixsubsec Creating a Binary Distribution ! Here is how to build a binary distribution for others to use. If you ! want to make a binary distribution for your system available along with ! the Octave sources and binaries on @url{ftp.che.wisc.edu}, please follow ! this procedure. For directions explaining how to make the binary ! available on the ftp site, please contact ! @email{bug-octave@@bevo.che.wisc.edu}. @itemize @bullet @item ! Unpack the source distribution: @example ! gunzip -c octave-@value{VERSION}.tar.gz | tar xf - @end example @item ! Change your current directory to the top-level directory of the source ! distribution: @example ! cd octave-@value{VERSION} @end example @item ! Make the binary distribution: @example ! make binary-dist @end example ! This will create a compressed tar file ready for distribution. ! It will contain statically linked binaries and have a name like ! @file{octave-@value{VERSION}-@value{TARGETHOSTTYPE}.tar.gz} @end itemize diff -cNr octave-2.0.2/doc/interpreter/intro.texi octave-2.0.3/doc/interpreter/intro.texi *** octave-2.0.2/doc/interpreter/intro.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/intro.texi Sun Feb 16 22:48:26 1997 *************** *** 1,13 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Introduction, Invoking Octave, Preface, Top @chapter A Brief Introduction to Octave @cindex introduction ! This manual documents how to run, install and port Octave, and how ! to report bugs. Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for --- 1,13 ---- ! @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 Introduction, Getting Started, Preface, Top @chapter A Brief Introduction to Octave @cindex introduction ! This manual documents how to run, install and port Octave, and how to ! report bugs. Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for *************** *** 30,69 **** @menu * Running Octave:: * Simple Examples:: ! * Comments:: ! * Executable Octave Programs:: ! * Errors:: @end menu @node Running Octave, Simple Examples, Introduction, Introduction @section Running Octave On most systems, the way to invoke Octave is with the shell command ! @samp{octave}. Octave displays an initial message and then a prompt indicating it is ready to accept input. You can begin typing Octave commands immediately afterward. If you get into trouble, you can usually interrupt Octave by typing @kbd{Control-C} (usually written @kbd{C-c} for short). @kbd{C-c} gets ! its name from the fact that you type it by holding down the @kbd{CTRL} ! key and then pressing @kbd{c}. Doing this will normally return you to ! Octave's prompt. @cindex exiting octave @cindex quitting octave ! To exit Octave, type @samp{quit}, or @samp{exit} at the Octave prompt. ! ! @deftypefn {Built-in Function} {} exit (@var{status}) ! @deftypefnx {Built-in Function} {} quit (@var{status}) ! Exit the current Octave session. If the optional integer value ! @var{status} is supplied, pass that value to the operating system as the ! Octave's exit status. ! @end deftypefn On systems that support job control, you can suspend Octave by sending it a @code{SIGTSTP} signal, usually by typing @kbd{C-z}. ! @node Simple Examples, Comments, Running Octave, Introduction @section Simple Examples The following chapters describe all of Octave's features in detail, but --- 30,60 ---- @menu * Running Octave:: * Simple Examples:: ! * Conventions:: @end menu @node Running Octave, Simple Examples, Introduction, Introduction @section Running Octave On most systems, the way to invoke Octave is with the shell command ! @kbd{octave}. Octave displays an initial message and then a prompt indicating it is ready to accept input. You can begin typing Octave commands immediately afterward. If you get into trouble, you can usually interrupt Octave by typing @kbd{Control-C} (usually written @kbd{C-c} for short). @kbd{C-c} gets ! its name from the fact that you type it by holding down @key{CTRL} and ! then pressing @key{c}. Doing this will normally return you to Octave's ! prompt. @cindex exiting octave @cindex quitting octave ! To exit Octave, type @kbd{quit}, or @kbd{exit} at the Octave prompt. On systems that support job control, you can suspend Octave by sending it a @code{SIGTSTP} signal, usually by typing @kbd{C-z}. ! @node Simple Examples, Conventions, Running Octave, Introduction @section Simple Examples The following chapters describe all of Octave's features in detail, but *************** *** 99,105 **** To display the value of any variable, simply type the name of the variable. For example, to display the value stored in the matrix ! @samp{b}, type the command @example octave:3> b --- 90,96 ---- To display the value of any variable, simply type the name of the variable. For example, to display the value stored in the matrix ! @code{b}, type the command @example octave:3> b *************** *** 108,121 **** @unnumberedsubsec Matrix Arithmetic Octave has a convenient operator notation for performing matrix ! arithmetic. For example, to multiply the matrix @var{a} by a scalar value, type the command @example octave:4> 2 * a @end example ! To multiply the two matrices @var{a} and @var{b}, type the command @example octave:5> a * b --- 99,112 ---- @unnumberedsubsec Matrix Arithmetic Octave has a convenient operator notation for performing matrix ! arithmetic. For example, to multiply the matrix @code{a} by a scalar value, type the command @example octave:4> 2 * a @end example ! To multiply the two matrices @code{a} and @code{b}, type the command @example octave:5> a * b *************** *** 124,134 **** To form the matrix product @iftex @tex ! $a^Ta$, @end tex @end iftex @ifinfo ! @code{transpose (a) * a}, @end ifinfo type the command --- 115,125 ---- To form the matrix product @iftex @tex ! $@code{a}^T@code{a}$, @end tex @end iftex @ifinfo ! @code{transpose (a) * a}, @end ifinfo type the command *************** *** 138,152 **** @unnumberedsubsec Solving Linear Equations ! To solve the set of linear equations ! @iftex ! @tex ! ${\bf Ax} = {\bf b}$, ! @end tex ! @end iftex ! @ifinfo ! @code{Ax = b}, ! @end ifinfo use the left division operator, @samp{\}: @example --- 129,135 ---- @unnumberedsubsec Solving Linear Equations ! To solve the set of linear equations @code{a@var{x} = b}, use the left division operator, @samp{\}: @example *************** *** 157,167 **** This is conceptually equivalent to @iftex @tex ! ${\bf A}^{-1}{\bf b}$, @end tex @end iftex @ifinfo ! inv (A) * b, @end ifinfo but avoids computing the inverse of a matrix directly. --- 140,150 ---- This is conceptually equivalent to @iftex @tex ! $@code{a}^{-1}@code{b}$, @end tex @end iftex @ifinfo ! @code{inv (a) * b}, @end ifinfo but avoids computing the inverse of a matrix directly. *************** *** 175,181 **** @iftex @tex $$ ! {dx \over dt} = f(x,t), \qquad {\rm with} x(t=t_0) = x_0 $$ @end tex @end iftex --- 158,164 ---- @iftex @tex $$ ! {dx \over dt} = f(x,t), \qquad x(t=t_0) = x_0 $$ @end tex @end iftex *************** *** 256,262 **** @end example @noindent ! The function @samp{lsode} uses the Livermore Solver for Ordinary Differential Equations, described in A. C. Hindmarsh, @cite{ODEPACK, a Systematized Collection of ODE Solvers}, in: Scientific Computing, R. S. Stepleman et al. (Eds.), North-Holland, Amsterdam, 1983, pages 55--64. --- 239,245 ---- @end example @noindent ! The function @code{lsode} uses the Livermore Solver for Ordinary Differential Equations, described in A. C. Hindmarsh, @cite{ODEPACK, a Systematized Collection of ODE Solvers}, in: Scientific Computing, R. S. Stepleman et al. (Eds.), North-Holland, Amsterdam, 1983, pages 55--64. *************** *** 276,282 **** kind of terminal you have. Type the command @example ! set term @end example @noindent --- 259,265 ---- kind of terminal you have. Type the command @example ! gset term @end example @noindent *************** *** 290,304 **** @example @group ! set term postscript ! set output "foo.ps" replot @end group @end example @noindent This will work for other types of output devices as well. Octave's ! @samp{set} command is really just piped to the @code{gnuplot} subprocess, so that once you have a plot on the screen that you like, you should be able to do something like this to create an output file suitable for your graphics printer. --- 273,287 ---- @example @group ! gset term postscript ! gset output "foo.ps" replot @end group @end example @noindent This will work for other types of output devices as well. Octave's ! @code{gset} command is really just piped to the @code{gnuplot} subprocess, so that once you have a plot on the screen that you like, you should be able to do something like this to create an output file suitable for your graphics printer. *************** *** 307,314 **** @example @group ! set term postscript ! set output "|lpr -Pname_of_your_graphics_printer" replot @end group @end example --- 290,297 ---- @example @group ! gset term postscript ! gset output "|lpr -Pname_of_your_graphics_printer" replot @end group @end example *************** *** 318,329 **** At the Octave prompt, you can recall, edit, and reissue previous commands using Emacs- or vi-style editing commands. The default keybindings use Emacs-style commands. For example, to recall the ! previous command, type @kbd{Control-P} (usually written @kbd{C-p} for ! short). @kbd{C-p} gets its name from the fact that you type it by ! holding down the @kbd{CTRL} key and then pressing @kbd{p}. Doing this ! will normally bring back the previous line of input. @kbd{C-n} will ! bring up the next line of input, @kbd{C-b} will move the cursor backward ! on the line, @kbd{C-f} will move the cursor forward on the line, etc. A complete description of the command line editing capability is given in this manual in @ref{Command Line Editing}. --- 301,312 ---- At the Octave prompt, you can recall, edit, and reissue previous commands using Emacs- or vi-style editing commands. The default keybindings use Emacs-style commands. For example, to recall the ! previous command, type @kbd{Control-p} (usually written @kbd{C-p} for ! short). @kbd{C-p} gets its name from the fact that you type it by ! holding down @key{CTRL} and then pressing @key{p}. Doing this will ! normally bring back the previous line of input. @kbd{C-n} will bring up ! the next line of input, @kbd{C-b} will move the cursor backward on the ! line, @kbd{C-f} will move the cursor forward on the line, etc. A complete description of the command line editing capability is given in this manual in @ref{Command Line Editing}. *************** *** 351,565 **** will display the help text for the @code{plot} function. Octave sends output that is too long to fit on one screen through a ! pager like @code{less} or @code{more}. Type a carriage return to ! advance one line, a space character to advance one page, and @samp{q} to ! exit the pager. ! ! @unnumberedsubsubsec Help via Info The part of Octave's help facility that allows you to read the complete ! text of the printed manual from within Octave uses a program called ! Info. When you invoke Info you will be put into a menu driven program ! that contains the entire Octave manual. Help for using Info is provided ! in this manual in @ref{Using Info}. ! ! @node Comments, Executable Octave Programs, Simple Examples, Introduction ! @section Comments in Octave Programs ! @cindex @samp{#} ! @cindex @samp{%} ! @cindex comments ! @cindex use of comments ! @cindex documenting Octave programs ! @cindex programs, documenting ! ! A @dfn{comment} is some text that is included in a program for the sake ! of human readers, and that is not really part of the program. Comments ! can explain what the program does, and how it works. Nearly all ! programming languages have provisions for comments, because programs are ! typically hard to understand without them. ! ! In the Octave language, a comment starts with either the sharp sign ! character, @samp{#}, or the percent symbol @samp{%} and continues to the ! end of the line. The Octave interpreter ignores the rest of a ! line following a sharp sign or percent symbol. For example, we could ! have put the following into the function @code{f}: ! @smallexample ! function xdot = f (x, t) ! # usage: f (x, t) ! # ! # This function defines the right-hand-side functions for a set of ! # nonlinear differential equations. ! r = 0.25 ! ! and so on... ! endfunction ! @end smallexample ! The @code{help} command (@pxref{Help}) is able to find the first block ! of comments in a function (even those that are composed directly on the ! command line). This means that users of Octave can use the same ! commands to get help for built-in functions, and for functions that you ! have defined. For example, after defining the function @code{f} above, ! the command @example ! help f @end example @noindent ! produces the output ! ! @smallexample ! usage: f (x, t) ! ! This function defines the right-hand-side functions for a set of ! nonlinear differential equations. ! @end smallexample ! ! Although it is possible to put comment lines into keyboard-composed ! throw-away Octave programs, it usually isn't very useful, because the ! purpose of a comment is to help you or another person understand the ! program at a later time. ! ! @node Executable Octave Programs, Errors, Comments, Introduction ! @section Executable Octave Programs ! @cindex executable scripts ! @cindex scripts, executable ! @cindex self contained programs ! @cindex program, self contained ! @cindex @samp{#!} ! Once you have learned Octave, you may want to write self-contained ! Octave scripts, using the @samp{#!} script mechanism. You can do this ! on GNU systems and on many Unix systems @footnote{The @samp{#!} ! mechanism works on Unix systems derived from Berkeley Unix, System V ! Release 4, and some System V Release 3 systems.} ! ! For example, you could create a text file named @file{hello}, containing ! the following lines: @example @group ! #! @value{OCTAVEHOME}/bin/octave -qf ! # a sample Octave program ! printf ("Hello, world!\n"); @end group @end example @noindent ! After making this file executable (with the @code{chmod} command), you ! can simply type: @example ! hello ! @end example ! ! @noindent ! at the shell, and the system will arrange to run Octave @footnote{The ! line beginning with @samp{#!} lists the full file name of an interpreter ! to be run, and an optional initial command line argument to pass to that ! interpreter. The operating system then runs the interpreter with the ! given argument and the full argument list of the executed program. The ! first argument in the list is the full file name of the Octave program. ! The rest of the argument list will either be options to Octave, or data ! files, or both. The @code{-qf} option is usually specified in ! stand-alone Octave programs to prevent them from printing the normal ! startup message, and to keep them from behaving differently depending on ! the contents of a particular user's @file{~/.octaverc} file. ! @xref{Invoking Octave}.} as if you had typed: ! @example ! octave hello @end example @noindent ! Self-contained Octave scripts are useful when you want to write a ! program which users can invoke without knowing that the program is ! written in the Octave language. ! @node Errors, , Executable Octave Programs, Introduction ! @section Errors ! ! There are two classes of errors that Octave produces when it encounters ! input that it is unable to understand, or when it is unable to perform ! an action. ! ! A @dfn{parse error} occurs if Octave cannot understand something you ! have typed. For example, if you misspell a keyword, @example ! octave:13> functon y = f (x) y = x^2; endfunction @end example ! @noindent ! Octave will respond immediately with a message like this: @example ! parse error: ! functon y = f (x) y = x^2; endfunction ! ^ ! @end example ! @noindent ! For most parse errors, Octave uses a caret (@samp{^}) to mark the point ! on the line where it was unable to make sense of your input. In this ! case, Octave generated an error message because the keyword ! @code{function} was misspelled. Instead of seeing @samp{function f}, ! Octave saw two consecutive variable names, which is invalid in this ! context. It marked the error at the @code{y} because the first name by ! itself was accepted as valid input. ! Another class of error message occurs occurs at evaluation time. These ! errors are called @dfn{run-time errors}, or sometimes ! @dfn{evaluation errors} because they occur when your program is being ! @dfn{run}, or @dfn{evaluated}. For example, if after correcting the ! mistake in the previous function definition, you type @example ! octave:13> f () @end example ! @noindent ! Octave will respond with @example @group ! error: `x' undefined near line 1 column 24 ! error: evaluating expression near line 1, column 24 ! error: evaluating assignment expression near line 1, column 22 ! error: called from `f' ! @end group ! @end example ! This error message has several parts, and gives you quite a bit of ! information to help you locate the source of the error. The messages ! are generated from the point of the innermost error, and provide a ! traceback of enclosing expressions and function calls. ! In the example above, the first line indicates that a variable named ! @samp{x} was found to be undefined near line 1 and column 24 of some ! function or expression. For errors occurring within functions, lines ! from the beginning of the file containing the function definition. For ! errors occurring at the top level, the line number indicates the input ! line number, which is usually displayed in the prompt string. ! The second and third lines in the example indicate that the error ! occurred within an assignment expression, and the last line of the error ! message indicates that the error occurred within the function @samp{f}. ! If the function @samp{f} had been called from another function, for ! example, @samp{g}, the list of errors would have ended with one more ! line: @example ! error: called from `g' @end example ! These lists of function calls usually make it fairly easy to trace the ! path your program took before the error occurred, and to correct the ! error before trying again. --- 334,602 ---- will display the help text for the @code{plot} function. Octave sends output that is too long to fit on one screen through a ! pager like @code{less} or @code{more}. Type a @key{RET} to advance one ! line, a @key{SPC} to advance one page, and @key{q} to exit the pager. The part of Octave's help facility that allows you to read the complete ! text of the printed manual from within Octave normally uses a separate ! program called Info. When you invoke Info you will be put into a menu ! driven program that contains the entire Octave manual. Help for using ! Info is provided in this manual in @ref{Getting Help}. ! @node Conventions, , Simple Examples, Introduction ! @section Conventions ! This section explains the notational conventions that are used in this ! manual. You may want to skip this section and refer back to it later. ! @menu ! * Fonts:: ! * Evaluation Notation:: ! * Printing Notation:: ! * Error Messages:: ! * Format of Descriptions:: ! @end menu ! @node Fonts, Evaluation Notation, Conventions, Conventions ! @subsection Fonts ! @cindex fonts ! ! Examples of Octave code appear in this font or form: @code{svd (a)}. ! Names that represent arguments or metasyntactic variables appear ! in this font or form: @var{first-number}. ! ! @node Evaluation Notation, Printing Notation, Fonts, Conventions ! @subsection Evaluation Notation ! @cindex evaluation notation ! @cindex documentation notation ! In the examples in this manual, results from expressions that you ! evaluate are indicated with @samp{@result{}}. For example, @example ! @group ! sqrt (2) ! ! @result{} 1.4142 ! @end group @end example @noindent ! You can read this as ``@code{sqrt (2)} evaluates to 1.4142''. ! In some cases, matrix values that are returned by expressions are ! displayed like this @example @group ! [1, 2; 3, 4] == [1, 3; 2, 4] ! @result{} [ 1, 0; 0, 1 ] @end group @end example @noindent ! and in other cases, they are displayed like this @example ! @group ! eye (3) ! @result{} 1 0 0 ! 0 1 0 ! 0 0 1 ! @end group @end example @noindent ! in order to clearly show the structure of the result. ! Sometimes to help describe one expression, another expression is ! shown that produces identical results. The exact equivalence of ! expressions is indicated with @samp{@equiv{}}. For example, @example ! @group ! rot90 ([1, 2; 3, 4], -1) ! @equiv{} ! rot90 ([1, 2; 3, 4], 3) ! @equiv{} ! rot90 ([1, 2; 3, 4], 7) ! @end group @end example ! @node Printing Notation, Error Messages, Evaluation Notation, Conventions ! @subsection Printing Notation ! @cindex printing notation ! ! Many of the examples in this manual print text when they are ! evaluated. Examples in this manual indicate printed text with ! @samp{@print{}}. The value that is returned by evaluating the ! expression (here @code{1}) is displayed with @samp{@result{}} and ! follows on a separate line. @example ! @group ! printf ("foo %s\n", "bar") ! @print{} foo bar ! @result{} 1 ! @end group ! @end example ! @node Error Messages, Format of Descriptions, Printing Notation, Conventions ! @subsection Error Messages ! @cindex error message notation ! ! Some examples signal errors. This normally displays an error message ! on your terminal. Error messages are shown on a line starting with ! @code{error:}. @example ! @group ! struct_elements ([1, 2; 3, 4]) ! error: struct_elements: wrong type argument `matrix' ! @end group @end example ! @node Format of Descriptions, , Error Messages, Conventions ! @subsection Format of Descriptions ! @cindex description format ! ! Functions, commands, and variables are described in this manual in a ! uniform format. The first line of a description contains the name of ! the item followed by its arguments, if any. ! @ifinfo ! The category---function, variable, or whatever---appears at the ! beginning of the line. ! @end ifinfo ! @iftex ! The category---function, variable, or whatever---is printed next to the ! right margin. ! @end iftex ! The description follows on succeeding lines, sometimes with examples. ! ! @menu ! * A Sample Function Description:: ! * A Sample Command Description:: ! * A Sample Variable Description:: ! @end menu ! ! @node A Sample Function Description, A Sample Command Description, Format of Descriptions, Format of Descriptions ! @subsubsection A Sample Function Description ! @cindex function descriptions ! ! In a function description, the name of the function being described ! appears first. It is followed on the same line by a list of parameters. ! The names used for the parameters are also used in the body of the ! description. ! ! Here is a description of an imaginary function @code{foo}: ! ! @deftypefn {Function} {} foo (@var{x}, @var{y}, @dots{}) ! The function @code{foo} subtracts @var{x} from @var{y}, then adds the ! remaining arguments to the result. If @var{y} is not supplied, then the ! number 19 is used by default. @example @group ! foo (1, [3, 5], 3, 9) ! ! @result{} [ 14, 16 ] ! foo (5) ! @result{} 14 ! @end group ! @end example ! More generally, @example ! @group ! foo (@var{w}, @var{x}, @var{y}, @dots{}) ! @equiv{} ! @var{x} - @var{w} + @var{y} + @dots{} ! @end group @end example + @end deftypefn ! Any parameter whose name contains the name of a type (e.g., ! @var{integer}, @var{integer1} or @var{matrix}) is expected to be of that ! type. Parameters named @var{object} may be of any type. Parameters ! with other sorts of names (e.g., @var{new_file}) are discussed ! specifically in the description of the function. In some sections, ! features common to parameters of several functions are described at the ! beginning. ! ! Functions in Octave may be defined in several different ways. The ! catagory name for functions may include another name that indicates the ! way that the function is defined. These additional tags include ! ! @table @asis ! @item Built-in Function ! @cindex built-in function ! The function described is written in a language like C++, C, or Fortran, ! and is part of the compiled Octave binary. ! ! @item Loadable Function ! @cindex loadable function ! The function described is written in a language like C++, C, or Fortran. ! On systems that support dynamic linking of user-supplied functions, it ! may be automatically linked while Octave is running, but only if it is ! needed. @xref{Dynamically Linked Functions}. ! ! @item Function File ! @cindex function file ! The function described is defined using Octave commands stored in a text ! file. @xref{Function Files}. ! ! @item Mapping Function ! @cindex mapping function ! The function described works element-by-element for matrix and vector ! arguments. ! @end table ! ! @node A Sample Command Description, A Sample Variable Description, A Sample Function Description, Format of Descriptions ! @subsubsection A Sample Command Description ! @cindex command descriptions ! ! Command descriptions have a format similar to function descriptions, ! except that the word `Function' is replaced by `Command. Commands are ! functions that are called without surrounding their arguments in ! parentheses. For example, here is the description for Octave's ! @code{cd} command: ! ! @deffn {Command} cd dir ! @deffnx {Command} chdir dir ! Change the current working directory to @var{dir}. For example, ! @kbd{cd ~/octave} changes the current working directory to ! @file{~/octave}. If the directory does not exist, an error message is ! printed and the working directory is not changed. ! @end deffn ! ! @node A Sample Variable Description, , A Sample Command Description, Format of Descriptions ! @subsubsection A Sample Variable Description ! @cindex variable descriptions ! ! A @dfn{variable} is a name that can hold a value. Although any variable ! can be set by the user, @dfn{built-in variables} typically exist ! specifically so that users can change them to alter the way Octave ! behaves (built-in variables are also sometimes called @dfn{user ! options}). Ordinary variables and built-in variables are described ! using a format like that for functions except that there are no ! arguments. ! ! Here is a description of the imaginary variable ! @code{do_what_i_mean_not_what_i_say}. ! ! @defvr {Built-in Variable} do_what_i_mean_not_what_i_say ! If the value of this variable is nonzero, Octave will do what you ! actually wanted, even if you have typed a completely different and ! meaningless list of commands. ! @end defvr ! ! Other variable descriptions have the same format, but `Built-in ! Variable' is replaced by `Variable', for ordinary variables, or ! `Constant' for symbolic constants whose values cannot be changed. diff -cNr octave-2.0.2/doc/interpreter/io.texi octave-2.0.3/doc/interpreter/io.texi *** octave-2.0.2/doc/interpreter/io.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/io.texi Tue Feb 18 01:48:59 1997 *************** *** 1,44 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Input and Output, Special Matrices, Audio Processing, Top @chapter Input and Output There are two distinct classes of input and output functions. The first set are modeled after the functions available in @sc{Matlab}. The second set are modeled after the standard I/O library used by the C ! programming language. The C-style I/O functions offer more flexibility ! and control over the output, but are not quite as easy to use as the ! simpler @sc{Matlab}-style I/O functions. When running interactively, Octave normally sends any output intended for your terminal that is more than one screen long to a paging program, ! such as @code{less} or @code{more}. This avoids the problem of having ! a large volume of output stream by before you can read it. With ! @code{less} (and some versions of @code{more}) it also allows you to ! scan forward and backward, and search for specific items. ! ! No output is displayed by the pager until just before Octave is ready to ! print the top level prompt, or read from the standard input (for ! example, by using the @code{fscanf} or @code{scanf} functions). This ! means that there may be some delay before any output appears on your ! screen if you have asked Octave to perform a significant amount of work ! with a single command statement. The function @code{fflush} may be used ! to force output to be sent to the pager immediately. @xref{C-Style I/O ! Functions}. You can select the program to run as the pager by setting the variable @code{PAGER}, and you can turn paging off by setting the value of the variable @code{page_screen_output} to 0. @deffn {Command} more ! Turn output pagination on or off. @end deffn @defvr {Built-in Variable} PAGER ! The default value is @code{"less"}, or, if @code{less} is not available ! on your system, @code{"more"}. @xref{Installation}. @end defvr @defvr {Built-in Variable} page_screen_output --- 1,51 ---- ! @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 Input and Output, Plotting, Error Handling, Top @chapter Input and Output There are two distinct classes of input and output functions. The first set are modeled after the functions available in @sc{Matlab}. The second set are modeled after the standard I/O library used by the C ! programming language and offer more flexibility and control over the ! output. When running interactively, Octave normally sends any output intended for your terminal that is more than one screen long to a paging program, ! such as @code{less} or @code{more}. This avoids the problem of having a ! large volume of output stream by before you can read it. With ! @code{less} (and some versions of @code{more}) you can also scan forward ! and backward, and search for specific items. ! ! Normally, no output is displayed by the pager until just before Octave ! is ready to print the top level prompt, or read from the standard input ! (for example, by using the @code{fscanf} or @code{scanf} functions). ! This means that there may be some delay before any output appears on ! your screen if you have asked Octave to perform a significant amount of ! work with a single command statement. The function @code{fflush} may be ! used to force output to be sent to the pager (or any other stream) ! immediately. You can select the program to run as the pager by setting the variable @code{PAGER}, and you can turn paging off by setting the value of the variable @code{page_screen_output} to 0. @deffn {Command} more ! @deffnx {Command} more on ! @deffnx {Command} more off ! Turn output pagination on or off. Without an argument, @code{more} ! toggles the current state. @end deffn @defvr {Built-in Variable} PAGER ! The default value is normally @code{"less"}, @code{"more"}, or ! @code{"pg"}, depending on what programs are installed on your system. ! @xref{Installation}. ! ! When running interactively, Octave sends any output intended for your ! terminal that is more than one screen long to the program named by the ! value of the variable @code{PAGER}. @end defvr @defvr {Built-in Variable} page_screen_output *************** *** 54,59 **** --- 61,80 ---- output to the pager as soon as it is available. Otherwise, Octave buffers its output and waits until just before the prompt is printed to flush it to the pager. The default value is 0. + + @deftypefn {Built-in Function} {} fflush (@var{fid}) + Flush output to @var{fid}. This is useful for ensuring that all + pending output makes it to the screen before some other event occurs. + For example, it is always a good idea to flush the standard output + stream before calling @code{input}. + @end deftypefn + + @c XXX FIXME XXX -- maybe this would be a good place to describe the + @c following message: + @c + @c warning: connection to external pager (pid = 9334) lost -- + @c warning: pending computations and output may be lost + @c warning: broken pipe @end defvr @menu *************** *** 79,86 **** value of pi @example ! octave:13> pi ! pi = 3.1416 @end example This works well as long as it is acceptable to have the name of the --- 100,107 ---- value of pi @example ! pi ! @print{} pi = 3.1416 @end example This works well as long as it is acceptable to have the name of the *************** *** 91,109 **** The @code{format} command offers some control over the way Octave prints values with @code{disp} and through the normal echoing mechanism. ! @deftypefn {Built-in Function} {} disp (@var{x}) ! Display the value of @var{x}. For example, the following expression @example ! disp ("The value of pi is:"), disp (pi) @end example @noindent ! will print @example ! The value of pi is: ! 3.1416 @end example @noindent --- 112,137 ---- The @code{format} command offers some control over the way Octave prints values with @code{disp} and through the normal echoing mechanism. ! @defvr {Built-in Variable} ans ! This variable holds the most recently computed result that was not ! explicitly assigned to a variable. For example, after the expression @example ! 3^2 + 4^2 @end example @noindent ! is evaluated, the value of @code{ans} is 25. ! @end defvr ! ! @deftypefn {Built-in Function} {} disp (@var{x}) ! Display the value of @var{x}. For example, @example ! disp ("The value of pi is:"), disp (pi) ! ! @print{} the value of pi is: ! @print{} 3.1416 @end example @noindent *************** *** 137,157 **** @itemx short e The same as @samp{format long} or @samp{format short} but always display output with an @samp{e} format. For example, with the @samp{short e} ! format, pi is displayed as ! ! @example ! 3.14e+00 ! @end example @item long E @itemx short E The same as @samp{format long e} or @samp{format short e} but always display output with an uppercase @samp{E} format. For example, with the @samp{long E} format, pi is displayed as ! ! @example ! 3.14159265358979E+00 ! @end example @item free @itemx none --- 165,178 ---- @itemx short e The same as @samp{format long} or @samp{format short} but always display output with an @samp{e} format. For example, with the @samp{short e} ! format, pi is displayed as @code{3.14e+00}. @item long E @itemx short E The same as @samp{format long e} or @samp{format short e} but always display output with an uppercase @samp{E} format. For example, with the @samp{long E} format, pi is displayed as ! @code{3.14159265358979E+00}. @item free @itemx none *************** *** 194,202 **** --- 215,234 ---- @end table @end deffn + @defvr {Built-in Variable} print_answer_id_name + If the value of @code{print_answer_id_name} is nonzero, variable + names are printed along with the result. Otherwise, only the result + values are printed. The default value is 1. + @end defvr + @node Terminal Input, Simple File I/O, Terminal Output, Basic Input and Output @subsection Terminal Input + Octave has three functions that make it easy to prompt users for + input. The @code{input} and @code{menu} functions are normally + used for managing an interactive dialog with a user, and the + @code{keyboard} function is normally used for doing simple debugging. + @deftypefn {Built-in Function} {} input (@var{prompt}) @deftypefnx {Built-in Function} {} input (@var{prompt}, "s") Print a prompt and wait for user input. For example, *************** *** 228,234 **** Because there may be output waiting to be displayed by the pager, it is a good idea to always call @code{fflush (stdout)} before calling @code{input}. This will ensure that all pending output is written to ! the screen before your prompt. @xref{C-Style I/O Functions}. @end deftypefn @deftypefn {Built-in Function} {} keyboard (@var{prompt}) --- 260,275 ---- Because there may be output waiting to be displayed by the pager, it is a good idea to always call @code{fflush (stdout)} before calling @code{input}. This will ensure that all pending output is written to ! the screen before your prompt. @xref{Input and Output}. ! @end deftypefn ! ! @deftypefn {Function File} {} menu (@var{title}, @var{opt1}, @dots{}) ! Print a title string followed by a series of options. Each option will ! be printed along with a number. The return value is the number of the ! option selected by the user. This function is useful for interactive ! programs. There is no limit to the number of options that may be passed ! in, but it may be confusing to present more than will fit easily on one ! screen. @end deftypefn @deftypefn {Built-in Function} {} keyboard (@var{prompt}) *************** *** 247,284 **** For both @code{input} and @code{keyboard}, the normal command line history and editing functions are available at the prompt. @node Simple File I/O, , Terminal Input, Basic Input and Output @subsection Simple File I/O The @code{save} and @code{load} commands allow data to be written to and ! read from disk files in various formats. @deffn {Command} save options file v1 v2 @dots{} Save the named variables @var{v1}, @var{v2}, @dots{} in the file @var{file}. The special filename @samp{-} can be used to write the output to your terminal. If no variable names are listed, Octave saves all the variables in the current scope. Valid options for the ! @code{save} command are listed in the following table. @table @code @item -ascii ! Save the data in Octave's text data format. Using this flag overrides ! the value of the built-in variable @code{default_save_format}. @item -binary ! Save the data in Octave's binary data format. Using this flag overrides ! the value of the built-in variable @code{default_save_format}. @item -float-binary Save the data in Octave's binary data format but only using single ! precision. Using this flag overrides the value of the built-in variable ! @code{default_save_format}. You should use this format only if you ! know that all the values to be saved can be represented in single ! precision. @item -mat-binary ! Save the data in @sc{Matlab}'s binary data format. Using this flag overrides ! the value of the built-in variable @code{default_save_format}. @item -save-builtins Force Octave to save the values of built-in variables too. By default, --- 288,346 ---- For both @code{input} and @code{keyboard}, the normal command line history and editing functions are available at the prompt. + Octave also has a function that makes it possible to get a single + character from the keyboard without requiring the user to type a + carriage return. + + @c XXX FIXME XXX -- perhaps kbhit should also be able to print a prompt + @c string? + + @deftypefn {Built-in Function} {} kbhit () + Read a single keystroke from the keyboard. For example, + + @example + x = kbhit (); + @end example + + @noindent + will set @var{x} to the next character typed at the keyboard as soon as + it is typed. + @end deftypefn + @node Simple File I/O, , Terminal Input, Basic Input and Output @subsection Simple File I/O The @code{save} and @code{load} commands allow data to be written to and ! read from disk files in various formats. The default format of files ! written by the @code{save} command can be controlled using the built-in ! variables @code{default_save_format} and @code{save_precision}. ! ! Note that Octave can not yet save or load structure variables or any ! user-defined types. @deffn {Command} save options file v1 v2 @dots{} Save the named variables @var{v1}, @var{v2}, @dots{} in the file @var{file}. The special filename @samp{-} can be used to write the output to your terminal. If no variable names are listed, Octave saves all the variables in the current scope. Valid options for the ! @code{save} command are listed in the following table. Options that ! modify the output format override the format specified by the built-in ! variable @code{default_save_format}. @table @code @item -ascii ! Save the data in Octave's text data format. @item -binary ! Save the data in Octave's binary data format. @item -float-binary Save the data in Octave's binary data format but only using single ! precision. You should use this format only if you know that all the ! values to be saved can be represented in single precision. @item -mat-binary ! Save the data in @sc{Matlab}'s binary data format. @item -save-builtins Force Octave to save the values of built-in variables too. By default, *************** *** 301,309 **** match all lower and upper case alphabetic characters. @end table ! Saving global variables also saves the global status of the variable, so ! that if it is restored at a later time using @samp{load}, it will be ! restored as a global variable. The command --- 363,372 ---- match all lower and upper case alphabetic characters. @end table ! Except when using the @sc{Matlab} binary data file format, saving global ! variables also saves the global status of the variable, so that if it is ! restored at a later time using @samp{load}, it will be restored as a ! global variable. The command *************** *** 331,340 **** @end defvr @deffn {Command} load options file v1 v2 @dots{} ! To restore the values from a file, use the @code{load} command. As with ! @code{save}, you may specify a list of variables and @code{load} will ! only extract those variables with names that match. For example, to ! restore the variables saved in the file @file{data}, use the command @example load data --- 394,403 ---- @end defvr @deffn {Command} load options file v1 v2 @dots{} ! Load the named variables from the file @var{file}. As with @code{save}, ! you may specify a list of variables and @code{load} will only extract ! those variables with names that match. For example, to restore the ! variables saved in the file @file{data}, use the command @example load data *************** *** 383,421 **** argument lists for some of the input functions are slightly different, however, because Octave has no way of passing arguments by reference. ! In the following, @var{file} refers either to an integer file number ! (as returned by @file{fopen}) or a file name. ! There are three files that are always available: @defvr {Built-in Variable} stdin ! The standard input stream (file number 0). When Octave is used interactively, this is filtered through the command line editing functions. @end defvr @defvr {Built-in Variable} stdout ! The standard output stream (file number 1). Data written to the standard output is normally filtered through the pager. @end defvr @defvr {Built-in Variable} stderr ! The standard error stream (file number 2). Even if paging is turned on, the standard error is not sent to the pager. It is useful for error messages and prompts. @end defvr - You should always use the symbolic names given in the table above, - rather than referring to these files by number, since it will make - your programs clearer. - @menu * Opening and Closing Files:: * Formatted Output:: * Output Conversion Syntax:: * Table of Output Conversions:: * Integer Conversions:: ! * Floating-Point Conversions:: * Other Output Conversions:: * Formatted Input:: * Input Conversion Syntax:: --- 446,486 ---- argument lists for some of the input functions are slightly different, however, because Octave has no way of passing arguments by reference. ! In the following, @var{file} refers to a file name and @code{fid} refers ! to an integer file number, as returned by @code{fopen}. ! There are three files that are always available. Although these files ! can be accessed using their corresponding numeric file ids, you should ! always use the symbolic names given in the table below, since it will ! make your programs easier to understand. @defvr {Built-in Variable} stdin ! The standard input stream (file id 0). When Octave is used interactively, this is filtered through the command line editing functions. @end defvr @defvr {Built-in Variable} stdout ! The standard output stream (file id 1). Data written to the standard output is normally filtered through the pager. @end defvr @defvr {Built-in Variable} stderr ! The standard error stream (file id 2). Even if paging is turned on, the standard error is not sent to the pager. It is useful for error messages and prompts. @end defvr @menu * Opening and Closing Files:: + * Simple Output:: + * Line-Oriented Input:: * Formatted Output:: + * Output Conversion for Matrices:: * Output Conversion Syntax:: * Table of Output Conversions:: * Integer Conversions:: ! * Floating-Point Conversions:: Other Output Conversions:: * Other Output Conversions:: * Formatted Input:: * Input Conversion Syntax:: *************** *** 423,447 **** * Numeric Input Conversions:: * String Input Conversions:: * Binary I/O:: ! * Other I/O Functions:: @end menu ! @node Opening and Closing Files, Formatted Output, C-Style I/O Functions, C-Style I/O Functions @subsection Opening and Closing Files ! @deftypefn {Built-in Function} {fid =} fopen (@var{name}, @var{mode}) ! Opens the named file with the specified mode. Returns an integer value ! that may be used to refer to the file later. The @var{mode} is a ! one or two character string that specifies whether the file is to be ! opened for reading, writing, or both. For example, @example ! myfile = fopen ("splat.dat", "r"); @end example @noindent ! opens the file @file{splat.dat} for reading. Opening a file that is ! already open has no effect. The possible values @samp{mode} may have are --- 488,536 ---- * Numeric Input Conversions:: * String Input Conversions:: * Binary I/O:: ! * Temporary Files:: ! * EOF and Errors:: ! * File Positioning:: @end menu ! @node Opening and Closing Files, Simple Output, C-Style I/O Functions, C-Style I/O Functions @subsection Opening and Closing Files ! @deftypefn {Built-in Function} {[@var{fid}, @var{msg}] =} fopen (@var{name}, @var{mode}, @var{arch}) ! @deftypefnx {Built-in Function} {@var{fid_list} =} fopen ("all") ! @deftypefnx {Built-in Function} {@var{file} =} fopen (@var{fid}) ! The first form of the @code{fopen} function opens the named file with ! the specified mode (read-write, read-only, etc.) and architecture ! interpretation (IEEE big endian, IEEE little endian, etc.), and returns ! an integer value that may be used to refer to the file later. If an ! error occurs, @var{fid} is set to @minus{}1 and @var{msg} contains the ! corresponding system error message. The @var{mode} is a one or two ! character string that specifies whether the file is to be opened for ! reading, writing, or both. ! ! The second form of the @code{fopen} function returns a vector of file ids ! corresponding to all the currently open files, excluding the ! @code{stdin}, @code{stdout}, and @code{stderr} streams. ! ! The third form of the @code{fopen} function returns the name of a ! currently open file given its file id. ! ! For example, @example ! myfile = fopen ("splat.dat", "r", "ieee-le"); @end example @noindent ! opens the file @file{splat.dat} for reading. If necessary, binary ! numeric values will be read assuming they are stored in IEEE format with ! the least significant bit first, and then converted to the native ! representation. ! ! Opening a file that is already open simply opens it again and returns a ! separate file id. It is not an error to open a file several times, ! though writing to the same file through several different file ids may ! produce unexpected results. The possible values @samp{mode} may have are *************** *** 458,464 **** @item @samp{r+} Open an existing file for reading and writing. ! @item @samp{w+} Open a file for reading or writing. The previous contents are discared. --- 547,553 ---- @item @samp{r+} Open an existing file for reading and writing. ! item @samp{w+} Open a file for reading or writing. The previous contents are discared. *************** *** 466,471 **** --- 555,587 ---- Open or create a file for reading or writing at the end of the file. @end table + + The parameter @var{arch} is a string specifying the default data format + for the file. Valid values for @var{arch} are: + + @table @asis + @samp{native} + The format of the current machine (this is the default). + + @samp{ieee-le} + IEEE big endian format. + + @samp{ieee-be} + IEEE little endian format. + + @samp{vaxd} + VAX D floating format. + + @samp{vaxg} + VAX G floating format. + + @samp{cray} + Cray floating format. + @end table + + @noindent + however, conversions are currently only supported for @samp{native} + @samp{ieee-be}, and @samp{ieee-le} formats. @end deftypefn @deftypefn {Built-in Function} {} fclose (@var{fid}) *************** *** 474,486 **** 0. Otherwise, it returns 1. @end deftypefn ! @node Formatted Output, Output Conversion Syntax, Opening and Closing Files, C-Style I/O Functions @subsection Formatted Output This section describes how to call @code{printf} and related functions. The following functions are available for formatted output. They are ! modelled after the C language functions of the same name. @deftypefn {Function File} {} printf (@var{template}, @dots{}) The @code{printf} function prints the optional arguments under the --- 590,642 ---- 0. Otherwise, it returns 1. @end deftypefn ! @node Simple Output, Line-Oriented Input, Opening and Closing Files, C-Style I/O Functions ! @subsection Simple Output ! ! @deftypefn {Built-in Function} {} fputs (@var{fid}, @var{string}) ! Write a string to a file with no formatting. ! @end deftypefn ! ! @deftypefn {Built-in Function} {} puts (@var{string}) ! Write a string to the standard output with no formatting. ! @end deftypefn ! ! @node Line-Oriented Input, Formatted Output, Simple Output, C-Style I/O Functions ! @subsection Line-Oriented Input ! ! @deftypefn {Built-in Function} {} fgetl (@var{fid}, @var{len}) ! Read characters from a file, stopping at the first newline character ! that is encountered or after @var{len} characters have been read, and ! returning the characters as a string. The newline is not included in ! the returned value. ! ! If @var{len} is omitted, @code{fgetl} reads until the next newline ! character. ! ! If there are no more characters to read, @code{fgetl} returns @minus{}1. ! @end deftypefn ! ! @deftypefn {Built-in Function} {} fgets (@var{fid}, @var{len}) ! Read characters from a file, stopping at the first newline character ! that is encountered or after @var{len} characters have been read, and ! returning the characters as a string. The newline is included in the ! returned value. ! ! If @var{len} is omitted, @code{fgets} reads until the next newline ! character. ! ! If there are no more characters to read, @code{fgets} returns @minus{}1. ! @end deftypefn ! ! @node Formatted Output, Output Conversion for Matrices, Line-Oriented Input, C-Style I/O Functions @subsection Formatted Output This section describes how to call @code{printf} and related functions. The following functions are available for formatted output. They are ! modelled after the C language functions of the same name, but they ! interpret the format template differently in order to improve the ! performance of printing vector and matrix values. @deftypefn {Function File} {} printf (@var{template}, @dots{}) The @code{printf} function prints the optional arguments under the *************** *** 494,500 **** @end deftypefn @deftypefn {Built-in Function} {} sprintf (@var{template}, @dots{}) ! This is like @code{printf}, except that the output is written to a string. Unlike the C library function, which requires you to provide a suitably sized string as an argument, Octave's @code{sprintf} function returns the string, automatically sized to hold all of the items --- 650,656 ---- @end deftypefn @deftypefn {Built-in Function} {} sprintf (@var{template}, @dots{}) ! This is like @code{printf}, except that the output is returned as a string. Unlike the C library function, which requires you to provide a suitably sized string as an argument, Octave's @code{sprintf} function returns the string, automatically sized to hold all of the items *************** *** 554,560 **** interpretation vary depending on the particular conversion. They're all described in more detail in the following sections. ! @node Output Conversion Syntax, Table of Output Conversions, Formatted Output, C-Style I/O Functions @subsection Output Conversion Syntax This section provides details about the precise syntax of conversion --- 710,750 ---- interpretation vary depending on the particular conversion. They're all described in more detail in the following sections. ! @node Output Conversion for Matrices, Output Conversion Syntax, Formatted Output, C-Style I/O Functions ! @subsection Output Conversion for Matrices ! ! When given a matrix value, Octave's formatted output functions cycle ! through the format template until all the values in the matrix have been ! printed. For example, ! ! @example ! @group ! printf ("%4.2f %10.2e %8.4g\n", hilb (3)); ! ! @print{} 1.00 5.00e-01 0.3333 ! @print{} 0.50 3.33e-01 0.25 ! @print{} 0.33 2.50e-01 0.2 ! @end group ! @end example ! ! If more than one value is to be printed in a single call, the output ! functions do not return to the beginning of the format template when ! moving on from one value to the next. This can lead to confusing output ! if the number of elements in the matrices are not exact multiples of the ! number of conversions in the format template. For example, ! ! @example ! @group ! printf ("%4.2f %10.2e %8.4g\n", [1, 2], [3, 4]); ! ! @print{} 1.00 2.00e+00 3 ! @print{} 4.00 ! @end group ! @end example ! ! If this is not what you want, use a series of calls instead of just one. ! ! @node Output Conversion Syntax, Table of Output Conversions, Output Conversion for Matrices, C-Style I/O Functions @subsection Output Conversion Syntax This section provides details about the precise syntax of conversion *************** *** 836,866 **** @end smallexample @noindent ! prints @samp{ nowhere }. @node Formatted Input, Input Conversion Syntax, Other Output Conversions, C-Style I/O Functions @subsection Formatted Input ! Here are the descriptions of the functions for performing formatted ! input. ! @deftypefn {Built-in Function} {} scanf (@var{template}) ! The @code{scanf} function reads formatted input from the stream ! @code{stdin} under the control of the template string @var{template}. ! The resulting values are returned. ! @end deftypefn ! @deftypefn {Built-in Function} {} fscanf (@var{fid}, @var{template}) ! This function is just like @code{scanf}, except that the input is read ! from the stream @var{fid} instead of @code{stdin}. @end deftypefn ! @deftypefn {Built-in Function} {} sscanf (@var{string}, @var{template}) ! This is like @code{scanf}, except that the characters are taken from the string @var{string} instead of from a stream. Reaching the end of the string is treated as an end-of-file condition. @end deftypefn Calls to @code{scanf} are superficially similar to calls to @code{printf} in that arbitrary arguments are read under the control of a template string. While the syntax of the conversion specifications in --- 1026,1094 ---- @end smallexample @noindent ! prints @samp{ nowhere } (note the leading and trailing spaces). @node Formatted Input, Input Conversion Syntax, Other Output Conversions, C-Style I/O Functions @subsection Formatted Input ! Octave provides the @code{scanf}, @code{fscanf}, and @code{sscanf} ! functions to read formatted input. There are two forms of each of these ! functions. One can be used to extract vectors of data from a file, and ! the other is more `C-like'. ! ! @deftypefn {Built-in Function} {[@var{val}, @var{count}] =} fscanf (@var{fid}, @var{template}, @var{size}) ! @deftypefnx {Built-in Function} {[@var{v1}, @var{v2}, @dots{}] = } fscanf (@var{fid}, @var{template}, "C") ! In the first form, read from @var{fid} according to @var{template}, ! returning the result in the matrix @var{val}. ! The optional argument @var{size} specifies the amount of data to read ! and may be one of ! ! @table @code ! @item Inf ! Read as much as possible, returning a column vector. ! @item @var{nr} ! @itemx [@var{nr}, Inf] ! Read as much as possible, returning a matrix with @var{nr} rows. If the ! number of elements read is not an exact multiple of @var{nr}, the last ! column is padded with zeros. ! ! @item [@var{nr}, @var{nc}] ! Read up to @code{@var{nr} * @var{nc}} elements, returning a matrix with ! @var{nr} rows. If the number of elements read is not an exact multiple ! of @var{nr}, the last column is padded with zeros. ! @end table ! ! @noindent ! If @var{size} is omitted, a value of @code{Inf} is assumed. ! ! A string is returned if @var{template} specifies only character ! conversions. ! ! The number of items successfully read is returned in @var{count}. ! ! In the second form, read from @var{fid} according to @var{template}, ! with each conversion specifier in @var{template} corresponding to a ! single scalar return value. This form is more `C-like', and also ! compatible with previous versions of Octave. @end deftypefn ! @deftypefn {Built-in Function} {[@var{val}, @var{count}] =} sscanf (@var{string}, @var{template}, @var{size}) ! @deftypefnx {Built-in Function} {[@var{v1}, @var{v2}, @dots{}] = } sscanf (@var{string}, @var{template}, "C") ! This is like @code{fscanf}, except that the characters are taken from the string @var{string} instead of from a stream. Reaching the end of the string is treated as an end-of-file condition. @end deftypefn + @deftypefn {Built-in Function} {[@var{val}, @var{count}] =} scanf (@var{template}, @var{size}) + @deftypefnx {Built-in Function} {[@var{v1}, @var{v2}, @dots{}] = } scanf (@var{template}, "C") + This is equivalent to calling @code{fscanf} with @var{fid} = @code{stdin}. + + It is currently not useful to call @code{scanf} in interactive + programs. + @end deftypefn + Calls to @code{scanf} are superficially similar to calls to @code{printf} in that arbitrary arguments are read under the control of a template string. While the syntax of the conversion specifications in *************** *** 1054,1127 **** reading the same input with the conversion @samp{%10s} produces @code{"hello,"}. ! @node Binary I/O, Other I/O Functions, String Input Conversions, C-Style I/O Functions @subsection Binary I/O ! Octave has to C-style functions for reading and writing binary data. ! They are @code{fread} and @code{fwrite} and are patterned after the ! standard C functions with the same names. ! ! @deftypefn {Built-in Function} {} fread (@var{fid}, @var{size}, @var{precision}) ! This function reads data in binary form of type @var{precision} from the ! specified @var{fid}, which may be either a file name, or a file number ! as returned from @code{fopen}. ! ! The argument @var{size} specifies the size of the matrix to return. It ! may be a scalar or a two-element vector. If it is a scalar, ! @code{fread} returns a column vector of the specified length. If it is ! a two-element vector, it specifies the number of rows and columns of the ! result matrix, and @code{fread} fills the elements of the matrix in ! column-major order. ! ! The argument @var{precision} is a string specifying the type of data to ! read and may be one of @code{"char"}, @code{"schar"}, @code{"short"}, ! @code{"int"}, @code{"long"}, @code{"float"}, @code{"double"}, ! @code{"uchar"}, @code{"ushort"}, @code{"uint"}, or @code{"ulong"}. The ! default precision is @code{"uchar"}. ! ! The @code{fread} function returns two values, @code{data}, which is the ! data read from the file, and @code{count}, which is the number of ! elements read. ! @end deftypefn ! ! @deftypefn {Built-in Function} {} fwrite (@var{fid}, @var{data}, @var{precision}) ! This function writes data in binary form of type @var{precision} to the ! specified @var{fid}, which may be either a file name, or a file number ! as returned from @code{fopen}. The argument @var{data} is a matrix of values that are to be written to the file. The values are extracted in column-major order. ! The argument @var{precision} is a string specifying the type of data to ! read and may be one of @code{"char"}, @code{"schar"}, @code{"short"}, ! @code{"int"}, @code{"long"}, @code{"float"}, @code{"double"}, ! @code{"uchar"}, @code{"ushort"}, @code{"uint"}, or @code{"ulong"}. The ! default precision is @code{"uchar"}. ! ! The @code{fwrite} function returns the number of elements written. The behavior of @code{fwrite} is undefined if the values in @var{data} are too large to fit in the specified precision. @end deftypefn ! @node Other I/O Functions, , Binary I/O, C-Style I/O Functions ! @subsection Other I/O Functions ! @deftypefn {Built-in Function} {} fgetl (@var{fid}, @var{len}) ! Read @samp{len} characters from a file. @end deftypefn ! @deftypefn {Built-in Function} {} fgets (@var{fid}, @var{len}) ! Read @samp{len} characters from a file. @end deftypefn ! @deftypefn {Built-in Function} {} fflush (@var{fid}) ! Flush output to @var{fid}. This is useful for ensuring that all ! pending output makes it to the screen before some other event occurs. ! For example, it is always a good idea to flush the standard output ! stream before calling @code{input}. @end deftypefn Three functions are available for setting and determining the position of the file pointer for a given file. --- 1282,1482 ---- reading the same input with the conversion @samp{%10s} produces @code{"hello,"}. ! @node Binary I/O, Temporary Files, String Input Conversions, C-Style I/O Functions @subsection Binary I/O ! Octave can read and write binary data using the functions @code{fread} ! and @code{fwrite}, which are patterned after the standard C functions ! with the same names. The are able to automatically swap the byte order ! of integer data and convert among ths supported floating point formats ! as the data are read. ! ! @deftypefn {Built-in Function} {[@var{val}, @var{count}] =} fread (@var{fid}, @var{size}, @var{precision}, @var{skip}, @var{arch}) ! Read binary data of type @var{precision} from the specified file ID ! @var{fid}. ! ! The optional argument @var{size} specifies the amount of data to read ! and may be one of ! ! @table @code ! @item Inf ! Read as much as possible, returning a column vector. ! ! @item @var{nr} ! @itemx [@var{nr}, Inf] ! Read as much as possible, returning a matrix with @var{nr} rows. If the ! number of elements read is not an exact multiple of @var{nr}, the last ! column is padded with zeros. ! ! @item [@var{nr}, @var{nc}] ! Read up to @code{@var{nr} * @var{nc}} elements, returning a matrix with ! @var{nr} rows. If the number of elements read is not an exact multiple ! of @var{nr}, the last column is padded with zeros. ! @end table ! ! @noindent ! If @var{size} is omitted, a value of @code{Inf} is assumed. ! ! The optional argument @var{precision} is a string specifying the type of ! data to read and may be one of ! ! @table @code ! @item "char" ! @itemx "char*1" ! @itemx "integer*1" ! @itemx "int8" ! Single character. ! ! @item "signed char" ! @itemx "schar" ! Signed character. ! ! @item "unsigned char" ! @itemx "uchar" ! Unsigned character. ! ! @item "short" ! Short integer. ! ! @item "unsigned short" ! @itemx "ushort" ! Unsigned short integer. ! ! @item "int" ! Integer. ! ! @item "unsigned int" ! @itemx "uint" ! Unsigned integer. ! ! @item "long" ! Long integer. ! ! @item "unsigned long" ! @itemx "ulong" ! Unsigned long integer. ! ! @item "float" ! @itemx "float32" ! @itemx "real*4" ! Single precision float. ! ! @item "double" ! @itemx "float64" ! @itemx "real*8" ! Double precision float. ! ! @item "integer*2" ! @itemx "int16" ! Two byte integer. ! ! @item "integer*4" ! @itemx "int32" ! Four byte integer. ! @end table ! ! @noindent ! The default precision is @code{"uchar"}. ! ! The optional argument @var{skip} specifies the number of bytes to skip ! before each element is read. If it is not specified, a value of 0 is ! assumed. ! ! The optional argument @var{arch} is a string specifying the data format ! for the file. Valid values are ! ! @table @code ! @item "native" ! The format of the current machine. ! ! @item "ieee-le" ! IEEE big endian. ! ! @item "ieee-be" ! IEEE little endian. ! ! @item "vaxd" ! VAX D floating format. ! ! @item "vaxg" ! VAX G floating format. ! ! @item "cray" ! Cray floating format. ! @end table ! ! @noindent ! Conversions are currently only supported for @code{"ieee-be"} and ! @code{"ieee-le"} formats. ! ! The data read from the file is returned in @var{val}, and the number of ! values read is returned in @code{count} ! @end deftypefn ! ! @deftypefn {Built-in Function} {@var{count} =} fwrite (@var{fid}, @var{data}, @var{precision}, @var{skip}, @var{arch}) ! Write data in binary form of type @var{precision} to the specified file ! ID @var{fid}, returning the number of values successfully written to the ! file. The argument @var{data} is a matrix of values that are to be written to the file. The values are extracted in column-major order. ! The remaining arguments @var{precision}, @var{skip}, and @var{arch} are ! optional, and are interpreted as described for @code{fread}. The behavior of @code{fwrite} is undefined if the values in @var{data} are too large to fit in the specified precision. @end deftypefn ! @node Temporary Files, EOF and Errors, Binary I/O, C-Style I/O Functions ! @subsection Temporary Files ! @deftypefn {Built-in Function} {} tmpnam () ! Return a unique temporary file name as a string. ! ! Since the named file is not opened, by @code{tmpnam}, it ! is possible (though relatively unlikely) that it will not be available ! by the time your program attempts to open it. @end deftypefn ! @node EOF and Errors, File Positioning, Temporary Files, C-Style I/O Functions ! @subsection End of File and Errors ! ! @deftypefn {Built-in Function} {} feof (@var{fid}) ! Returns 1 if an end-of-file condition has been encountered for a given ! file and 0 otherwise. Note that it will only return 1 if the end of the ! file has already been encountered, not if the next read operation will ! result in an end-of-file condition. @end deftypefn ! @deftypefn {Built-in Function} {} ferror (@var{fid}) ! Returns 1 if an error condition has been encountered for a given file ! and 0 otherwise. Note that it will only return 1 if an error has ! already been encountered, not if the next operation will result in an ! error condition. ! @end deftypefn ! ! @deftypefn {Built-in Function} {} freport () ! Print a list of which files have been opened, and whether they are open ! for reading, writing, or both. For example, ! ! @example ! @group ! freport () ! ! @print{} number mode name ! @print{} ! @print{} 0 r stdin ! @print{} 1 w stdout ! @print{} 2 w stderr ! @print{} 3 r myfile ! @end group ! @end example @end deftypefn + @node File Positioning, , EOF and Errors, C-Style I/O Functions + @subsection File Positioning + Three functions are available for setting and determining the position of the file pointer for a given file. *************** *** 1130,1143 **** from the beginning of the file @var{fid}. @end deftypefn ! @deftypefn {Built-in Function} {} fseek (@var{fid}, offset, origin) Set the file pointer to any location within the file @var{fid}. The ! pointer is positioned @code{offset} characters from the @code{origin}, which may be one of the predefined variables @code{SEEK_CUR} (current position), @code{SEEK_SET} (beginning), or @code{SEEK_END} (end of ! file). If @code{origin} is omitted, @code{SEEK_SET} is assumed. The offset must be zero, or a value returned by @code{ftell} (in which case ! @code{origin} must be @code{SEEK_SET}. @end deftypefn @defvr {Built-in Variable} SEEK_SET --- 1485,1498 ---- from the beginning of the file @var{fid}. @end deftypefn ! @deftypefn {Built-in Function} {} fseek (@var{fid}, @var{offset}, @var{origin}) Set the file pointer to any location within the file @var{fid}. The ! pointer is positioned @var{offset} characters from the @var{origin}, which may be one of the predefined variables @code{SEEK_CUR} (current position), @code{SEEK_SET} (beginning), or @code{SEEK_END} (end of ! file). If @var{origin} is omitted, @code{SEEK_SET} is assumed. The offset must be zero, or a value returned by @code{ftell} (in which case ! @var{origin} must be @code{SEEK_SET}. @end deftypefn @defvr {Built-in Variable} SEEK_SET *************** *** 1154,1160 **** @end deftypefn The following example stores the current file position in the variable ! @samp{marker}, moves the pointer to the beginning of the file, reads four characters, and then returns to the original position. @example --- 1509,1515 ---- @end deftypefn The following example stores the current file position in the variable ! @code{marker}, moves the pointer to the beginning of the file, reads four characters, and then returns to the original position. @example *************** *** 1163,1232 **** fourch = fgets (myfile, 4); fseek (myfile, marker, SEEK_SET); @end example - - @deftypefn {Built-in Function} {} feof (@var{fid}) - Returns 1 if an end-of-file condition has been encountered for a given - file and 0 otherwise. Note that it will only return 1 if the end of the - file has already been encountered, not if the next read operation will - result in an end-of-file condition. - @end deftypefn - - @deftypefn {Built-in Function} {} ferror (@var{fid}) - Returns 1 if an error condition has been encountered for a given file - and 0 otherwise. Note that it will only return 1 if an error has - already been encountered, not if the next operation will result in an - error condition. - @end deftypefn - - @deftypefn {Built-in Function} {} kbhit () - Read a single keystroke from the keyboard. For example, - - @example - x = kbhit (); - @end example - - @noindent - will set @var{x} to the next character typed at the keyboard, without - requiring a carriage return to be typed. - @end deftypefn - - @deftypefn {Built-in Function} {} freport () - Finally, it is often useful to know exactly which files have been - opened, and whether they are open for reading, writing, or both. The - command @code{freport} prints this information for all open files. For - example, - - @example - @group - octave:13> freport - - number mode name - - 0 r stdin - 1 w stdout - 2 w stderr - 3 r myfile - @end group - @end example - @end deftypefn - - @deftypefn {Built-in Function} {} fputs (@var{fid}, @var{string}) - Write a string to a file with no formatting. - @end deftypefn - - @deftypefn {Built-in Function} {} puts (@var{string}) - Write a string to the standard output with no formatting. - @end deftypefn - - @deftypefn {Built-in Function} {[@var{in}, @var{out}, @var{pid}] =} popen2 (@var{command}, @var{args}) - Start a subprocess with 2-way communication. - @end deftypefn - - @deftypefn {Built-in Function} {fid =} popen (@var{command}, @var{mode}) - Open a pipe to a subprocess. - @end deftypefn - - @deftypefn {Built-in Function} {} pclose (@var{fid}) - Close a pipe from a subprocess. - @end deftypefn --- 1518,1521 ---- diff -cNr octave-2.0.2/doc/interpreter/linalg.texi octave-2.0.3/doc/interpreter/linalg.texi *** octave-2.0.2/doc/interpreter/linalg.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/linalg.texi Mon Feb 17 15:25:49 1997 *************** *** 1,14 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Linear Algebra, Polynomial Manipulations, Arithmetic, Top @chapter Linear Algebra This chapter documents the linear algebra functions of Octave. ! Reference material for many of these options may be found in Golub and Van Loan, @cite{Matrix Computations, 2nd Ed.}, Johns Hopkins, ! 1989, and in @cite{LAPACK Users' Guide}, SIAM, 1992. @menu * Basic Matrix Functions:: --- 1,14 ---- ! @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 Linear Algebra, Nonlinear Equations, Arithmetic, Top @chapter Linear Algebra This chapter documents the linear algebra functions of Octave. ! Reference material for many of these functions may be found in Golub and Van Loan, @cite{Matrix Computations, 2nd Ed.}, Johns Hopkins, ! 1989, and in @cite{@sc{Lapack} Users' Guide}, SIAM, 1992. @menu * Basic Matrix Functions:: *************** *** 24,40 **** @deftypefnx {Loadable Function} {[@var{cc}, @var{dd}, @var{aa}, @var{bb]} =} balance (@var{a}, @var{b}, @var{opt}) @code{[dd, aa] = balance (a)} returns @code{aa = dd \ a * dd}. ! @code{aa} is a matrix whose row/column norms are roughly equal in magnitude, and @code{dd} = @code{p * d}, where @code{p} is a permutation matrix and @code{d} is a diagonal matrix of powers of two. This allows the equilibration to be computed without roundoff. Results of eigenvalue calculation are typically improved by balancing first. ! @code{[cc, dd, aa, bb] = balance (a, b)} returns @code{aa} (@code{bb}) ! @code{= cc*a*dd (cc*b*dd)}), where @code{aa} and @code{bb} have ! non-zero elements of approximately the same magnitude and @code{cc} ! and @code{dd} are permuted diagonal matrices as in @code{dd} for ! the algebraic eigenvalue problem. The eigenvalue balancing option @code{opt} is selected as follows: --- 24,40 ---- @deftypefnx {Loadable Function} {[@var{cc}, @var{dd}, @var{aa}, @var{bb]} =} balance (@var{a}, @var{b}, @var{opt}) @code{[dd, aa] = balance (a)} returns @code{aa = dd \ a * dd}. ! @code{aa} is a matrix whose row and column norms are roughly equal in magnitude, and @code{dd} = @code{p * d}, where @code{p} is a permutation matrix and @code{d} is a diagonal matrix of powers of two. This allows the equilibration to be computed without roundoff. Results of eigenvalue calculation are typically improved by balancing first. ! @code{[cc, dd, aa, bb] = balance (a, b)} returns @code{aa = cc*a*dd} and ! @code{bb = cc*b*dd)}, where @code{aa} and @code{bb} have non-zero ! elements of approximately the same magnitude and @code{cc} and @code{dd} ! are permuted diagonal matrices as in @code{dd} for the algebraic ! eigenvalue problem. The eigenvalue balancing option @code{opt} is selected as follows: *************** *** 54,60 **** behavior. @end table ! Algebraic eigenvalue balancing uses standard LAPACK routines. Generalized eigenvalue problem balancing uses Ward's algorithm (SIAM Journal on Scientific and Statistical Computing, 1981). --- 54,60 ---- behavior. @end table ! Algebraic eigenvalue balancing uses standard @sc{Lapack} routines. Generalized eigenvalue problem balancing uses Ward's algorithm (SIAM Journal on Scientific and Statistical Computing, 1981). *************** *** 67,99 **** @end deftypefn @deftypefn {Loadable Function} {} det (@var{a}) ! Compute the determinant of @var{a} using LINPACK. @end deftypefn @deftypefn {Loadable Function} {@var{lambda} =} eig (@var{a}) @deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a}) The eigenvalues (and eigenvectors) of a matrix are computed in a several ! step process which begins with a Hessenberg decomposition (see ! @code{hess}), followed by a Schur decomposition (see @code{schur}), from ! which the eigenvalues are apparent. The eigenvectors, when desired, are ! computed by further manipulations of the Schur decomposition. ! ! See also: @code{hess}, @code{schur}. @end deftypefn @deftypefn {Loadable Function} {@var{G} =} givens (@var{x}, @var{y}) @deftypefnx {Loadable Function} {[@var{c}, @var{s}] =} givens (@var{x}, @var{y}) - @code{G = givens(x, y)} returns a @iftex @tex ! $2\times 2$ @end tex @end iftex @ifinfo ! 2 x 2 @end ifinfo ! orthogonal matrix @code{G = [c s; -s' c]} such that ! @code{G [x; y] = [*; 0]} (x, y scalars) @end deftypefn @deftypefn {Loadable Function} {} inv (@var{a}) --- 67,115 ---- @end deftypefn @deftypefn {Loadable Function} {} det (@var{a}) ! Compute the determinant of @var{a} using @sc{Linpack}. @end deftypefn @deftypefn {Loadable Function} {@var{lambda} =} eig (@var{a}) @deftypefnx {Loadable Function} {[@var{v}, @var{lambda}] =} eig (@var{a}) The eigenvalues (and eigenvectors) of a matrix are computed in a several ! step process which begins with a Hessenberg decomposition, followed by a ! Schur decomposition, from which the eigenvalues are apparent. The ! eigenvectors, when desired, are computed by further manipulations of the ! Schur decomposition. @end deftypefn @deftypefn {Loadable Function} {@var{G} =} givens (@var{x}, @var{y}) @deftypefnx {Loadable Function} {[@var{c}, @var{s}] =} givens (@var{x}, @var{y}) @iftex @tex ! Return a $2\times 2$ orthogonal matrix ! $$ ! G = \left[\matrix{c & s\cr -s'& c\cr}\right] ! $$ ! such that ! $$ ! G \left[\matrix{x\cr y}\right] = \left[\matrix{\ast\cr 0}\right] ! $$ ! with $x$ and $y$ scalars. @end tex @end iftex @ifinfo ! Return a 2 by 2 orthogonal matrix ! @code{@var{G} = [@var{c} @var{s}; -@var{s}' @var{c}]} such that ! @code{@var{G} [@var{x}; @var{y}] = [*; 0]} with @var{x} and @var{y} scalars. @end ifinfo ! ! For example, ! ! @example ! @group ! givens (1, 1) ! ! @result{} 0.70711 0.70711 ! -0.70711 0.70711 ! @end group ! @end example @end deftypefn @deftypefn {Loadable Function} {} inv (@var{a}) *************** *** 115,137 **** Largest singular value of @var{a}. @item @var{p} = @code{Inf} Infinity norm, the largest row sum of @var{a}. @item @var{p} = @code{"fro"} ! Frobenius norm of @var{a}, @code{sqrt (sum (diag (a' * a)))}. @end table If @var{a} is a vector or a scalar: @table @asis @item @var{p} = @code{Inf} ! @code{max (abs (a))}. @item @var{p} = @code{-Inf} ! @code{min (abs (a))}. @item other ! p-norm of @var{a}, @code{(sum (abs (a) .^ p)) ^ (1/p)}. @end table @end deftypefn --- 131,155 ---- Largest singular value of @var{a}. @item @var{p} = @code{Inf} + @cindex infinity norm Infinity norm, the largest row sum of @var{a}. @item @var{p} = @code{"fro"} ! @cindex Frobenius norm ! Frobenius norm of @var{a}, @code{sqrt (sum (diag (@var{a}' * @var{a})))}. @end table If @var{a} is a vector or a scalar: @table @asis @item @var{p} = @code{Inf} ! @code{max (abs (@var{a}))}. @item @var{p} = @code{-Inf} ! @code{min (abs (@var{a}))}. @item other ! p-norm of @var{a}, @code{(sum (abs (@var{a}) .^ @var{p})) ^ (1/@var{p})}. @end table @end deftypefn *************** *** 143,176 **** is missing, it is computed as @example ! max (size (a)) * max (svd (a)) * eps @end example @end deftypefn @deftypefn {Function File} {} orth (@var{a}, @var{tol}) ! Returns an orthonormal basis of the range of @var{a}. The dimension of the range space is taken as the number of singular values of @var{a} greater than @var{tol}. If the argument @var{tol} is missing, it is computed as @example ! max (size (a)) * max (svd (a)) * eps @end example @end deftypefn ! @deftypefn {Function File} {} pinv (@var{X}, @var{tol}) ! Returns the pseudoinverse of @var{X}. Singular values less than @var{tol} are ignored. If the second argument is omitted, it is assumed that @example ! tol = max (size (X)) * sigma_max (X) * eps, @end example @noindent ! where @code{sigma_max (@var{X})} is the maximal singular value of @var{X}. @end deftypefn @deftypefn {Function File} {} rank (@var{a}, @var{tol}) --- 161,194 ---- is missing, it is computed as @example ! max (size (@var{a})) * max (svd (@var{a})) * eps @end example @end deftypefn @deftypefn {Function File} {} orth (@var{a}, @var{tol}) ! Returns an orthonormal basis of the range space of @var{a}. The dimension of the range space is taken as the number of singular values of @var{a} greater than @var{tol}. If the argument @var{tol} is missing, it is computed as @example ! max (size (@var{a})) * max (svd (@var{a})) * eps @end example @end deftypefn ! @deftypefn {Function File} {} pinv (@var{x}, @var{tol}) ! Returns the pseudoinverse of @var{x}. Singular values less than @var{tol} are ignored. If the second argument is omitted, it is assumed that @example ! tol = max (size (@var{x})) * sigma_max (@var{x}) * eps, @end example @noindent ! where @code{sigma_max (@var{x})} is the maximal singular value of @var{x}. @end deftypefn @deftypefn {Function File} {} rank (@var{a}, @var{tol}) *************** *** 180,201 **** argument is omitted, it is taken to be @example ! tol = max (size (a)) * sigma (1) * eps; @end example @noindent where @code{eps} is machine precision and @code{sigma} is the largest ! singular value of @code{a}. @end deftypefn @deftypefn {Function File} {} trace (@var{a}) ! Compute the trace of @var{a}, @code{sum (diag (a))}. @end deftypefn @node Matrix Factorizations, Functions of a Matrix, Basic Matrix Functions, Linear Algebra @section Matrix Factorizations @deftypefn {Loadable Function} {} chol (@var{a}) Compute the Cholesky factor, @var{r}, of the symmetric positive definite matrix @var{a}, where @iftex --- 198,220 ---- argument is omitted, it is taken to be @example ! tol = max (size (@var{a})) * sigma (1) * eps; @end example @noindent where @code{eps} is machine precision and @code{sigma} is the largest ! singular value of @var{a}. @end deftypefn @deftypefn {Function File} {} trace (@var{a}) ! Compute the trace of @var{a}, @code{sum (diag (@var{a}))}. @end deftypefn @node Matrix Factorizations, Functions of a Matrix, Basic Matrix Functions, Linear Algebra @section Matrix Factorizations @deftypefn {Loadable Function} {} chol (@var{a}) + @cindex Cholesky factorization Compute the Cholesky factor, @var{r}, of the symmetric positive definite matrix @var{a}, where @iftex *************** *** 213,232 **** @deftypefn {Loadable Function} {@var{h} =} hess (@var{a}) @deftypefnx {Loadable Function} {[@var{p}, @var{h}] =} hess (@var{a}) Compute the Hessenberg decomposition of the matrix @var{a}. The Hessenberg decomposition is usually used as the first step in an eigenvalue computation, but has other applications as well (see Golub, Nash, and Van Loan, IEEE Transactions on Automatic Control, 1979. The ! Hessenberg decomposition is @code{p * h * p' = a} where @code{p} is a ! square unitary matrix (@code{p' * p = I}, using complex-conjugate ! transposition) and @code{h} is upper Hessenberg ! (@code{i >= j+1 => h (i, j) = 0}). @end deftypefn @deftypefn {Loadable Function} {[@var{l}, @var{u}, @var{p}] =} lu (@var{a}) Compute the LU decomposition of @var{a}, using subroutines from ! LAPACK. The result is returned in a permuted form, according to the optional return value @var{p}. For example, given the matrix @code{a = [1, 2; 3, 4]}, --- 232,264 ---- @deftypefn {Loadable Function} {@var{h} =} hess (@var{a}) @deftypefnx {Loadable Function} {[@var{p}, @var{h}] =} hess (@var{a}) + @cindex Hessenberg decomposition Compute the Hessenberg decomposition of the matrix @var{a}. The Hessenberg decomposition is usually used as the first step in an eigenvalue computation, but has other applications as well (see Golub, Nash, and Van Loan, IEEE Transactions on Automatic Control, 1979. The ! Hessenberg decomposition is ! @iftex ! @tex ! $$ ! A = PHP^T ! $$ ! where $P$ is a square unitary matrix ($P^HP = I$), and $H$ ! is upper Hessenberg ($H_{i,j} = 0, \forall i \ge j+1$). ! @end tex ! @end iftex ! @ifinfo ! @code{p * h * p' = a} where @code{p} is a square unitary matrix ! (@code{p' * p = I}, using complex-conjugate transposition) and @code{h} ! is upper Hessenberg (@code{i >= j+1 => h (i, j) = 0}). ! @end ifinfo @end deftypefn @deftypefn {Loadable Function} {[@var{l}, @var{u}, @var{p}] =} lu (@var{a}) + @cindex LU decomposition Compute the LU decomposition of @var{a}, using subroutines from ! @sc{Lapack}. The result is returned in a permuted form, according to the optional return value @var{p}. For example, given the matrix @code{a = [1, 2; 3, 4]}, *************** *** 256,262 **** @end deftypefn @deftypefn {Loadable Function} {[@var{q}, @var{r}] =} qr (@var{a}) ! Compute the QR factorization of @var{a}, using standard LAPACK subroutines. For example, given the matrix @code{a = [1, 2; 3, 4]}, @example --- 288,295 ---- @end deftypefn @deftypefn {Loadable Function} {[@var{q}, @var{r}] =} qr (@var{a}) ! @cindex QR factorization ! Compute the QR factorization of @var{a}, using standard @sc{Lapack} subroutines. For example, given the matrix @code{a = [1, 2; 3, 4]}, @example *************** *** 342,347 **** --- 375,381 ---- @deftypefn {Loadable Function} {@var{s}} schur (@var{a}) @deftypefnx {Loadable Function} {[@var{u}, @var{s}] =} schur (@var{a}, @var{opt}) + @cindex Schur decomposition The Schur decomposition is used to compute eigenvalues of a square matrix, and has applications in the solution of algebraic Riccati equations in control (see @code{are} and @code{dare}). *************** *** 547,552 **** --- 581,587 ---- @deftypefn {Loadable Function} {@var{s} =} svd (@var{a}) @deftypefnx {Loadable Function} {[@var{u}, @var{s}, @var{v}] =} svd (@var{a}) + @cindex singular value decomposition Compute the singular value decomposition of @var{a} @iftex @tex *************** *** 729,758 **** @example x = [a(i, j) b] @end example @end deftypefn ! @deftypefn {Function File} {} qzhess (@var{a}, @var{b}) Compute the Hessenberg-triangular decomposition of the matrix pencil ! @code{(a, b)}. This function returns @code{aa = q * a * z}, ! @code{bb = q * b * z}, @code{q}, @code{z} orthogonal. For example, @example ! [aa, bb, q, z] = qzhess (a, b) @end example The Hessenberg-triangular decomposition is the first step in ! Moler and Stewart's QZ decomposition algorithm. (The QZ decomposition ! will be included in a later release of Octave.) Algorithm taken from Golub and Van Loan, @cite{Matrix Computations, 2nd edition}. @end deftypefn @deftypefn {Loadable Function} {} qzval (@var{a}, @var{b}) ! Compute generalized eigenvalues. @end deftypefn ! @deftypefn {Loadable Function} {} syl (@var{a}, @var{b}, @var{c}) Solve the Sylvester equation @iftex @tex --- 764,826 ---- @example x = [a(i, j) b] @end example + + For example, + + @example + @group + kron (1:4, ones (3, 1)) + + @result{} 1 2 3 4 + 1 2 3 4 + 1 2 3 4 + @end group + @end example @end deftypefn ! @deftypefn {Function File} {[@var{aa}, @var{bb}, @var{q}, @var{z}] =} qzhess (@var{a}, @var{b}) Compute the Hessenberg-triangular decomposition of the matrix pencil ! @code{(@var{a}, @var{b})}, returning ! @code{@var{aa} = @var{q} * @var{a} * @var{z}}, ! @code{@var{bb} = @var{q} * @var{b} * @var{z}}, with @var{q} and @var{z} ! orthogonal. For example, @example ! @group ! [aa, bb, q, z] = qzhess ([1, 2; 3, 4], [5, 6; 7, 8]) ! ! @result{} aa = [ -3.02244, -4.41741; 0.92998, 0.69749 ] ! ! @result{} bb = [ -8.60233, -9.99730; 0.00000, -0.23250 ] ! ! @result{} q = [ -0.58124, -0.81373; -0.81373, 0.58124 ] ! ! @result{} z = [ 1, 0; 0, 1 ] ! @end group @end example The Hessenberg-triangular decomposition is the first step in ! Moler and Stewart's QZ decomposition algorithm. Algorithm taken from Golub and Van Loan, @cite{Matrix Computations, 2nd edition}. @end deftypefn @deftypefn {Loadable Function} {} qzval (@var{a}, @var{b}) ! Compute generalized eigenvalues of the matrix pencil ! @iftex ! @tex ! $a - \lambda b$. ! @end tex ! @end iftex ! @ifinfo ! @code{@var{a} - lambda @var{b}}. ! @end ifinfo ! ! The arguments @var{a} and @var{b} must be real matrices. @end deftypefn ! @deftypefn {Loadable Function} {@var{x} =} syl (@var{a}, @var{b}, @var{c}) Solve the Sylvester equation @iftex @tex *************** *** 766,772 **** @example A X + X B + C = 0 @end example - @end ifinfo ! using standard LAPACK subroutines. @end deftypefn --- 834,846 ---- @example A X + X B + C = 0 @end example @end ifinfo ! using standard @sc{Lapack} subroutines. For example, ! ! @example ! @group ! syl ([1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12]) ! @result{} [ -0.50000, -0.66667; -0.66667, -0.50000 ] ! @end group ! @end example @end deftypefn diff -cNr octave-2.0.2/doc/interpreter/matrix.texi octave-2.0.3/doc/interpreter/matrix.texi *** octave-2.0.2/doc/interpreter/matrix.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/matrix.texi Tue Feb 18 01:48:28 1997 *************** *** 1,8 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Matrix Manipulation, String Functions, Special Matrices, Top @chapter Matrix Manipulation There are a number of functions available for checking to see if the --- 1,8 ---- ! @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 Matrix Manipulation, Arithmetic, Plotting, Top @chapter Matrix Manipulation There are a number of functions available for checking to see if the *************** *** 15,20 **** --- 15,22 ---- @menu * Finding Elements and Checking Conditions:: * Rearranging Matrices:: + * Special Utility Matrices:: + * Famous Matrices:: @end menu @node Finding Elements and Checking Conditions, Rearranging Matrices, Matrix Manipulation, Matrix Manipulation *************** *** 75,93 **** @code{while} statements) Octave treats the test as if you had typed @code{all (all (condition))}. ! @deftypefn {Function File} {[@var{errorcode}, @var{y_1}, ...] =} common_size (@var{x_1}, ...) Determine if all input arguments are either scalar or of common ! size. If so, errorcode is zero, and @var{y_i} is a matrix of the ! common size with all entries equal to @var{x_i} if this is a scalar or ! @var{x_i} otherwise. If the inputs cannot be brought to a common size, ! errorcode is 1, and @var{y_i} is @var{x_i}. For example, @example @group [errorcode, a, b] = common_size ([1 2; 3 4], 5) @result{} errorcode = 0 ! @result{} a = [1 2, 3 4] ! @result{} b = [5 5; 5 5] @end group @end example --- 77,98 ---- @code{while} statements) Octave treats the test as if you had typed @code{all (all (condition))}. ! @deftypefn {Function File} {[@var{err}, @var{y1}, ...] =} common_size (@var{x1}, ...) Determine if all input arguments are either scalar or of common ! size. If so, @var{err} is zero, and @var{yi} is a matrix of the ! common size with all entries equal to @var{xi} if this is a scalar or ! @var{xi} otherwise. If the inputs cannot be brought to a common size, ! errorcode is 1, and @var{yi} is @var{xi}. For example, @example @group [errorcode, a, b] = common_size ([1 2; 3 4], 5) + @result{} errorcode = 0 ! ! @result{} a = [ 1, 2; 3, 4 ] ! ! @result{} b = [ 5, 5; 5, 5 ] @end group @end example *************** *** 198,204 **** @end example @end deftypefn ! @node Rearranging Matrices, , Finding Elements and Checking Conditions, Matrix Manipulation @section Rearranging Matrices @deftypefn {Function File} {} fliplr (@var{x}) --- 203,209 ---- @end example @end deftypefn ! @node Rearranging Matrices, Special Utility Matrices, Finding Elements and Checking Conditions, Matrix Manipulation @section Rearranging Matrices @deftypefn {Function File} {} fliplr (@var{x}) *************** *** 252,258 **** --- 257,265 ---- @example @group rot90 ([1, 2; 3, 4], -1) + @equiv{} rot90 ([1, 2; 3, 4], 3) + @equiv{} rot90 ([1, 2; 3, 4], 7) @end group @end example *************** *** 404,419 **** @deftypefn {Function File} {} vec (@var{x}) For a matrix @var{x}, returns the vector obtained by stacking the columns of @var{x} one above the other. - - See Magnus and Neudecker (1988), Matrix differential calculus with - applications in statistics and econometrics. @end deftypefn @deftypefn {Function File} {} vech (@var{x}) For a square matrix @var{x}, returns the vector obtained from @var{x} by eliminating all supradiagonal elements and stacking the result one column above the other. ! See Magnus and Neudecker (1988), Matrix differential calculus with ! applications in statistics and econometrics. @end deftypefn --- 411,818 ---- @deftypefn {Function File} {} vec (@var{x}) For a matrix @var{x}, returns the vector obtained by stacking the columns of @var{x} one above the other. @end deftypefn @deftypefn {Function File} {} vech (@var{x}) For a square matrix @var{x}, returns the vector obtained from @var{x} by eliminating all supradiagonal elements and stacking the result one column above the other. + @end deftypefn + + @node Special Utility Matrices, Famous Matrices, Rearranging Matrices, Matrix Manipulation + @section Special Utility Matrices + + @deftypefn {Built-in Function} {} eye (@var{x}) + @deftypefnx {Built-in Function} {} eye (@var{n}, @var{m}) + Returns 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}) + Returns 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}) + Returns 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}) + Returns 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 + rand ("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}) + Returns 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 + @sc{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}) + Returns 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 + + @c XXX FIXME XXX -- is this really worth documenting? + @c + @c @defvr {Built-in Variable} ok_to_lose_imaginary_part + @c If the value of @code{ok_to_lose_imaginary_part} is nonzero, implicit + @c conversions of complex numbers to real numbers are allowed (for example, + @c by fsolve). If the value is @code{"warn"}, the conversion is allowed, + @c but a warning is printed. Otherwise, an error message is printed and + @c control is returned to the top level. The default value is + @c @code{"warn"}. + @c + @c XXX FIXME XXX -- this is here because it is used by @code{ones}, + @c @code{zeros}, @code{rand}, etc. + @c @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}) + Return a row vector with @var{n} linearly spaced elements between + @var{base} and @var{limit}. The number of elements, @var{n}, must be + greater than 1. 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, Matrix Manipulation + @section Famous Matrices + + The following functions return famous matrix forms. + + @deftypefn {Function File} {} hadamard (@var{k}) + Return the Hadamard matrix of order + @iftex + @tex + $n = 2^k$. + @end tex + @end iftex + @ifinfo + n = 2^k. + @end ifinfo + @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 -cNr octave-2.0.2/doc/interpreter/nonlin.texi octave-2.0.3/doc/interpreter/nonlin.texi *** octave-2.0.2/doc/interpreter/nonlin.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/nonlin.texi Mon Feb 17 00:14:41 1997 *************** *** 1,8 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Nonlinear Equations, Differential Equations, Polynomial Manipulations, Top @chapter Nonlinear Equations @cindex nonlinear equations @cindex equations, nonlinear --- 1,8 ---- ! @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 Nonlinear Equations, Quadrature, Linear Algebra, Top @chapter Nonlinear Equations @cindex nonlinear equations @cindex equations, nonlinear *************** *** 23,29 **** @end ifinfo @noindent ! using the function @code{fsolve}, which is based on the MINPACK subroutine @code{hybrd}. @deftypefn {Loadable Function} {[@var{x}, @var{info}] =} fsolve (@var{fcn}, @var{x0}) --- 23,29 ---- @end ifinfo @noindent ! using the function @code{fsolve}, which is based on the @sc{Minpack} subroutine @code{hybrd}. @deftypefn {Loadable Function} {[@var{x}, @var{info}] =} fsolve (@var{fcn}, @var{x0}) *************** *** 63,72 **** @example function y = f (x) - y(1) = -2*x(1)^2 + 3*x(1)*x(2) + 4*sin(x(2)) - 6; y(2) = 3*x(1)^2 - 2*x(1)*x(2)^2 + 3*cos(x(1)) + 4; - endfunction @end example --- 63,70 ---- *************** *** 96,107 **** corresponding to the numeric error codes. For example, @example perror ("fsolve", 1) @end example - @noindent - prints - @example - solution converged to requested tolerance - @end example --- 94,103 ---- corresponding to the numeric error codes. For example, @example + @group perror ("fsolve", 1) + @print{} solution converged to requested tolerance + @end group @end example diff -cNr octave-2.0.2/doc/interpreter/numbers.texi octave-2.0.3/doc/interpreter/numbers.texi *** octave-2.0.2/doc/interpreter/numbers.texi Wed Dec 31 18:00:00 1969 --- octave-2.0.3/doc/interpreter/numbers.texi Mon Feb 17 15:29:02 1997 *************** *** 0 **** --- 1,537 ---- + @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 Numeric Data Types, Strings, Data Types, Top + @chapter Numeric Data Types + @cindex numeric constant + @cindex numeric value + + A @dfn{numeric constant} may be a scalar, a vector, or a matrix, and it + may contain complex values. + + The simplest form of a numeric constant, a scalar, is a single number + that can be an integer, a decimal fraction, a number in scientific + (exponential) notation, or a complex number. Note that all numeric + constants are represented within Octave in double-precision floating + point format (complex constants are stored as pairs of double-precision + floating point values). Here are some examples of real-valued numeric + constants, which all have the same value: + + @example + @group + 105 + 1.05e+2 + 1050e-1 + @end group + @end example + + To specify complex constants, you can write an expression of the form + + @example + @group + 3 + 4i + 3.0 + 4.0i + 0.3e1 + 40e-1i + @end group + @end example + + all of which are equivalent. The letter @samp{i} in the previous example + stands for the pure imaginary constant, defined as + @iftex + @tex + $\sqrt{-1}$. + @end tex + @end iftex + @ifinfo + @code{sqrt (-1)}. + @end ifinfo + + For Octave to recognize a value as the imaginary part of a complex + constant, a space must not appear between the number and the @samp{i}. + If it does, Octave will print an error message, like this: + + @example + @group + octave:13> 3 + 4 i + + parse error: + + 3 + 4 i + ^ + @end group + @end example + + You may also use @samp{j}, @samp{I}, or @samp{J} in place of the + @samp{i} above. All four forms are equivalent. + + @menu + * Matrices:: + * Ranges:: + * Predicates for Numeric Objects:: + @end menu + + @node Matrices, Ranges, Numeric Data Types, Numeric Data Types + @section Matrices + @cindex matrices + + @opindex [ + @opindex ] + @opindex ; + @opindex , + + It is easy to define a matrix of values in Octave. The size of the + matrix is determined automatically, so it is not necessary to explicitly + state the dimensions. The expression + + @example + a = [1, 2; 3, 4] + @end example + + @noindent + results in the matrix + @iftex + @tex + $$ a = \left[ \matrix{ 1 & 2 \cr 3 & 4 } \right] $$ + @end tex + @end iftex + @ifinfo + + @example + @group + + / \ + | 1 2 | + a = | | + | 3 4 | + \ / + + @end group + @end example + @end ifinfo + + Elements of a matrix may be arbitrary expressions, provided that the + dimensions all make sense when combining the various pieces. For + example, given the above matrix, the expression + + @example + [ a, a ] + @end example + + @noindent + produces the matrix + + @example + @group + ans = + + 1 2 1 2 + 3 4 3 4 + @end group + @end example + + @noindent + but the expression + + @example + [ a, 1 ] + @end example + + @noindent + produces the error + + @example + error: number of rows must match near line 13, column 6 + @end example + + @noindent + (assuming that this expression was entered as the first thing on line + 13, of course). + + Inside the square brackets that delimit a matrix expression, Octave + looks at the surrounding context to determine whether spaces and newline + characters should be converted into element and row separators, or + simply ignored, so commands like + + @example + [ linspace (1, 2) ] + @end example + + @noindent + and + + @example + @group + a = [ 1 2 + 3 4 ] + @end group + @end example + + @noindent + will work. However, some possible sources of confusion remain. For + example, in the expression + + @example + [ 1 - 1 ] + @end example + + @noindent + the @samp{-} is treated as a binary operator and the result is the + scalar 0, but in the expression + + @example + [ 1 -1 ] + @end example + + @noindent + the @samp{-} is treated as a unary operator and the result is the + vector @code{[ 1, -1 ]}. + + Given @code{a = 1}, the expression + + @example + [ 1 a' ] + @end example + + @noindent + results in the single quote character @samp{'} being treated as a + transpose operator and the result is the vector @code{[ 1, 1 ]}, but the + expression + + @example + [ 1 a ' ] + @end example + + @noindent + produces the error message + + @example + error: unterminated string constant + @end example + + @noindent + because to not do so would make it impossible to correctly parse the + valid expression + + @example + [ a 'foo' ] + @end example + + For clarity, it is probably best to always use commas and semicolons to + separate matrix elements and rows. It is possible to enforce this style + by setting the built-in variable @code{whitespace_in_literal_matrix} to + @code{"ignore"}. + + @defvr {Built-in Variable} whitespace_in_literal_matrix + This variable allows some control over how Octave decides to convert + spaces to commas and semicolons in matrix expressions like + @code{[m (1)]} or + + @example + [ 1, 2, + 3, 4 ] + @end example + + If the value of @code{whitespace_in_literal_matrix} is @code{"ignore"}, + Octave will never insert a comma or a semicolon in a literal matrix + list. For example, the expression @code{[1 2]} will result in an error + instead of being treated the same as @code{[1, 2]}, and the expression + + @example + [ 1, 2, + 3, 4 ] + @end example + + @noindent + will result in the vector @code{[ 1, 2, 3, 4 ]} instead of a matrix. + + If the value of @code{whitespace_in_literal_matrix} is @code{"traditional"}, + Octave will convert spaces to a comma between identifiers and @samp{(}. For + example, given the matrix + + @example + m = [3 2] + @end example + + @noindent + the expression + + @example + [m (1)] + @end example + + @noindent + will be parsed as + + @example + [m, (1)] + @end example + + @noindent + and will result in + + @example + [3 2 1] + @end example + + @noindent + and the expression + + @example + [ 1, 2, + 3, 4 ] + @end example + + @noindent + will result in a matrix because the newline character is converted to a + semicolon (row separator) even though there is a comma at the end of the + first line (trailing commas or semicolons are ignored). This is + apparently how @sc{Matlab} behaves. + + Any other value for @code{whitespace_in_literal_matrix} results in behavior + that is the same as traditional, except that Octave does not + convert spaces to a comma between identifiers and @samp{(}. For + example, the expression + + @example + [m (1)] + @end example + + will produce @samp{3}. This is the way Octave has always behaved. + @end defvr + + When you type a matrix or the name of a variable whose value is a + matrix, Octave responds by printing the matrix in with neatly aligned + rows and columns. If the rows of the matrix are too large to fit on the + screen, Octave splits the matrix and displays a header before each + section to indicate which columns are being displayed. + + @noindent + You can use the following variables to control the format of the output. + + @defvr {Built-in Variable} output_max_field_width + This variable specifies the maximum width of a numeric output field. + The default value is 10. + @end defvr + + @defvr {Built-in Variable} output_precision + This variable specifies the minimum number of significant figures to + display for numeric output. The default value is 5. + @end defvr + + It is possible to achieve a wide range of output styles by using + different values of @code{output_precision} and + @code{output_max_field_width}. Reasonable combinations can be set using + the @code{format} function. @xref{Basic Input and Output}. + + @defvr {Built-in Variable} split_long_rows + For large matrices, Octave may not be able to display all the columns of + a given row on one line of your screen. This can result in missing + information or output that is nearly impossible to decipher, depending + on whether your terminal truncates or wraps long lines. + + If the value of @code{split_long_rows} is nonzero, Octave will display + the matrix in a series of smaller pieces, each of which can fit within + the limits of your terminal width. Each set of rows is labeled so that + you can easily see which columns are currently being displayed. + For example: + + @smallexample + @group + octave:13> rand (2,10) + ans = + + Columns 1 through 6: + + 0.75883 0.93290 0.40064 0.43818 0.94958 0.16467 + 0.75697 0.51942 0.40031 0.61784 0.92309 0.40201 + + Columns 7 through 10: + + 0.90174 0.11854 0.72313 0.73326 + 0.44672 0.94303 0.56564 0.82150 + @end group + @end smallexample + + @noindent + The default value of @code{split_long_rows} is nonzero. + @end defvr + + @menu + * Empty Matrices:: + @end menu + + @node Empty Matrices, , Matrices, Matrices + @subsection Empty Matrices + + A matrix may have one or both dimensions zero, and operations on empty + matrices are handled as described by Carl de Boor in @cite{An Empty + Exercise}, SIGNUM, Volume 25, pages 2--6, 1990 and C. N. Nett and W. M. + Haddad, in @cite{A System-Theoretic Appropriate Realization of the Empty + Matrix Concept}, IEEE Transactions on Automatic Control, Volume 38, + Number 5, May 1993. + @iftex + @tex + Briefly, given a scalar $s$, an $m\times n$ matrix $M_{m\times n}$, + and an $m\times n$ empty matrix $[\,]_{m\times n}$ (with either one or + both dimensions equal to zero), the following are true: + $$ + \eqalign{% + s \cdot [\,]_{m\times n} = [\,]_{m\times n} \cdot s &= [\,]_{m\times n}\cr + [\,]_{m\times n} + [\,]_{m\times n} &= [\,]_{m\times n}\cr + [\,]_{0\times m} \cdot M_{m\times n} &= [\,]_{0\times n}\cr + M_{m\times n} \cdot [\,]_{n\times 0} &= [\,]_{m\times 0}\cr + [\,]_{m\times 0} \cdot [\,]_{0\times n} &= 0_{m\times n}} + $$ + @end tex + @end iftex + @ifinfo + Briefly, given a scalar @var{s}, an @var{m} by + @var{n} matrix @code{M(mxn)}, and an @var{m} by @var{n} empty matrix + @code{[](mxn)} (with either one or both dimensions equal to zero), the + following are true: + + @example + @group + s * [](mxn) = [](mxn) * s = [](mxn) + + [](mxn) + [](mxn) = [](mxn) + + [](0xm) * M(mxn) = [](0xn) + + M(mxn) * [](nx0) = [](mx0) + + [](mx0) * [](0xn) = 0(mxn) + @end group + @end example + @end ifinfo + + By default, dimensions of the empty matrix are printed along with the + empty matrix symbol, @samp{[]}. The built-in variable + @code{print_empty_dimensions} controls this behavior. + + @defvr {Built-in Variable} print_empty_dimensions + If the value of @code{print_empty_dimensions} is nonzero, the + dimensions of empty matrices are printed along with the empty matrix + symbol, @samp{[]}. For example, the expression + + @example + zeros (3, 0) + @end example + + @noindent + will print + + @example + ans = [](3x0) + @end example + @end defvr + + Empty matrices may also be used in assignment statements as a convenient + way to delete rows or columns of matrices. + @xref{Assignment Ops, ,Assignment Expressions}. + + Octave will normally issue a warning if it finds an empty matrix in the + list of elements that make up another matrix. You can use the variable + @code{empty_list_elements_ok} to suppress the warning or to treat it as + an error. + + @defvr {Built-in Variable} empty_list_elements_ok + This variable controls whether Octave ignores empty matrices in a matrix + list. + + For example, if the value of @code{empty_list_elements_ok} is + nonzero, Octave will ignore the empty matrices in the expression + + @example + a = [1, [], 3, [], 5] + @end example + + @noindent + and the variable @code{a} will be assigned the value @code{[ 1, 3, 5 ]}. + + The default value is @code{"warn"}. + @end defvr + + When Octave parses a matrix expression, it examines the elements of the + list to determine whether they are all constants. If they are, it + replaces the list with a single matrix constant. + + @defvr {Built-in Variable} propagate_empty_matrices + If the value of @code{propagate_empty_matrices} is nonzero, + functions like @code{inverse} and @code{svd} will return an empty matrix + if they are given one as an argument. The default value is 1. + @end defvr + + @node Ranges, Predicates for Numeric Objects, Matrices, Numeric Data Types + @section Ranges + @cindex range expressions + @cindex expression, range + + @opindex : + + A @dfn{range} is a convenient way to write a row vector with evenly + spaced elements. A range expression is defined by the value of the first + element in the range, an optional value for the increment between + elements, and a maximum value which the elements of the range will not + exceed. The base, increment, and limit are separated by colons (the + @samp{:} character) and may contain any arithmetic expressions and + function calls. If the increment is omitted, it is assumed to be 1. + For example, the range + + @example + 1 : 5 + @end example + + @noindent + defines the set of values @samp{[ 1, 2, 3, 4, 5 ]}, and the range + + @example + 1 : 3 : 5 + @end example + + @noindent + defines the set of values @samp{[ 1, 4 ]}. + + Although a range constant specifies a row vector, Octave does @emph{not} + convert range constants to vectors unless it is necessary to do so. + This allows you to write a constant like @samp{1 : 10000} without using + 80,000 bytes of storage on a typical 32-bit workstation. + + Note that the upper (or lower, if the increment is negative) bound on + the range is not always included in the set of values, and that ranges + defined by floating point values can produce surprising results because + Octave uses floating point arithmetic to compute the values in the + range. If it is important to include the endpoints of a range and the + number of elements is known, you should use the @code{linspace} function + instead (@pxref{Special Utility Matrices}). + + When Octave parses a range expression, it examines the elements of the + expression to determine whether they are all constants. If they are, it + replaces the range expression with a single range constant. + + @node Predicates for Numeric Objects, , Ranges, Numeric Data Types + @section Predicates for Numeric Objects + + @deftypefn {Function File} {} is_matrix (@var{a}) + Return 1 if @var{a} is a matrix. Otherwise, return 0. + @end deftypefn + + @deftypefn {Function File} {} is_vector (@var{a}) + Return 1 if @var{a} is a vector. Otherwise, return 0. + @end deftypefn + + @deftypefn {Function File} {} is_scalar (@var{a}) + Return 1 if @var{a} is a scalar. Otherwise, return 0. + @end deftypefn + + @deftypefn {Function File} {} is_square (@var{x}) + If @var{x} is a square matrix, then return the dimension of @var{x}. + Otherwise, return 0. + @end deftypefn + + @deftypefn {Function File} {} is_symmetric (@var{x}, @var{tol}) + If @var{x} is symmetric within the tolerance specified by @var{tol}, + then return the dimension of @var{x}. Otherwise, return 0. If + @var{tol} is omitted, use a tolerance equal to the machine precision. + @end deftypefn diff -cNr octave-2.0.2/doc/interpreter/octave.texi octave-2.0.3/doc/interpreter/octave.texi *** octave-2.0.2/doc/interpreter/octave.texi Wed Jan 22 11:13:20 1997 --- octave-2.0.3/doc/interpreter/octave.texi Tue Feb 18 02:09:34 1997 *************** *** 1,4 **** ! % Copyright (C) 1996 John W. Eaton % This is part of the Octave manual. % For copying conditions, see the file gpl.texi. --- 1,4 ---- ! % Copyright (C) 1996, 1997 John W. Eaton % This is part of the Octave manual. % For copying conditions, see the file gpl.texi. *************** *** 16,24 **** @c Settings for printing on 8-1/2 by 11 inch paper: @c ----------------------------------------------- - @c @ignore @setchapternewpage odd - @c @end ignore @c Settings for small book format: @c ------------------------------ --- 16,22 ---- *************** *** 44,50 **** @ifinfo ! Copyright (C) 1996 John W. Eaton. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice --- 42,48 ---- @ifinfo ! Copyright (C) 1996, 1997 John W. Eaton. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice *************** *** 68,84 **** @end ifinfo @titlepage ! @title{Octave} ! @subtitle{A high-level interactive language for numerical computations} ! @subtitle{Edition 2 for Octave version @value{VERSION}} ! @subtitle{October 1996} ! @author{John W. Eaton} @page @vskip 0pt plus 1filll ! Copyright @copyright{} 1996 John W. Eaton. ! This is the second edition of the Octave documentation, ! and is consistent with version @value{VERSION} of Octave. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice --- 66,82 ---- @end ifinfo @titlepage ! @title Octave ! @subtitle A high-level interactive language for numerical computations ! @subtitle Edition 3 for Octave version @value{VERSION} ! @subtitle February 1997 ! @author John W. Eaton @page @vskip 0pt plus 1filll ! Copyright @copyright{} 1996, 1997 John W. Eaton. ! This is the third edition of the Octave documentation, and is consistent ! with version @value{VERSION} of Octave. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice *************** *** 91,96 **** --- 89,99 ---- Permission is granted to copy and distribute translations of this manual into another language, under the same conditions as for modified versions. + + Portions of this document have been adapted from the @code{gawk}, + @code{readline}, @code{gcc}, and C library manuals, published by the Free + Software Foundation, 59 Temple Place---Suite 330, Boston, MA + 02111--1307, USA. @end titlepage @ifinfo *************** *** 105,177 **** @menu * Preface:: * Introduction:: A brief introduction to Octave. ! * Invoking Octave:: Command options supported by Octave. * Expressions:: Expressions. * Statements:: Looping and program flow control. * Functions and Scripts:: ! * Built-in Variables:: Descriptions of all built-in variables. * Arithmetic:: * Linear Algebra:: - * Polynomial Manipulations:: * Nonlinear Equations:: * Differential Equations:: * Optimization:: ! * Quadrature:: * Control Theory:: * Signal Processing:: - * Sets:: - * Statistics:: - * Plotting:: * Image Processing:: * Audio Processing:: - * Input and Output:: - * Special Matrices:: - * Matrix Manipulation:: - * String Functions:: * System Utilities:: ! * Command History Functions:: ! * Help:: ! * Programming Utilities:: ! * Amusements:: ! * Emacs:: ! * Installation:: How to configure, compile and install Octave. * Trouble:: If you have trouble installing Octave. ! * Command Line Editing:: Command history and editing. ! * Using Info:: * Copying:: The GNU General Public License. * Concept Index:: An item for each concept. * Variable Index:: An item for each documented variable. * Function Index:: An item for each documented function. * Operator Index:: An item for each documented operator. - * Readline Index:: An index for readline commands. - * Info Index:: An index for info commands. --- The Detailed Node Listing --- A Brief Introduction to Octave * Running Octave:: * Simple Examples:: ! * Comments:: ! * Executable Octave Programs:: * Errors:: Invoking Octave * Command Line Options:: * Startup Files:: ! Expressions - * Constant Expressions:: * Matrices:: * Ranges:: ! * Variables:: * Index Expressions:: - * Data Structures:: * Calling Functions:: - * Global Variables:: - * Keywords:: * Arithmetic Ops:: * Comparison Ops:: * Boolean Expressions:: --- 108,245 ---- @menu * Preface:: * Introduction:: A brief introduction to Octave. ! * Getting Started:: ! * Data Types:: ! * Numeric Data Types:: ! * Strings:: ! * Data Structures:: ! * Variables:: * Expressions:: Expressions. + * Evaluation:: * Statements:: Looping and program flow control. * Functions and Scripts:: ! * Error Handling:: ! * Input and Output:: ! * Plotting:: ! * Matrix Manipulation:: * Arithmetic:: * Linear Algebra:: * Nonlinear Equations:: + * Quadrature:: * Differential Equations:: * Optimization:: ! * Statistics:: ! * Sets:: ! * Polynomial Manipulations:: * Control Theory:: * Signal Processing:: * Image Processing:: * Audio Processing:: * System Utilities:: ! * Tips:: * Trouble:: If you have trouble installing Octave. ! * Installation:: How to configure, compile and install Octave. ! * Emacs:: ! * Grammar:: * Copying:: The GNU General Public License. * Concept Index:: An item for each concept. * Variable Index:: An item for each documented variable. * Function Index:: An item for each documented function. * Operator Index:: An item for each documented operator. --- The Detailed Node Listing --- + Preface + + * Acknowledgements:: + * How You Can Contribute to Octave:: + * Distribution:: + A Brief Introduction to Octave * Running Octave:: * Simple Examples:: ! * Conventions:: ! ! Conventions ! ! * Fonts:: ! * Evaluation Notation:: ! * Printing Notation:: ! * Error Messages:: ! * Format of Descriptions:: ! ! Format of Descriptions ! ! * A Sample Function Description:: ! * A Sample Command Description:: ! * A Sample Variable Description:: ! ! Getting Started ! ! * Invoking Octave:: ! * Quitting Octave:: ! * Getting Help:: ! * Command Line Editing:: * Errors:: + * Executable Octave Programs:: + * Comments:: Invoking Octave * Command Line Options:: * Startup Files:: ! Command Line Editing ! ! * Cursor Motion:: ! * Killing and Yanking:: ! * Commands For Text:: ! * Commands For Completion:: ! * Commands For History:: ! * Customizing the Prompt:: ! * Diary and Echo Commands:: ! ! Data Types ! ! * Built-in Data Types:: ! * User-defined Data Types:: ! * Object Sizes:: ! ! Built-in Data Types ! ! * Numeric Objects:: ! * String Objects:: ! * Data Structure Objects:: ! ! Numeric Data Types * Matrices:: * Ranges:: ! * Predicates for Numeric Objects:: ! ! Matrices ! ! * Empty Matrices:: ! ! Strings ! ! * Creating Strings:: ! * Searching and Replacing:: ! * String Conversions:: ! * Character Class Functions:: ! ! Variables ! ! * Global Variables:: ! * Status of Variables:: ! * Summary of Built-in Variables:: ! * Defaults from the Environment:: ! ! Expressions ! * Index Expressions:: * Calling Functions:: * Arithmetic Ops:: * Comparison Ops:: * Boolean Expressions:: *************** *** 179,193 **** * Increment Ops:: * Operator Precedence:: - Constant Expressions - - * Numeric Constants:: - * String Constants:: - - Matrices - - * Empty Matrices:: - Calling Functions * Call by Value:: --- 247,252 ---- *************** *** 225,273 **** * Dynamically Linked Functions:: * Organization of Functions:: - Built-in Variables - - * Miscellaneous Built-in Variables:: - * Summary of Preference Variables:: - - Arithmetic - - * Utility Functions:: - * Complex Arithmetic:: - * Trigonometry:: - * Sums and Products:: - * Special Functions:: - * Mathematical Constants:: - - Linear Algebra - - * Basic Matrix Functions:: - * Matrix Factorizations:: - * Functions of a Matrix:: - - Differential Equations - - * Ordinary Differential Equations:: - * Differential-Algebraic Equations:: - - Optimization - - * Quadratic Programming:: - * Nonlinear Programming:: - * Linear Least Squares:: - - Quadrature - - * Functions of one Variable:: - * Orthogonal Collocation:: - - Plotting - - * Two-Dimensional Plotting:: - * Three-Dimensional Plotting:: - * Multiple Plots on One Page:: - * Miscellaneous Plotting Functions:: - Input and Output * Basic Input and Output:: --- 284,289 ---- *************** *** 282,292 **** C-Style I/O Functions * Opening and Closing Files:: * Formatted Output:: * Output Conversion Syntax:: * Table of Output Conversions:: * Integer Conversions:: ! * Floating-Point Conversions:: * Other Output Conversions:: * Formatted Input:: * Input Conversion Syntax:: --- 298,311 ---- C-Style I/O Functions * Opening and Closing Files:: + * Simple Output:: + * Line-Oriented Input:: * Formatted Output:: + * Output Conversion for Matrices:: * Output Conversion Syntax:: * Table of Output Conversions:: * Integer Conversions:: ! * Floating-Point Conversions:: Other Output Conversions:: * Other Output Conversions:: * Formatted Input:: * Input Conversion Syntax:: *************** *** 294,342 **** * Numeric Input Conversions:: * String Input Conversions:: * Binary I/O:: ! * Other I/O Functions:: ! Special Matrices ! * Special Utility Matrices:: ! * Famous Matrices:: Matrix Manipulation * Finding Elements and Checking Conditions:: * Rearranging Matrices:: ! System Utilities ! * Timing Utilities:: ! * Filesystem Utilities:: ! * Interacting with the OS:: ! * Password Database Functions:: ! * Group Database Functions:: ! * System Information:: ! * Other Functions:: ! Programming Utilities ! * Evaluating Strings as Commands:: ! * Miscellaneous Utilities:: ! Using Emacs With Octave ! * Installing the Emacs Octave Package:: ! * Using Octave Mode:: ! * Running Octave From Within Emacs:: ! * Using the Emacs Info Reader for Octave:: ! Installing Octave ! * Installation Problems:: ! * Binary Distributions:: ! Binary Distributions ! * Installing Octave from a Binary Distribution:: ! * Creating a Binary Distribution:: Known Causes of Trouble with Octave --- 313,387 ---- * Numeric Input Conversions:: * String Input Conversions:: * Binary I/O:: ! * Temporary Files:: ! * EOF and Errors:: ! * File Positioning:: ! Plotting ! * Two-Dimensional Plotting:: ! * Specialized Two-Dimensional Plots:: ! * Three-Dimensional Plotting:: ! * Plot Annotations:: ! * Multiple Plots on One Page:: Matrix Manipulation * Finding Elements and Checking Conditions:: * Rearranging Matrices:: + * Special Utility Matrices:: + * Famous Matrices:: ! Arithmetic ! * Utility Functions:: ! * Complex Arithmetic:: ! * Trigonometry:: ! * Sums and Products:: ! * Special Functions:: ! * Mathematical Constants:: ! Linear Algebra ! * Basic Matrix Functions:: ! * Matrix Factorizations:: ! * Functions of a Matrix:: ! Quadrature ! * Functions of One Variable:: ! * Orthogonal Collocation:: ! Differential Equations ! * Ordinary Differential Equations:: ! * Differential-Algebraic Equations:: ! Optimization ! * Quadratic Programming:: ! * Nonlinear Programming:: ! * Linear Least Squares:: ! ! System Utilities ! ! * Timing Utilities:: ! * Filesystem Utilities:: ! * Controlling Subprocesses:: ! * Process ID Information:: ! * Environment Variables:: ! * Current Working Directory:: ! * Password Database Functions:: ! * Group Database Functions:: ! * System Information:: ! ! Tips and Standards ! ! * Style Tips:: Writing clean and robust programs. ! * Coding Tips:: Making code run faster. ! * Documentation Tips:: Writing readable documentation strings. ! * Comment Tips:: Conventions for writing comments. ! * Function Headers:: Standard headers for functions. Known Causes of Trouble with Octave *************** *** 355,496 **** * Reporting: Bug Reporting. How to report a bug effectively. * Patches: Sending Patches. How to send a patch for Octave. ! Command Line Editing ! * Introduction and Notation:: Notation used in this text. ! * Readline Interaction:: The minimum set of commands for editing a line. ! * Readline Bare Essentials:: ! * Readline Movement Commands:: ! * Readline Killing Commands:: ! * Readline Arguments:: ! * Readline Init File:: Customizing Readline from a user's view. ! * Readline Init Syntax:: ! * Readline Vi Mode:: ! ! Readline Interaction ! ! * Readline Bare Essentials:: The least you need to know about Readline. ! * Readline Movement Commands:: Moving about the input line. ! * Readline Killing Commands:: How to delete text, and how to get it back! ! * Readline Arguments:: Giving numeric arguments to commands. ! ! Readline Init File ! ! * Readline Init Syntax:: Syntax for the commands in @file{~/.inputrc}. ! * Readline Vi Mode:: Switching to @code{vi} mode in Readline. ! ! Readline Init Syntax ! ! * Commands For Moving:: Moving about the line. ! * Commands For History:: Getting at previous lines. ! * Commands For Text:: Commands for changing text. ! * Commands For Killing:: Commands for killing and yanking. ! * Numeric Arguments:: Specifying numeric arguments, repeat counts. ! * Commands For Completion:: Getting Readline to do the typing for you. ! * Miscellaneous Commands:: Other miscellaneous commands. ! ! Using Info ! ! * Cursor Commands:: ! * Scrolling Commands:: ! * Node Commands:: ! * Searching Commands:: ! * Xref Commands:: ! * Window Commands:: ! * Printing Nodes:: ! * Other Info Commands:: ! * Info Variables:: ! ! Using Info ! ! * Cursor Commands:: Commands which move the cursor within a node. ! * Scrolling Commands:: Commands for moving the node around in a window. ! * Node Commands:: Commands for selecting a new node. ! * Searching Commands:: Commands for searching an info file. ! * Xref Commands:: Commands for selecting cross references. ! * Window Commands:: Commands which manipulate multiple windows. ! * Printing Nodes:: How to print out the contents of a node. ! * Other Info Commands:: A few commands that defy categories. ! * Info Variables:: How to change the default behavior of Info. ! ! Selecting Cross References ! ! * Parts of an Xref:: What a cross reference is made of. ! * Selecting Xrefs:: Commands for selecting menu or note items. ! ! Manipulating Multiple Windows ! ! * The Mode Line:: What appears in the mode line? ! * Basic Windows:: Manipulating windows in Info. ! * The Echo Area:: Used for displaying errors and reading input. @end menu @include preface.texi @include intro.texi ! @include invoke.texi @include expr.texi @include stmt.texi @include func.texi ! @include var.texi @include arith.texi @include linalg.texi - @include poly.texi @include nonlin.texi @include diffeq.texi @include optim.texi ! @include quad.texi @include control.texi @include signal.texi - @include set.texi - @include stats.texi - @include plot.texi @include image.texi @include audio.texi - @include io.texi - @include special.texi - @include matrix.texi - @include strings.texi @include system.texi ! @include history.texi ! @include help.texi ! @include program.texi ! @include amuse.texi @c Appendices start here. Installation and bugs have to go before the @c readline and Info appendices because we want to have separate indices @c for them, and there appears to be no way to go back to the original @c set of indices once a redirection has taken place. ! @include emacs.texi ! @include install.texi @include bugs.texi ! ! @c Make a separate index for all readline commands, functions, and ! @c concepts. ! @defindex rd ! @syncodeindex cp rd ! @syncodeindex fn rd ! @syncodeindex ky rd ! @syncodeindex vr rd ! ! @include rluser.texi ! ! @c Make a separate index for all Info commands, functions, and concepts. ! @defindex in ! @syncodeindex cp in ! @syncodeindex fn in ! @syncodeindex ky in ! @syncodeindex vr in ! ! @include gnuinfo.texi @include gpl.texi @include cp-idx.texi @include vr-idx.texi @include fn-idx.texi @include op-idx.texi - @include rd-idx.texi - @include in-idx.texi @contents --- 400,479 ---- * Reporting: Bug Reporting. How to report a bug effectively. * Patches: Sending Patches. How to send a patch for Octave. ! Installing Octave ! * Installation Problems:: ! * Binary Distributions:: ! ! Binary Distributions ! ! * Installing Octave from a Binary Distribution:: ! * Creating a Binary Distribution:: ! ! Using Emacs With Octave ! ! * Installing the Emacs Octave Package:: ! * Using Octave Mode:: ! * Running Octave From Within Emacs:: ! * Using the Emacs Info Reader for Octave:: ! ! Grammar ! ! * Keywords:: @end menu @include preface.texi @include intro.texi ! @include basics.texi ! @include data.texi ! @include numbers.texi ! @include strings.texi ! @include struct.texi ! @include var.texi @include expr.texi + @include eval.texi @include stmt.texi @include func.texi ! @include errors.texi ! @include io.texi ! @include plot.texi ! @include matrix.texi @include arith.texi @include linalg.texi @include nonlin.texi + @include quad.texi @include diffeq.texi @include optim.texi ! @include stats.texi ! @include set.texi ! @include poly.texi @include control.texi @include signal.texi @include image.texi @include audio.texi @include system.texi ! ! @c maybe add again later, if anyone every writes any really interesting ! @c fun stuff for Octave. ! @c ! @c @include amuse.texi @c Appendices start here. Installation and bugs have to go before the @c readline and Info appendices because we want to have separate indices @c for them, and there appears to be no way to go back to the original @c set of indices once a redirection has taken place. ! @include tips.texi @include bugs.texi ! @include install.texi ! @include emacs.texi ! @include grammar.texi @include gpl.texi @include cp-idx.texi @include vr-idx.texi @include fn-idx.texi @include op-idx.texi @contents diff -cNr octave-2.0.2/doc/interpreter/op-idx.texi octave-2.0.3/doc/interpreter/op-idx.texi *** octave-2.0.2/doc/interpreter/op-idx.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/op-idx.texi Sun Feb 16 22:48:25 1997 *************** *** 1,8 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Operator Index, Readline Index, Function Index, Top @unnumbered Operator Index @printindex op --- 1,8 ---- ! @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 Operator Index, , Function Index, Top @unnumbered Operator Index @printindex op diff -cNr octave-2.0.2/doc/interpreter/optim.texi octave-2.0.3/doc/interpreter/optim.texi *** octave-2.0.2/doc/interpreter/optim.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/optim.texi Mon Feb 17 15:28:53 1997 *************** *** 1,8 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Optimization, Quadrature, Differential Equations, Top @chapter Optimization @menu --- 1,8 ---- ! @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 Optimization, Statistics, Differential Equations, Top @chapter Optimization @menu *************** *** 23,31 **** @section Quadratic Programming @deftypefn {Loadable Function} {[@var{x}, @var{obj}, @var{info}, @var{lambda}] =} qpsol (@var{x}, @var{H}, @var{c}, @var{lb}, @var{ub}, @var{lb}, @var{A}, @var{ub}) ! Solve quadratic programs using Gill and Murray's QPSOL. Because QPSOL ! is not freely redistributable, this function is only available if you ! have obtained your own copy of QPSOL. @xref{Installation}. @end deftypefn @deftypefn {Loadable Function} {} qpsol_options (@var{opt}, @var{val}) --- 23,32 ---- @section Quadratic Programming @deftypefn {Loadable Function} {[@var{x}, @var{obj}, @var{info}, @var{lambda}] =} qpsol (@var{x}, @var{H}, @var{c}, @var{lb}, @var{ub}, @var{lb}, @var{A}, @var{ub}) ! Solve quadratic programs using Gill and Murray's @sc{Qpsol}. Because ! @sc{Qpsol} is not freely redistributable, this function is only ! available if you have obtained your own copy of @sc{Qpsol}. ! @xref{Installation}. @end deftypefn @deftypefn {Loadable Function} {} qpsol_options (@var{opt}, @var{val}) *************** *** 55,63 **** @end ignore @deftypefn {Loadable Function} {[@var{x}, @var{obj}, @var{info}, @var{lambda}] =} npsol (@var{x}, @var{phi}, @var{lb}, @var{ub}, @var{lb}, @var{A}, @var{ub}, @var{lb}, @var{g}, @var{ub}) ! Solve nonlinear programs using Gill and Murray's NPSOL. Because NPSOL ! is not freely redistributable, this function is only available if you ! have obtained your own copy of NPSOL. @xref{Installation}. The second argument is a string containing the name of the objective function to call. The objective function must be of the form --- 56,65 ---- @end ignore @deftypefn {Loadable Function} {[@var{x}, @var{obj}, @var{info}, @var{lambda}] =} npsol (@var{x}, @var{phi}, @var{lb}, @var{ub}, @var{lb}, @var{A}, @var{ub}, @var{lb}, @var{g}, @var{ub}) ! Solve nonlinear programs using Gill and Murray's @sc{Npsol}. Because ! @sc{Npsol} is not freely redistributable, this function is only ! available if you have obtained your own copy of @sc{Npsol}. ! @xref{Installation}. The second argument is a string containing the name of the objective function to call. The objective function must be of the form *************** *** 81,144 **** @node Linear Least Squares, , Nonlinear Programming, Optimization @section Linear Least Squares ! @deftypefn {Function File} {} gls (@var{Y}, @var{X}, @var{O}) ! Generalized least squares (GLS) estimation for the multivariate model ! ! @example ! Y = X * B + E, mean(E) = 0, cov(vec(E)) = (s^2)*O ! @end example ! ! @noindent ! with ! ! @example ! Y an T x p matrix ! X an T x k matrix ! B an k x p matrix ! E an T x p matrix ! O an Tp x Tp matrix ! @end example @noindent Each row of Y and X is an observation and each column a variable. ! Returns BETA, v, and, R, where BETA is the GLS estimator for B, v is the ! GLS estimator for s^2, and R = Y - X*BETA is the matrix of GLS residuals. ! @end deftypefn ! ! @deftypefn {Function File} {} ols (@var{Y}, @var{X}) ! Ordinary Least Squares (OLS) estimation for the multivariate model ! ! @example ! Y = X*B + E, mean (E) = 0, cov (vec (E)) = kron (S, I) ! @end example ! @noindent with ! ! @example ! Y an T x p matrix ! X an T x k matrix ! B an k x p matrix ! E an T x p matrix ! @end example ! ! @noindent ! Each row of Y and X is an observation and each column a variable. ! ! Returns BETA, SIGMA, and R, where BETA is the OLS estimator for B, i.e. ! ! @example ! BETA = pinv(X)*Y, ! @end example ! ! @noindent ! where pinv(X) denotes the pseudoinverse of X, SIGMA is the OLS estimator ! for the matrix S, i.e. ! ! @example ! SIGMA = (Y - X*BETA)'*(Y - X*BETA) / (T - rank(X)) ! @end example ! ! and R = Y - X*BETA is the matrix of OLS residuals. @end deftypefn --- 83,183 ---- @node Linear Least Squares, , Nonlinear Programming, Optimization @section Linear Least Squares ! @deftypefn {Function File} {[@var{beta}, @var{v}, @var{r}] =} gls (@var{y}, @var{x}, @var{o}) ! Generalized least squares estimation for the multivariate model ! @iftex ! @tex ! $y = x b + e$ ! with $\bar{e} = 0$ and cov(vec($e$)) = $(s^2)o$, ! @end tex ! @end iftex ! @ifinfo ! @code{@var{y} = @var{x} * @var{b} + @var{e}} with @code{mean (@var{e}) = ! 0} and @code{cov (vec (@var{e})) = (@var{s}^2)*@var{o}}, ! @end ifinfo ! where ! @iftex ! @tex ! $y$ is a $t \times p$ matrix, $x$ is a $t \times k$ matrix, $b$ is a $k ! \times p$ matrix, $e$ is a $t \times p$ matrix, and $o$ is a $tp \times ! tp$ matrix. ! @end tex ! @end iftex ! @ifinfo ! @var{Y} is a @var{T} by @var{p} matrix, @var{X} is a @var{T} by @var{k} ! matrix, @var{B} is a @var{k} by @var{p} matrix, @var{E} is a @var{T} by ! @var{p} matrix, and @var{O} is a @var{T}@var{p} by @var{T}@var{p} ! matrix. ! @end ifinfo @noindent Each row of Y and X is an observation and each column a variable. ! The return values @var{beta}, @var{v}, and @var{r} are defined as ! follows. ! @table @var ! @item beta ! The GLS estimator for @var{b}. ! ! @item v ! The GLS estimator for @code{@var{s}^2}. ! ! @item r ! The matrix of GLS residuals, @code{@var{r} = @var{y} - @var{x} * ! @var{beta}}. ! @end table ! @end deftypefn ! ! @deftypefn {Function File} {[@var{beta}, @var{sigma}, @var{r}] =} ols (@var{y}, @var{x}) ! Ordinary least squares estimation for the multivariate model ! @iftex ! @tex ! $y = x b + e$ with ! $\bar{e} = 0$, and cov(vec($e$)) = kron ($s, I$) ! @end tex ! @end iftex ! @ifinfo ! @code{@var{y} = @var{x}*@var{b} + @var{e}} with ! @code{mean (@var{e}) = 0} and @code{cov (vec (@var{e})) = kron (@var{s}, ! @var{I})}. ! @end ifinfo ! where ! @iftex ! @tex ! $y$ is a $t \times p$ matrix, $x$ is a $t \times k$ matrix, ! $b$ is a $k \times p$ matrix, and $e$ is a $t \times p$ matrix. ! @end tex ! @end iftex ! @ifinfo ! @var{y} is a @var{t} by @var{p} matrix, @var{X} is a @var{t} by @var{k} ! matrix, @var{B} is a @var{k} by @var{p} matrix, and @var{e} is a @var{t} ! by @var{p} matrix. ! @end ifinfo ! ! Each row of @var{y} and @var{x} is an observation and each column a ! variable. ! ! The return values @var{beta}, @var{sigma}, and @var{r} are defined as ! follows. ! ! @table @var ! @item beta ! The OLS estimator for @var{b}, @code{@var{beta} = pinv (@var{x}) * ! @var{y}}, where @code{pinv (@var{x})} denotes the pseudoinverse of ! @var{x}. ! ! @item sigma ! The OLS estimator for the matrix @var{s}, ! ! @example ! @group ! @var{sigma} = (@var{y}-@var{x}*@var{beta})' * (@var{y}-@var{x}*@var{beta}) / (@var{t}-rank(@var{x})) ! @end group ! @end example ! ! @item r ! The matrix of OLS residuals, @code{@var{r} = @var{y} - @var{x} * @var{beta}}. ! @end table @end deftypefn diff -cNr octave-2.0.2/doc/interpreter/plot.texi octave-2.0.3/doc/interpreter/plot.texi *** octave-2.0.2/doc/interpreter/plot.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/plot.texi Mon Feb 17 15:28:27 1997 *************** *** 1,14 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Plotting, Image Processing, Statistics, Top @chapter Plotting All of Octave's plotting functions use @code{gnuplot} to handle the actual graphics. There are two low-level functions, @code{gplot} and @code{gsplot}, that behave almost exactly like the corresponding ! @code{gnuplot} functions @code{plot} and @samp{splot}. A number of other higher level plotting functions, patterned after the graphics functions found in @sc{Matlab} version 3.5, are also available. These higher level functions are all implemented in terms of the two --- 1,14 ---- ! @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 Plotting, Matrix Manipulation, Input and Output, Top @chapter Plotting All of Octave's plotting functions use @code{gnuplot} to handle the actual graphics. There are two low-level functions, @code{gplot} and @code{gsplot}, that behave almost exactly like the corresponding ! @code{gnuplot} functions @code{plot} and @code{splot}. A number of other higher level plotting functions, patterned after the graphics functions found in @sc{Matlab} version 3.5, are also available. These higher level functions are all implemented in terms of the two *************** *** 16,27 **** @menu * Two-Dimensional Plotting:: * Three-Dimensional Plotting:: * Multiple Plots on One Page:: - * Miscellaneous Plotting Functions:: @end menu ! @node Two-Dimensional Plotting, Three-Dimensional Plotting, Plotting, Plotting @section Two-Dimensional Plotting @deffn {Command} gplot @var{ranges} @var{expression} @var{using} @var{title} @var{style} --- 16,28 ---- @menu * Two-Dimensional Plotting:: + * Specialized Two-Dimensional Plots:: * Three-Dimensional Plotting:: + * Plot Annotations:: * Multiple Plots on One Page:: @end menu ! @node Two-Dimensional Plotting, Specialized Two-Dimensional Plots, Plotting, Plotting @section Two-Dimensional Plotting @deffn {Command} gplot @var{ranges} @var{expression} @var{using} @var{title} @var{style} *************** *** 88,96 **** @noindent will plot two lines. The first line is generated by the command @code{data with lines}, and is a graph of the sine function over the ! range -10 to 10. The data is taken from the first two columns of the ! matrix because columns to plot were not specified with the @var{using} ! qualifier. The clause @code{using 1:3} in the second part of this plot command specifies that the first and third columns of the matrix @code{data} --- 89,97 ---- @noindent will plot two lines. The first line is generated by the command @code{data with lines}, and is a graph of the sine function over the ! range @minus{}10 to 10. The data is taken from the first two columns of ! the matrix because columns to plot were not specified with the ! @var{using} qualifier. The clause @code{using 1:3} in the second part of this plot command specifies that the first and third columns of the matrix @code{data} *************** *** 101,117 **** the border of the plot. @end deffn ! @deffn {Command} set options ! @deffnx {Command} show options @deffnx {Command} replot options In addition to the basic plotting commands, the whole range of ! @code{set} and @code{show} commands from @code{gnuplot} are available, as is @code{replot}. ! The @code{set} and @code{show} commands allow you to set and show ! @code{gnuplot} parameters. For more information about the set and show ! commands, see the @code{gnuplot} user's guide (also available on line if ! you run @code{gnuplot} directly, instead of running it from Octave). The @code{replot} command allows you to force the plot to be redisplayed. This is useful if you have changed something about the --- 102,128 ---- the border of the plot. @end deffn ! @deffn {Command} gset options ! @deffnx {Command} gshow options @deffnx {Command} replot options In addition to the basic plotting commands, the whole range of ! @code{gset} and @code{gshow} commands from @code{gnuplot} are available, as is @code{replot}. ! @findex set ! @findex show ! Note that in Octave 2.0, the @code{set} and @code{show} commands were ! renamed to @code{gset} and @code{gshow} in order to allow for ! compatibility with the @sc{Matlab} graphics and GUI commands in a future ! version of Octave. (For now, the old @code{set} and @code{show} ! commands do work, but they print an annoying warning message to try to ! get people to switch to using @code{gset} and @code{gshow}.) ! ! The @code{gset} and @code{gshow} commands allow you to set and show ! @code{gnuplot} parameters. For more information about the @code{gset} ! and @code{gshow} commands, see the documentation for @code{set} and ! @code{show} in the @code{gnuplot} user's guide (also available on line ! if you run @code{gnuplot} directly, instead of running it from Octave). The @code{replot} command allows you to force the plot to be redisplayed. This is useful if you have changed something about the *************** *** 122,141 **** For example, @example ! set term tek40 ! set output "/dev/plotter" ! set title "sine with lines and cosine with impulses" replot "sin (x) w l" @end example will change the terminal type for plotting, add a title to the current ! plot, add a graph of sin (x) to the plot, and force the new plot to be sent to the plot device. This last step is normally required in order to update the plot. This default is reasonable for slow terminals or hardcopy output devices because even when you are adding additional lines with a replot command, gnuplot always redraws the entire plot, and you probably don't want to have a completely new plot generated every time something as minor as an axis label changes. @end deffn @defvr {Built-in Variable} automatic_replot --- 133,165 ---- For example, @example ! gset term tek40 ! gset output "/dev/plotter" ! gset title "sine with lines and cosine with impulses" replot "sin (x) w l" @end example will change the terminal type for plotting, add a title to the current ! plot, add a graph of ! @iftex ! @tex ! $\sin(x)$ ! @end tex ! @end iftex ! @ifinfo ! sin (x) ! @end ifinfo ! to the plot, and force the new plot to be sent to the plot device. This last step is normally required in order to update the plot. This default is reasonable for slow terminals or hardcopy output devices because even when you are adding additional lines with a replot command, gnuplot always redraws the entire plot, and you probably don't want to have a completely new plot generated every time something as minor as an axis label changes. + + @findex shg + The command @code{shg} is equivalent to executing @code{replot} without + any arguments. @end deffn @defvr {Built-in Variable} automatic_replot *************** *** 164,170 **** combinations of arguments are possible. The simplest form is @example ! plot (y) @end example @noindent --- 188,194 ---- combinations of arguments are possible. The simplest form is @example ! plot (@var{y}) @end example @noindent *************** *** 175,181 **** If more than one argument is given, they are interpreted as @example ! plot (x [, y] [, fmt] ...) @end example @noindent --- 199,205 ---- If more than one argument is given, they are interpreted as @example ! plot (@var{x}, @var{y}, @var{fmt} ...) @end example @noindent *************** *** 215,266 **** The @var{fmt} argument, if present is interpreted as follows. If @var{fmt} is missing, the default gnuplot line style is assumed. ! @table @asis ! @item @samp{-} Set lines plot style (default). ! @item @samp{.} Set dots plot style. ! @item @samp{@@} Set points plot style. ! @item @samp{-@@} Set linespoints plot style. ! @item @samp{^} Set impulses plot style. ! @item @samp{L} Set steps plot style. ! @item @samp{#} Set boxes plot style. ! @item @samp{~} Set errorbars plot style. ! @item @samp{#~} Set boxerrorbars plot style. ! @item @samp{n} Interpreted as the plot color if @var{n} is an integer in the range 1 to 6. ! @item @samp{nm} If @var{nm} is a two digit integer and @var{m} is an integer in the range 1 to 6, @var{m} is interpreted as the point style. This is only valid in combination with the @code{@@} or @code{-@@} specifiers. ! @item @samp{c} ! If @var{c} is one of @var{"r"}, @var{"g"}, @var{"b"}, @var{"m"}, ! @var{"c"}, or @var{"w"}, it is interpreted as the plot color (red, green, blue, magenta, cyan, or white). ! @item @samp{+} ! @itemx @samp{*} ! @itemx @samp{o} ! @itemx @samp{x} Used in combination with the points or linespoints styles, set the point style. @end table --- 239,290 ---- The @var{fmt} argument, if present is interpreted as follows. If @var{fmt} is missing, the default gnuplot line style is assumed. ! @table @samp ! @item - Set lines plot style (default). ! @item . Set dots plot style. ! @item @@ Set points plot style. ! @item -@@ Set linespoints plot style. ! @item ^ Set impulses plot style. ! @item L Set steps plot style. ! @item # Set boxes plot style. ! @item ~ Set errorbars plot style. ! @item #~ Set boxerrorbars plot style. ! @item @var{n} Interpreted as the plot color if @var{n} is an integer in the range 1 to 6. ! @item @var{nm} If @var{nm} is a two digit integer and @var{m} is an integer in the range 1 to 6, @var{m} is interpreted as the point style. This is only valid in combination with the @code{@@} or @code{-@@} specifiers. ! @item @var{c} ! If @var{c} is one of @code{"r"}, @code{"g"}, @code{"b"}, @code{"m"}, ! @code{"c"}, or @code{"w"}, it is interpreted as the plot color (red, green, blue, magenta, cyan, or white). ! @item + ! @itemx * ! @itemx o ! @itemx x Used in combination with the points or linespoints styles, set the point style. @end table *************** *** 284,299 **** plot (x, y, "@@12", x, y2, x, y3, "4", x, y4, "+") @end example ! This command will plot @var{y} with points of type 2 (displayed as ! @code{+}) and color 1 (red), @var{y2} with lines, @var{y3} with lines of ! color 4 (magenta) and @var{y4} with points displayed as @code{+}. @example plot (b, "*") @end example ! This command will plot the data in @var{b} will be plotted with points ! displayed as @code{*}. @end deftypefn @deftypefn {Function File} {} hold @var{args} --- 308,323 ---- plot (x, y, "@@12", x, y2, x, y3, "4", x, y4, "+") @end example ! This command will plot @code{y} with points of type 2 (displayed as ! @samp{+}) and color 1 (red), @code{y2} with lines, @code{y3} with lines of ! color 4 (magenta) and @code{y4} with points displayed as @samp{+}. @example plot (b, "*") @end example ! This command will plot the data in the variable @code{b} will be plotted ! with points displayed as @samp{*}. @end deftypefn @deftypefn {Function File} {} hold @var{args} *************** *** 313,328 **** @end deftypefn @deftypefn {Function File} {} ishold ! Returns 1 if the next line will be added to the current plot, or 0 if the plot device will be cleared before drawing the next line. @end deftypefn @deftypefn {Function File} {} loglog (@var{args}) Make a two-dimensional plot using log scales for both axes. See the description of @code{plot} above for a description of the arguments that @code{loglog} will accept. @end deftypefn @deftypefn {Function File} {} semilogx (@var{args}) Make a two-dimensional plot using a log scale for the @var{x} axis. See the description of @code{plot} above for a description of the arguments --- 337,454 ---- @end deftypefn @deftypefn {Function File} {} ishold ! Return 1 if the next line will be added to the current plot, or 0 if the plot device will be cleared before drawing the next line. @end deftypefn + @deftypefn {Function File} {} clearplot + @deftypefnx {Function File} {} clg + Clear the plot window and any titles or axis labels. The name + @code{clg} is aliased to @code{clearplot} for compatibility with @sc{Matlab}. + + The commands @kbd{gplot clear}, @kbd{gsplot clear}, and @kbd{replot + clear} are equivalent to @code{clearplot}. (Previously, commands like + @kbd{gplot clear} would evaluate @code{clear} as an ordinary expression + and clear all the visible variables.) + @end deftypefn + + @deftypefn {Function File} {} closeplot + Close stream to the @code{gnuplot} subprocess. If you are using X11, + this will close the plot window. + @end deftypefn + + @deftypefn {Function File} {} purge_tmp_files + Delete the temporary files created by the plotting commands. + + Octave creates temporary data files for @code{gnuplot} and then sends + commands to @code{gnuplot} through a pipe. Octave will delete the + temporary files on exit, but if you are doing a lot of plotting you may + want to clean up in the middle of a session. + + A future version of Octave will eliminate the need to use temporary + files to hold the plot data. + @end deftypefn + + @deftypefn {Function File} {} axis (@var{limits}) + Sets the axis limits for plots. + + The argument @var{limits} should be a 2, 4, or 6 element vector. The + first and second elements specify the lower and upper limits for the x + axis. The third and fourth specify the limits for the y axis, and the + fifth and sixth specify the limits for the z axis. + + With no arguments, @code{axis} turns autoscaling on. + + If your plot is already drawn, then you need to use @code{replot} before + the new axis limits will take effect. You can get this to happen + automatically by setting the built-in variable @code{automatic_replot} + to a nonzero value. + @end deftypefn + + @node Specialized Two-Dimensional Plots, Three-Dimensional Plotting, Two-Dimensional Plotting, Plotting + @section Specialized Two-Dimensional Plots + + @deftypefn {Function File} {} bar (@var{x}, @var{y}) + Given two vectors of x-y data, @code{bar} produces a bar graph. + + If only one argument is given, it is taken as a vector of y-values + and the x coordinates are taken to be the indices of the elements. + + If two output arguments are specified, the data are generated but + not plotted. For example, + + @example + bar (x, y); + @end example + + @noindent + and + + @example + [xb, yb] = bar (x, y); + plot (xb, yb); + @end example + + @noindent + are equivalent. + @end deftypefn + + @deftypefn {Function File} {} contour (@var{z}, @var{n}, @var{x}, @var{y}) + Make a contour plot of the three-dimensional surface described by + @var{z}. Someone needs to improve @code{gnuplot}'s contour routines + before this will be very useful. + @end deftypefn + + @deftypefn {Function File} {} hist (@var{y}, @var{x}) + Produce histogram counts or plots. + + With one vector input argument, plot a histogram of the values with + 10 bins. The range of the histogram bins is determined by the range + of the data. + + Given a second scalar argument, use that as the number of bins. + + Given a second vector argument, use that as the centers of the bins, + with the width of the bins determined from the adjacent values in + the vector. + + Extreme values are lumped in the first and last bins. + + With two output arguments, produce the values @var{nn} and @var{xx} such + that @code{bar (@var{xx}, @var{nn})} will plot the histogram. + @end deftypefn + @deftypefn {Function File} {} loglog (@var{args}) Make a two-dimensional plot using log scales for both axes. See the description of @code{plot} above for a description of the arguments that @code{loglog} will accept. @end deftypefn + @deftypefn {Function File} {} polar (@var{theta}, @var{rho}) + Make a two-dimensional plot given polar the coordinates @var{theta} and + @var{rho}. + @end deftypefn + @deftypefn {Function File} {} semilogx (@var{args}) Make a two-dimensional plot using a log scale for the @var{x} axis. See the description of @code{plot} above for a description of the arguments *************** *** 335,352 **** that @code{semilogy} will accept. @end deftypefn ! @deftypefn {Function File} {} contour (@var{z}, @var{n}, @var{x}, @var{y}) ! Make a contour plot of the three-dimensional surface described by ! @var{z}. Someone needs to improve @code{gnuplot}'s contour routines ! before this will be very useful. ! @end deftypefn ! @deftypefn {Function File} {} polar (@var{theta}, @var{rho}) ! Make a two-dimensional plot given polar the coordinates @var{theta} and ! @var{rho}. @end deftypefn ! @node Three-Dimensional Plotting, Multiple Plots on One Page, Two-Dimensional Plotting, Plotting @section Three-Dimensional Plotting @deffn {Command} gsplot @var{ranges} @var{expression} @var{using} @var{title} @var{style} --- 461,492 ---- that @code{semilogy} will accept. @end deftypefn ! @deftypefn {Function File} {} stairs (@var{x}, @var{y}) ! Given two vectors of x-y data, bar produces a `stairstep' plot. ! If only one argument is given, it is taken as a vector of y-values ! and the x coordinates are taken to be the indices of the elements. ! ! If two output arguments are specified, the data are generated but ! not plotted. For example, ! ! @example ! stairs (x, y); ! @end example ! ! @noindent ! and ! ! @example ! [xs, ys] = stairs (x, y); ! plot (xs, ys); ! @end example ! ! @noindent ! are equivalent. @end deftypefn ! @node Three-Dimensional Plotting, Plot Annotations, Specialized Two-Dimensional Plots, Plotting @section Three-Dimensional Plotting @deffn {Command} gsplot @var{ranges} @var{expression} @var{using} @var{title} @var{style} *************** *** 393,402 **** and column indices of the matrix. If parametric plotting mode is set (using the command ! @samp{set parametric}, then @code{gsplot} takes the columns of the matrix three at a time as the x, y and z values that define a line in three space. Any extra columns are ignored, and the x and y values are ! expected to be sorted. For example, with @samp{parametric} set, it makes sense to plot a matrix like @iftex @tex --- 533,542 ---- and column indices of the matrix. If parametric plotting mode is set (using the command ! @kbd{gset parametric}, then @code{gsplot} takes the columns of the matrix three at a time as the x, y and z values that define a line in three space. Any extra columns are ignored, and the x and y values are ! expected to be sorted. For example, with @code{parametric} set, it makes sense to plot a matrix like @iftex @tex *************** *** 437,452 **** @code{meshdom}. @end deftypefn - @deftypefn {Function File} {[@var{xx}, @var{yy}] =} meshgrid (@var{x}, @var{y}) - Given vectors of @var{x} and @var{y} coordinates, return two matrices - corresponding to the @var{x} and @var{y} coordinates of a mesh. The - rows of @var{xx} are copies of @var{x}, and the columns of @var{yy} are - copies of @var{y}. - - @code{[@var{xx}, @var{yy}] = meshgrid (@var{x})} is an abbreviation for - @code{[@var{xx}, @var{yy}] = meshgrid (@var{x}, @var{x})}. - @end deftypefn - @defvr {Built-in Variable} gnuplot_binary The name of the program invoked by the plot command. The default value is @code{"gnuplot"}. @xref{Installation}. --- 577,582 ---- *************** *** 460,465 **** --- 590,601 ---- configure got it wrong, or if you upgrade your gnuplot installation. @end defvr + @deftypefn {Function File} {} figure (@var{n}) + Set the current plot window to plot window @var{n}. This function + currently requires X11 and a version of gnuplot that supports multiple + frames. + @end deftypefn + @defvr {Built-in Variable} gnuplot_has_multiplot If the value of this variable is nonzero, Octave assumes that your copy of gnuplot has the multiplot support that is included in recent *************** *** 468,474 **** configure got it wrong, or if you upgrade your gnuplot installation. @end defvr ! @node Multiple Plots on One Page, Miscellaneous Plotting Functions, Three-Dimensional Plotting, Plotting @section Multiple Plots on One Page The following functions all require a version of @code{gnuplot} that --- 604,630 ---- configure got it wrong, or if you upgrade your gnuplot installation. @end defvr ! @node Plot Annotations, Multiple Plots on One Page, Three-Dimensional Plotting, Plotting ! @section Plot Annotations ! ! @deftypefn {Function File} {} grid ! For two-dimensional plotting, force the display of a grid on the plot. ! @end deftypefn ! ! @deftypefn {Function File} {} title (@var{string}) ! Specify a title for the plot. If you already have a plot displayed, use ! the command @code{replot} to redisplay it with the new title. ! @end deftypefn ! ! @deftypefn {Function File} {} xlabel (@var{string}) ! @deftypefnx {Function File} {} ylabel (@var{string}) ! @deftypefnx {Function File} {} zlabel (@var{string}) ! Specify x, y, and z axis labels for the plot. If you already have a plot ! displayed, use the command @code{replot} to redisplay it with the new ! labels. ! @end deftypefn ! ! @node Multiple Plots on One Page, , Plot Annotations, Plotting @section Multiple Plots on One Page The following functions all require a version of @code{gnuplot} that *************** *** 477,489 **** @deftypefn {Function File} {} mplot (@var{x}, @var{y}) @deftypefnx {Function File} {} mplot (@var{x}, @var{y}, @var{fmt}) @deftypefnx {Function File} {} mplot (@var{x1}, @var{y1}, @var{x2}, @var{y2}) ! This is a modified version of @code{plot()} to work with the multiplot ! version of @code{gnuplot} to plot multiple plots per page. This plot version automatically advances to the next subplot position after each set of arguments are processed. ! See command @var{plot()} for the various options to this command ! as this is just mulitplot version of the same command. @end deftypefn @deftypefn {Function File} {} multiplot (@var{xn}, @var{yn}) --- 633,644 ---- @deftypefn {Function File} {} mplot (@var{x}, @var{y}) @deftypefnx {Function File} {} mplot (@var{x}, @var{y}, @var{fmt}) @deftypefnx {Function File} {} mplot (@var{x1}, @var{y1}, @var{x2}, @var{y2}) ! This is a modified version of the @code{plot} function that works with ! the multiplot version of @code{gnuplot} to plot multiple plots per page. This plot version automatically advances to the next subplot position after each set of arguments are processed. ! See the description of the @var{plot} function for the various options. @end deftypefn @deftypefn {Function File} {} multiplot (@var{xn}, @var{yn}) *************** *** 499,504 **** --- 654,688 ---- If in multiplot mode, switches to single plot mode. @end deftypefn + @deftypefn {Function File} {} plot_border (...) + Multiple arguments allowed to specify the sides on which the border + is shown. Allowed arguments include: + + @table @code + @item "blank" + No borders displayed. + + @item "all" + All borders displayed + + @item "north" + North Border + + @item "south" + South Border + + @item "east" + East Border + + @item "west" + West Border + @end table + + @noindent + The arguments may be abbreviated to single characters. Without any + arguments, @code{plot_border} turns borders off. + @end deftypefn + @deftypefn {Function File} {} subplot (@var{rows}, @var{cols}, @var{index}) @deftypefnx {Function File} {} subplot (@var{rcn}) Sets @code{gnuplot} in multiplot mode and plots in location *************** *** 526,712 **** For example, a plot with 4 by 2 grid will have plot indices running as follows: ! ! @example @group ! +-------+-------+-------+-------+ ! | | | | | ! | 1 | 2 | 3 | 4 | ! | | | | | ! +-------+-------+-------+-------+ ! | | | | | ! | 5 | 6 | 7 | 8 | ! | | | | | ! +-------+-------+-------+-------+ @end group ! @end example @end deftypefn @deftypefn {Function File} {} subwindow (@var{xn}, @var{yn}) Sets the subwindow position in multiplot mode for the next plot. The multiplot mode has to be previously initialized using the ! @code{multiplot()} command, otherwise this command just becomes an alias ! to @var{multiplot()} @end deftypefn @deftypefn {Function File} {} top_title (@var{string}) @deftypefnx {Function File} {} bottom_title (@var{string}) Makes a title with text @var{string} at the top (bottom) of the plot. - @end deftypefn - - @deftypefn {Function File} {} plot_border (...) - Multiple arguments allowed to specify the sides on which the border - is shown. Allowed arguments include: - - @example - @group - "blank", "BLANK", "b", "B", @result{} No borders displayed - "all", "ALL", "a", "A", @result{} All borders displayed - "north", "NORTH", "n", "N", @result{} North Border - "south", "SOUTH", "s", "S", @result{} South Border - "east", "EAST", "e", "E", @result{} East Border - "west", "WEST", "w", "W", @result{} West Border - @end group - @end example - - @noindent - Without any arguments, turns borders off. - @end deftypefn - - @node Miscellaneous Plotting Functions, , Multiple Plots on One Page, Plotting - @section Miscellaneous Plotting Functions - - @deftypefn {Function File} {} bar (@var{x}, @var{y}) - Given two vectors of x-y data, @code{bar} produces a bar graph. - - If only one argument is given, it is taken as a vector of y-values - and the x coordinates are taken to be the indices of the elements. - - If two output arguments are specified, the data are generated but - not plotted. For example, - - @example - bar (x, y); - @end example - - @noindent - and - - @example - [xb, yb] = bar (x, y); - plot (xb, yb); - @end example - - @noindent - are equivalent. - @end deftypefn - - @deftypefn {Function File} {} grid - For two-dimensional plotting, force the display of a grid on the plot. - @end deftypefn - - @deftypefn {Function File} {} stairs (@var{x}, @var{y}) - Given two vectors of x-y data, bar produces a `stairstep' plot. - - If only one argument is given, it is taken as a vector of y-values - and the x coordinates are taken to be the indices of the elements. - - If two output arguments are specified, the data are generated but - not plotted. For example, - - @example - stairs (x, y); - @end example - - @noindent - and - - @example - [xs, ys] = stairs (x, y); - plot (xs, ys); - @end example - - @noindent - are equivalent. - @end deftypefn - - @deftypefn {Function File} {} title (@var{string}) - Specify a title for the plot. If you already have a plot displayed, use - the command @code{replot} to redisplay it with the new title. - @end deftypefn - - @deftypefn {Function File} {} xlabel (@var{string}) - @deftypefnx {Function File} {} ylabel (@var{string}) - @deftypefnx {Function File} {} zlabel (@var{string}) - Specify x, y, and z axis labels for the plot. If you already have a plot - displayed, use the command @code{replot} to redisplay it with the new - labels. - @end deftypefn - - @deftypefn {Function File} {} sombrero (@var{n}) - Display a classic three-dimensional mesh plot. The parameter @var{n} - allows you to increase the resolution. - @end deftypefn - - @deftypefn {Function File} {} clearplot - @deftypefnx {Function File} {} clg - Clear the plot window and any titles or axis labels. The name - @code{clg} is aliased to @code{clearplot} for compatibility with @sc{Matlab}. - - The commands @samp{gplot clear}, @samp{gsplot clear}, and @samp{replot - clear} are equivalent to @samp{clearplot}. (Previously, commands like - @samp{gplot clear} would evaluate @samp{clear} as an ordinary expression - and clear all the visible variables.) - @end deftypefn - - @deftypefn {Function File} {} closeplot - Close stream to the @code{gnuplot} subprocess. If you are using X11, - this will close the plot window. - @end deftypefn - - @deftypefn {Function File} {} purge_tmp_files - Delete the temporary files created by the plotting commands. - - Octave creates temporary data files for @code{gnuplot} and then sends - commands to @code{gnuplot} through a pipe. Octave will delete the - temporary files on exit, but if you are doing a lot of plotting you may - want to clean up in the middle of a session. - - A future version of Octave will eliminate the need to use temporary - files to hold the plot data. - @end deftypefn - - @deftypefn {Function File} {} axis (@var{limits}) - Sets the axis limits for plots. - - The argument @var{limits} should be a 2, 4, or 6 element vector. The - first and second elements specify the lower and upper limits for the x - axis. The third and fourth specify the limits for the y axis, and the - fifth and sixth specify the limits for the z axis. - - With no arguments, @code{axis} turns autoscaling on. - - If your plot is already drawn, then you need to use @code{replot} before - the new axis limits will take effect. You can get this to happen - automatically by setting the built-in variable @code{automatic_replot} - to a nonzero value. - @end deftypefn - - @deftypefn {Function File} {} hist (@var{y}, @var{x}) - Produce histogram counts or plots. - - With one vector input argument, plot a histogram of the values with - 10 bins. The range of the histogram bins is determined by the range - of the data. - - Given a second scalar argument, use that as the number of bins. - - Given a second vector argument, use that as the centers of the bins, - with the width of the bins determined from the adjacent values in - the vector. - - Extreme values are lumped in the first and last bins. - - With two output arguments, produce the values @var{nn} and @var{xx} such - that @code{bar (@var{xx}, @var{nn})} will plot the histogram. @end deftypefn --- 710,747 ---- For example, a plot with 4 by 2 grid will have plot indices running as follows: ! @iftex ! @tex ! \vskip 10pt ! \hfil\vbox{\offinterlineskip\hrule ! \halign{\vrule#&&\qquad\hfil#\hfil\qquad\vrule\cr ! height13pt&1&2&3&4\cr height12pt&&&&\cr\noalign{\hrule} ! height13pt&5&6&7&8\cr height12pt&&&&\cr\noalign{\hrule}}} ! \hfil ! \vskip 10pt ! @end tex ! @end iftex ! @ifinfo ! @display @group ! +-----+-----+-----+-----+ ! | 1 | 2 | 3 | 4 | ! +-----+-----+-----+-----+ ! | 5 | 6 | 7 | 8 | ! +-----+-----+-----+-----+ @end group ! @end display ! @end ifinfo @end deftypefn @deftypefn {Function File} {} subwindow (@var{xn}, @var{yn}) Sets the subwindow position in multiplot mode for the next plot. The multiplot mode has to be previously initialized using the ! @code{multiplot} function, otherwise this command just becomes an alias ! to @code{multiplot} @end deftypefn @deftypefn {Function File} {} top_title (@var{string}) @deftypefnx {Function File} {} bottom_title (@var{string}) Makes a title with text @var{string} at the top (bottom) of the plot. @end deftypefn diff -cNr octave-2.0.2/doc/interpreter/poly.texi octave-2.0.3/doc/interpreter/poly.texi *** octave-2.0.2/doc/interpreter/poly.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/poly.texi Mon Feb 17 00:10:26 1997 *************** *** 1,8 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Polynomial Manipulations, Nonlinear Equations, Linear Algebra, Top @chapter Polynomial Manipulations In Octave, a polynomial is represented by its coefficients (arranged --- 1,8 ---- ! @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 Polynomial Manipulations, Control Theory, Sets, Top @chapter Polynomial Manipulations In Octave, a polynomial is represented by its coefficients (arranged *************** *** 20,43 **** @ifinfo @var{N+1} @end ifinfo ! corresponds to the following ! @iftex ! @tex ! $N^{th}$ ! @end tex ! @end iftex ! @ifinfo ! @var{N}-th ! @end ifinfo ! order polynomial @iftex @tex $$ p (x) = c_1 x^N + ... + c_N x + c_{N+1}. $$ @end tex @end iftex @ifinfo @example p(x) = @var{c}(1) x^@var{N} + ... + @var{c}(@var{N}) x + @var{c}(@var{N}+1). --- 20,36 ---- @ifinfo @var{N+1} @end ifinfo ! corresponds to the following polynomial of order @iftex @tex + $N$ $$ p (x) = c_1 x^N + ... + c_N x + c_{N+1}. $$ @end tex @end iftex @ifinfo + @var{N} @example p(x) = @var{c}(1) x^@var{N} + ... + @var{c}(@var{N}) x + @var{c}(@var{N}+1). *************** *** 112,117 **** --- 105,126 ---- coefficients are given by vector @var{c}. @end deftypefn + @deftypefn {Function File} {} polyfit (@var{n}, @var{y}, @var{n}) + Returns the coefficients of a polynomial @var{p}(@var{x}) of degree + @var{n} that minimizes + @iftex + @tex + $$ + \sum_{i=1}^N (p(x_i) - y_i)^2 + $$ + @end tex + @end iftex + @ifinfo + @code{sumsq (p(x(i)) - y(i))}, + @end ifinfo + to best fit the data in the least squares sense. + @end deftypefn + @deftypefn {Function File} {} polyinteg (@var{c}) Returns the coefficients of the integral the polynomial whose coefficients are represented by the vector @var{c}. *************** *** 148,153 **** --- 157,163 ---- If @var{b} and @var{a} are vectors of polynomial coefficients, then residue calculates the partial fraction expansion corresponding to the ratio of the two polynomials. + @cindex partial fraction expansion The function @code{residue} returns @var{r}, @var{p}, @var{k}, and @var{e}, where the vector @var{r} contains the residue terms, @var{p} *************** *** 195,220 **** imaginary part is discarded. If two poles are farther apart than @var{tol} they are distinct. For example, - Example: - @example b = [1, 1, 1]; a = [1, -5, 8, -4]; ! [r, p, k, e] = residue (b, a) ! @end example ! @noindent ! returns ! ! @example ! r = [-2, 7, 3] ! p = [2, 2, 1] ! k = [](0x0) ! e = [1, 2, 1] @end example @noindent --- 205,226 ---- imaginary part is discarded. If two poles are farther apart than @var{tol} they are distinct. For example, @example + @group b = [1, 1, 1]; + a = [1, -5, 8, -4]; ! [r, p, k, e] = residue (b, a); ! @result{} r = [-2, 7, 3] ! @result{} p = [2, 2, 1] ! @result{} k = [](0x0) ! @result{} e = [1, 2, 1] ! @end group @end example @noindent diff -cNr octave-2.0.2/doc/interpreter/preface.texi octave-2.0.3/doc/interpreter/preface.texi *** octave-2.0.2/doc/interpreter/preface.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/preface.texi Tue Feb 18 01:43:39 1997 *************** *** 1,10 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. @node Preface, Introduction, Top, Top @unnumbered Preface - @cindex acknowledgements @cindex contributors @cindex history --- 1,9 ---- ! @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 Preface, Introduction, Top, Top @unnumbered Preface @cindex contributors @cindex history *************** *** 48,53 **** --- 47,62 ---- Octave more useful by writing and contributing additional functions for it, and by reporting any problems you may have. + @menu + * Acknowledgements:: + * How You Can Contribute to Octave:: + * Distribution:: + @end menu + + @node Acknowledgements, How You Can Contribute to Octave, Preface, Preface + @unnumberedsec Acknowledgements + @cindex acknowledgements + Many people have already contributed to Octave's development. In addition to John W. Eaton, the following people have helped write parts of Octave or helped out in various other ways. *************** *** 57,151 **** @itemize @bullet @item ! Thomas Baier (baier@@ci.tuwien.ac.at) wrote the original versions of ! @code{popen}, @code{pclose}, @code{execute}, @code{sync_system}, and @code{async_system}. @item ! Karl Berry (karl@@cs.umb.edu) wrote the @code{kpathsea} library that ! allows Octave to recursively search directory paths for function and ! script files. @item ! Georg Beyerle (gbeyerle@@awi-potsdam.de) contributed code to save values ! in @sc{Matlab}'s @file{.mat}-file format, and has provided many useful bug ! reports and suggestions. @item ! John Campbell (jcc@@bevo.che.wisc.edu) wrote most of the file and C-style input and output functions. @item ! Brian Fox (bfox@@gnu.ai.mit.edu) wrote the @code{readline} library used ! for command history editing, and the portion of this manual that documents it. @item ! Klaus Gebhardt ported ! Octave to OS/2 and worked with Michel Juillard ! on the port to DOS. @item ! A. Scottedward Hodel (scotte@@eng.auburn.edu) contributed a number of functions including @code{expm}, @code{qzval}, @code{qzhess}, @code{syl}, @code{lyap}, and @code{balance}. @item ! Kurt Hornik (Kurt.Hornik@@ci.tuwien.ac.at) provided the @code{corrcoef}, ! @code{cov}, @code{fftconv}, @code{fftfilt}, @code{gcd}, @code{lcd}, ! @code{kurtosis}, @code{null}, @code{orth}, @code{poly}, @code{polyfit}, ! @code{roots}, and @code{skewness} functions, supplied documentation for ! these and numerous other functions, rewrote the Emacs mode for editing ! Octave code and provided its documentation, and has helped tremendously ! with testing. He has also been a constant source of new ideas for ! improving Octave. @item ! Phil Johnson (johnsonp@@nicco.sscnet.ucla.edu) has helped to make Linux ! releases available. @item ! Michel Juillard ported Octave to DOS systems. @item ! Friedrich Leisch (leisch@@ci.tuwien.ac.at) provided the @code{mahalanobis} function. @item ! Ken Neighbors (wkn@@leland.stanford.edu) has provided many useful bug ! reports and comments on @sc{Matlab} compatibility. @item ! Rick Niles (niles@@axp745.gsfc.nasa.gov) rewrote Octave's plotting functions to add line styles and the ability to specify an unlimited ! number of lines in a single call. He also continues to track down ! odd incompatibilities and bugs. @item ! Mark Odegard (meo@@sugarland.unocal.com) provided the initial implementation of @code{fread}, @code{fwrite}, @code{feof}, and @code{ferror}. @item ! Tony Richardson (tony@@guts.biomed.uakron.edu) wrote Octave's image ! processing functions as well as most of the original polynomial functions. @item ! R. Bruce Tenison (Bruce.Tenison@@eng.auburn.edu) wrote the @code{hess} and ! @code{schur} functions. @item ! Teresa Twaroch (twaroch@@ci.tuwien.ac.at) provided the functions @code{gls} and @code{ols}. @item ! Andreas Weingessel (Andreas.Weingessel@@ci.tuwien.ac.at) wrote the audio functions @code{lin2mu}, @code{loadaudio}, @code{mu2lin}, @code{playaudio}, @code{record}, @code{saveaudio}, and @code{setaudio}. @item ! Fook Fah Yap (ffy@@eng.cam.ac.uk) provided the @code{fft} and @code{ifft} functions and valuable bug reports for early versions. @end itemize --- 66,161 ---- @itemize @bullet @item ! Thomas Baier @email{baier@@ci.tuwien.ac.at} wrote the original versions ! of @code{popen}, @code{pclose}, @code{execute}, @code{sync_system}, and @code{async_system}. @item ! Karl Berry @email{karl@@cs.umb.edu} wrote the @code{kpathsea} library ! that allows Octave to recursively search directory paths for function ! and script files. @item ! Georg Beyerle @email{gbeyerle@@awi-potsdam.de} contributed code to save ! values in @sc{Matlab}'s @file{.mat}-file format, and has provided many ! useful bug reports and suggestions. @item ! John Campbell @email{jcc@@bevo.che.wisc.edu} wrote most of the file and C-style input and output functions. @item ! Brian Fox @email{bfox@@gnu.ai.mit.edu} wrote the @code{readline} library ! used for command history editing, and the portion of this manual that documents it. @item ! Klaus Gebhardt @email{gebhardt@@crunch.ikp.physik.th-darmstadt.de} ! ported Octave to OS/2 and worked with Michel Juillard ! @email{juillard@@msh-paris.fr} on the port to DOS. @item ! A. Scottedward Hodel @email{A.S.Hodel@@eng.auburn.edu} contributed a number of functions including @code{expm}, @code{qzval}, @code{qzhess}, @code{syl}, @code{lyap}, and @code{balance}. @item ! Kurt Hornik @email{Kurt.Hornik@@ci.tuwien.ac.at} provided the ! @code{corrcoef}, @code{cov}, @code{fftconv}, @code{fftfilt}, @code{gcd}, ! @code{lcd}, @code{kurtosis}, @code{null}, @code{orth}, @code{poly}, ! @code{polyfit}, @code{roots}, and @code{skewness} functions, supplied ! documentation for these and numerous other functions, rewrote the Emacs ! mode for editing Octave code and provided its documentation, and has ! helped tremendously with testing. He has also been a constant source of ! new ideas for improving Octave. @item ! Phil Johnson @email{johnsonp@@nicco.sscnet.ucla.edu} has helped to make ! Linux releases available. @item ! Michel Juillard @email{juillard@@msh-paris.fr} ported Octave to DOS ! systems. @item ! Friedrich Leisch @email{leisch@@ci.tuwien.ac.at} provided the @code{mahalanobis} function. @item ! Ken Neighbors @email{wkn@@leland.stanford.edu} has provided many useful ! bug reports and comments on @sc{Matlab} compatibility. @item ! Rick Niles @email{niles@@axp745.gsfc.nasa.gov} rewrote Octave's plotting functions to add line styles and the ability to specify an unlimited ! number of lines in a single call. He also continues to track down odd ! incompatibilities and bugs. @item ! Mark Odegard @email{meo@@sugarland.unocal.com} provided the initial implementation of @code{fread}, @code{fwrite}, @code{feof}, and @code{ferror}. @item ! Tony Richardson @email{tony@@guts.biomed.uakron.edu} wrote Octave's ! image processing functions as well as most of the original polynomial functions. @item ! R. Bruce Tenison @email{Bruce.Tenison@@eng.auburn.edu} wrote the ! @code{hess} and @code{schur} functions. @item ! Teresa Twaroch @email{twaroch@@ci.tuwien.ac.at} provided the functions @code{gls} and @code{ols}. @item ! Andreas Weingessel @email{Andreas.Weingessel@@ci.tuwien.ac.at} wrote the audio functions @code{lin2mu}, @code{loadaudio}, @code{mu2lin}, @code{playaudio}, @code{record}, @code{saveaudio}, and @code{setaudio}. @item ! Fook Fah Yap @email{ffy@@eng.cam.ac.uk} provided the @code{fft} and @code{ifft} functions and valuable bug reports for early versions. @end itemize *************** *** 188,197 **** Richard Stallman, for writing GNU. @end itemize - Portions of this document have been adapted from the @code{gawk}, - @code{readline}, @code{gcc}, and C library manuals, published by the Free - Software Foundation, 59 Temple Place---Suite 330, Boston, MA - 02111--1307, USA. - This project would not have been possible without the GNU software used in and used to produce Octave. --- 198,250 ---- Richard Stallman, for writing GNU. @end itemize This project would not have been possible without the GNU software used in and used to produce Octave. + + @node How You Can Contribute to Octave, Distribution, Acknowledgements, Preface + @unnumberedsec How You Can Contribute to Octave + @cindex contributing to Octave + @cindex funding Octave development + + There are a number of ways that you can contribute to help make Octave a + better system. Perhaps the most important way to contribute is to write + high-quality code for solving new problems, and to make your code freely + available for others to use. + + If you find Octave useful, consider providing additional funding to + continue its development. Even a modest amount of additional funding + could make a significant difference in the amount of time that is + available for development and support. + + If you cannot provide funding or contribute code, you can still help + make Octave better and more reliable by reporting any bugs you find and + by offering suggestions for ways to improve Octave. @xref{Trouble}, for + tips on how to write useful bug reports. + + @node Distribution, , How You Can Contribute to Octave, Preface + @unnumberedsec Distribution + @cindex distribution of Octave + + Octave is @dfn{free} software. This means that everyone is free to + use it and free to redistribute it on certain conditions. Octave is not + in the public domain. It is copyrighted and there are restrictions on + its distribution, but the restrictions are designed to ensure that + others will have the same freedom to use and redistribute Octave that + you have. The precise conditions can be found in the GNU General Public + License that comes with Octave and that also appears in @ref{Copying}. + + Octave is available on CD-ROM with various collections of other free + software, and from the Free Software Foundation. Ordering a copy of + Octave from the Free Software Foundation helps to fund the development + of more free software. For more information, write to + + @quotation + Free Software Foundation@* + 59 Temple Place---Suite 330@* + Boston, MA 02111--1307@* + USA + @end quotation + + Octave is also available on the Internet from + @url{ftp://ftp.che.wisc.edu/pub/octave}, and additional information is + available from @url{http://www.che.wisc.edu/octave}. diff -cNr octave-2.0.2/doc/interpreter/quad.texi octave-2.0.3/doc/interpreter/quad.texi *** octave-2.0.2/doc/interpreter/quad.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/quad.texi Mon Feb 17 16:41:01 1997 *************** *** 1,19 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Quadrature, Control Theory, Optimization, Top @chapter Quadrature @menu ! * Functions of one Variable:: * Orthogonal Collocation:: @end menu ! @node Functions of one Variable, Orthogonal Collocation, Quadrature, Quadrature ! @section Functions of one Variable ! @deftypefn {Loadable Function} {[@var{v}, @var{ier}, @var{nfun}] =} quad (@var{f}, @var{a}, @var{b}, @var{tol}, @var{sing}) Integrate a nonlinear function of one variable using Quadpack. The first argument is the name of the function to call to compute the value of the integrand. It must have the form --- 1,19 ---- ! @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 Quadrature, Differential Equations, Nonlinear Equations, Top @chapter Quadrature @menu ! * Functions of One Variable:: * Orthogonal Collocation:: @end menu ! @node Functions of One Variable, Orthogonal Collocation, Quadrature, Quadrature ! @section Functions of One Variable ! @deftypefn {Loadable Function} {[@var{v}, @var{ier}, @var{nfun}, @var{err}] =} quad (@var{f}, @var{a}, @var{b}, @var{tol}, @var{sing}) Integrate a nonlinear function of one variable using Quadpack. The first argument is the name of the function to call to compute the value of the integrand. It must have the form *************** *** 37,42 **** --- 37,48 ---- The optional argument @var{sing} is a vector of values at which the integrand is known to be singular. + + The result of the integration is returned in @var{v} and @var{ier} + contains an integer error code (0 indicates a successful integration). + The value of @var{nfun} indicates how many function evaluations were + required, and @var{err} contains an estimate of the error in the + solution. @end deftypefn @deftypefn {Loadable Function} {} quad_options (@var{opt}, @var{val}) *************** *** 47,53 **** their current values are displayed. @end deftypefn ! @node Orthogonal Collocation, , Functions of one Variable, Quadrature @section Orthogonal Collocation @deftypefn {Loadable Function} {[@var{r}, @var{A}, @var{B}, @var{q}] =} colloc (@var{n}, "left", "right") --- 53,116 ---- their current values are displayed. @end deftypefn ! Here is an example of using @code{quad} to integrate the function ! @iftex ! @tex ! $$ ! f(x) = x \sin (1/x) \sqrt {|1 - x|} ! $$ ! from $x = 0$ to $x = 3$. ! @end tex ! @end iftex ! @ifinfo ! ! @example ! @var{f}(@var{x}) = @var{x} * sin (1/@var{x}) * sqrt (abs (1 - @var{x})) ! @end example ! ! @noindent ! from @var{x} = 0 to @var{x} = 3. ! @end ifinfo ! ! This is a fairly difficult integration (plot the function over the range ! of integration to see why). ! ! The first step is to define the function: ! ! @example ! @group ! function y = f (x) ! y = x .* sin (1 ./ x) .* sqrt (abs (1 - x)); ! endfunction ! @end group ! @end example ! ! Note the use of the `dot' forms of the operators. This is not necessary ! for the call to @code{quad}, but it makes it much easier to generate a ! set of points for plotting (because it makes it possible to call the ! function with a vector argument to produce a vector result). ! ! Then we simply call quad: ! ! @example ! @group ! [v, ier, nfun, err] = quad ("f", 0, 3) ! ! @result{} 1.9819 ! ! @result{} 1 ! ! @result{} 5061 ! ! @result{} 1.1522e-07 ! @end group ! @end example ! ! Although @code{quad} returns a nonzero value for @var{ier}, the result ! is reasonably accurate (to see why, examine what happens to the result ! if you move the lower bound to 0.1, then 0.01, then 0.001, etc.). ! ! @node Orthogonal Collocation, , Functions of One Variable, Quadrature @section Orthogonal Collocation @deftypefn {Loadable Function} {[@var{r}, @var{A}, @var{B}, @var{q}] =} colloc (@var{n}, "left", "right") *************** *** 56,58 **** --- 119,164 ---- M. L. Michelsen, @cite{Solution of Differential Equation Models by Polynomial Approximation}. @end deftypefn + + Here is an example of using @code{colloc} to generate weight matrices + for solving the second order differential equation + @iftex + @tex + $u^\prime - \alpha u^{\prime\prime} = 0$ with the boundary conditions + $u(0) = 0$ and $u(1) = 1$. + @end tex + @end iftex + @ifinfo + @var{u}' - @var{alpha} * @var{u}'' = 0 with the boundary conditions + @var{u}(0) = 0 and @var{u}(1) = 1. + @end ifinfo + + First, we can generate the weight matrices for @var{n} points (including + the endpoints of the interval), and incorporate the boundary conditions + in the right hand side (for a specific value of + @iftex + @tex + $\alpha$). + @end tex + @end iftex + @ifinfo + @var{alpha}). + @end ifinfo + + @example + @group + n = 7; + alpha = 0.1; + [r, a, b] = colloc (n-2, "left", "right"); + at = a(2:n-1,2:n-1); + bt = b(2:n-1,2:n-1); + rhs = alpha * b(2:n-1,n) - a(2:n-1,n); + @end group + @end example + + Then the solution at the roots @var{r} is + + @example + u = [ 0; (at - alpha * bt) \ rhs; 1] + @result{} [ 0.00; 0.004; 0.01 0.00; 0.12; 0.62; 1.00 ] + @end example diff -cNr octave-2.0.2/doc/interpreter/set.texi octave-2.0.3/doc/interpreter/set.texi *** octave-2.0.2/doc/interpreter/set.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/set.texi Mon Feb 17 00:08:40 1997 *************** *** 1,8 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Sets, Statistics, Signal Processing, Top @chapter Sets Octave has a limited set of functions for managing sets of data, where a --- 1,8 ---- ! @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 Sets, Polynomial Manipulations, Statistics, Top @chapter Sets Octave has a limited set of functions for managing sets of data, where a *************** *** 14,27 **** order. For example, @example create_set ([ 1, 2; 3, 4; 4, 2 ]) ! @end example ! ! @noindent ! returns the vector ! ! @example ! [ 1, 2, 3, 4 ] @end example @end deftypefn --- 14,23 ---- order. For example, @example + @group create_set ([ 1, 2; 3, 4; 4, 2 ]) ! @result{} [ 1, 2, 3, 4 ] ! @end group @end example @end deftypefn *************** *** 30,48 **** @var{y}. For example, @example union ([ 1, 2, 3 ], [ 2, 3, 5 ]) ! @end example ! ! @noindent ! returns the vector ! ! @example ! [ 1, 2, 5 ] @end example @end deftypefn @deftypefn {Function File} {} intersection (@var{x}, @var{y}) Return the set of elements that are in both sets @var{x} and @var{y}. @end deftypefn @deftypefn {Function File} {} complement (@var{x}, @var{y}) --- 26,48 ---- @var{y}. For example, @example + @group union ([ 1, 2, 3 ], [ 2, 3, 5 ]) ! @result{} [ 1, 2, 5 ] ! @end group @end example @end deftypefn @deftypefn {Function File} {} intersection (@var{x}, @var{y}) Return the set of elements that are in both sets @var{x} and @var{y}. + For example, + + @example + @group + intersection ([ 1, 2, 3 ], [ 2, 3, 5 ]) + @result{} [ 2, 3 ] + @end group + @end example @end deftypefn @deftypefn {Function File} {} complement (@var{x}, @var{y}) *************** *** 50,58 **** example, @example complement ([ 1, 2, 3 ], [ 2, 3, 5 ]) @end example - - @noindent - returns the value @samp{5}. @end deftypefn --- 50,58 ---- example, @example + @group complement ([ 1, 2, 3 ], [ 2, 3, 5 ]) + @result{} 5 + @end group @end example @end deftypefn diff -cNr octave-2.0.2/doc/interpreter/signal.texi octave-2.0.3/doc/interpreter/signal.texi *** octave-2.0.2/doc/interpreter/signal.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/signal.texi Mon Feb 17 00:47:35 1997 *************** *** 1,13 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Signal Processing, Sets, Control Theory, Top @chapter Signal Processing I hope that someday Octave will include more signal processing functions. If you would like to help improve Octave in this area, ! please contact @code{bug-octave@@bevo.che.wisc.edu}. @deftypefn {Function File} {} detrend (@var{x}, @var{p}) If @var{x} is a vector, @code{detrend (@var{x}, @var{p})} removes the --- 1,13 ---- ! @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 Signal Processing, Image Processing, Control Theory, Top @chapter Signal Processing I hope that someday Octave will include more signal processing functions. If you would like to help improve Octave in this area, ! please contact @email{bug-octave@@bevo.che.wisc.edu}. @deftypefn {Function File} {} detrend (@var{x}, @var{p}) If @var{x} is a vector, @code{detrend (@var{x}, @var{p})} removes the *************** *** 20,27 **** is assumed. This corresponds to removing a linear trend. @end deftypefn ! @deftypefn {Function} {} fft (@var{a} [, @var{n}]) ! Compute the FFT of @var{a} using subroutines from FFTPACK. If @var{a} is a matrix, @code{fft} computes the FFT for each column of @var{a}. If called with two arguments, @var{n} is expected to be an integer --- 20,27 ---- is assumed. This corresponds to removing a linear trend. @end deftypefn ! @deftypefn {Function} {} fft (@var{a}, @var{n}) ! Compute the FFT of @var{a} using subroutines from @sc{Fftpack}. If @var{a} is a matrix, @code{fft} computes the FFT for each column of @var{a}. If called with two arguments, @var{n} is expected to be an integer *************** *** 31,38 **** padded with zeros. @end deftypefn ! @deftypefn {Loadable Function} {} ifft (@var{a} [, @var{n}]) ! Compute the inverse FFT of @var{a} using subroutines from FFTPACK. If @var{a} is a matrix, @code{fft} computes the inverse FFT for each column of @var{a}. --- 31,38 ---- padded with zeros. @end deftypefn ! @deftypefn {Loadable Function} {} ifft (@var{a}, @var{n}) ! Compute the inverse FFT of @var{a} using subroutines from @sc{Fftpack}. If @var{a} is a matrix, @code{fft} computes the inverse FFT for each column of @var{a}. *************** *** 43,49 **** padded with zeros. @end deftypefn ! @deftypefn {Loadable Function} {} fft2 (@var{a} [, @var{n} [, @var{m}]]) Compute the two dimensional FFT of @var{a}. The optional arguments @var{n} and @var{m} may be used specify the --- 43,49 ---- padded with zeros. @end deftypefn ! @deftypefn {Loadable Function} {} fft2 (@var{a}, @var{n}, @var{m}) Compute the two dimensional FFT of @var{a}. The optional arguments @var{n} and @var{m} may be used specify the *************** *** 52,58 **** zeros. @end deftypefn ! @deftypefn {Loadable Function} {} ifft2 (@var{a} [, @var{n} [, @var{m}]]) Compute the two dimensional inverse FFT of @var{a}. The optional arguments @var{n} and @var{m} may be used specify the --- 52,58 ---- zeros. @end deftypefn ! @deftypefn {Loadable Function} {} ifft2 (@var{a}, @var{n}, @var{m}) Compute the two dimensional inverse FFT of @var{a}. The optional arguments @var{n} and @var{m} may be used specify the *************** *** 61,67 **** zeros. @end deftypefn ! @deftypefn {Built-in Function} {} fftconv (@var{a}, @var{b}, @var{N}) This function returns the convolution of the vectors @var{a} and @var{b}, a vector with length equal to the @code{length (a) + length (b) - 1}. If @var{a} and @var{b} are the coefficient vectors of two --- 61,67 ---- zeros. @end deftypefn ! @deftypefn {Built-in Function} {} fftconv (@var{a}, @var{b}, @var{n}) This function returns the convolution of the vectors @var{a} and @var{b}, a vector with length equal to the @code{length (a) + length (b) - 1}. If @var{a} and @var{b} are the coefficient vectors of two *************** *** 69,83 **** polynomial. The computation uses the FFT by calling the function @code{fftfilt}. If ! the optional argument @var{N} is specified, an N-point FFT is used. @end deftypefn ! @deftypefn {Function File} {} fftfilt (@var{b}, @var{x}, @var{N}) With two arguments, @code{fftfilt} filters @var{x} with the FIR filter @var{b} using the FFT. ! Given the optional third argument, @var{N}, @code{fftfilt} uses the overlap-add method to filter @var{x} with @var{b} using an N-point FFT. @end deftypefn --- 69,83 ---- polynomial. The computation uses the FFT by calling the function @code{fftfilt}. If ! the optional argument @var{n} is specified, an N-point FFT is used. @end deftypefn ! @deftypefn {Function File} {} fftfilt (@var{b}, @var{x}, @var{n}) With two arguments, @code{fftfilt} filters @var{x} with the FIR filter @var{b} using the FFT. ! Given the optional third argument, @var{n}, @code{fftfilt} uses the overlap-add method to filter @var{x} with @var{b} using an N-point FFT. @end deftypefn *************** *** 146,152 **** @iftex @tex $$ ! H(z) = {\sum_{k=0}^M d_{k+1} z^{-k} \over 1 + \sum_{k+1}^N c_{k+1} z^{-k}} $$ @end tex @end iftex --- 146,153 ---- @iftex @tex $$ ! H(z) = {\displaystyle\sum_{k=0}^M d_{k+1} z^{-k} ! \over 1 + \displaystyle\sum_{k+1}^N c_{k+1} z^{-k}} $$ @end tex @end iftex *************** *** 173,220 **** all zeros. @end deftypefn ! @deftypefn {Function File} {} freqz ! Compute the frequency response of a filter. ! ! @code{[@var{h}, @var{w}] = freqz (@var{b})} returns the complex frequency ! response @var{h} of the FIR filter with coefficients @var{b}. The ! response is evaluated at 512 angular frequencies between 0 and @ifinfo ! pi. @end ifinfo @iftex @tex ! $\pi$. @end tex @end iftex @noindent ! The output value @var{w} is a vector containing the 512 frequencies. ! ! @code{[@var{h}, @var{w}] = freqz (@var{b}, @var{a})} returns the complex ! frequency response of the rational IIR filter whose numerator has ! coefficients @var{b} and denominator coefficients @var{a}. ! ! ! @code{[@var{h}, @var{w}] = freqz (@var{b}, @var{a}, @var{n})} returns the ! response evaluated at @var{n} angular frequencies. For fastest ! computation n should factor into a small number of small primes. ! ! @code{[@var{h}, @var{w}] = freqz (@var{b}, @var{a}, @var{n}, "whole")} ! evaluates the response at n frequencies between 0 and @ifinfo ! 2*pi. @end ifinfo @iftex @tex ! $2\pi$. @end tex @end iftex @end deftypefn @deftypefn {Function File} {} sinc (@var{x}) ! Returns @iftex @tex $ \sin (\pi x)/(\pi x)$. --- 174,218 ---- all zeros. @end deftypefn ! @deftypefn {Function File} {[@var{h}, @var{w}] =} freqz (@var{b}, @var{a}, @var{n}, "whole") ! Return the complex frequency response @var{h} of the rational IIR filter ! whose numerator and denominator coefficients are @var{b} and @var{a}, ! respectively. The response is evaluated at @var{n} angular frequencies ! between 0 and @ifinfo ! 2*pi. @end ifinfo @iftex @tex ! $2\pi$. @end tex @end iftex @noindent ! The output value @var{w} is a vector of the frequencies. ! If the fourth argument is omitted, the response is evaluated at ! frequencies between 0 and @ifinfo ! pi. @end ifinfo @iftex @tex ! $\pi$. @end tex @end iftex + + If @var{n} is omitted, a value of 512 is assumed. + + If @var{a} is omitted, the denominator is assumed to be 1 (this + corresponds to a simple FIR filter). + + For fastest computation, @var{n} should factor into a small number of + small primes. @end deftypefn @deftypefn {Function File} {} sinc (@var{x}) ! Return @iftex @tex $ \sin (\pi x)/(\pi x)$. diff -cNr octave-2.0.2/doc/interpreter/stats.texi octave-2.0.3/doc/interpreter/stats.texi *** octave-2.0.2/doc/interpreter/stats.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/stats.texi Mon Feb 17 00:47:29 1997 *************** *** 1,13 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Statistics, Plotting, Sets, Top @chapter Statistics I hope that someday Octave will include more statistics functions. If you would like to help improve Octave in this area, please contact ! @code{bug-octave@@bevo.che.wisc.edu}. @deftypefn {Function File} {} mean (@var{x}) If @var{x} is a vector, compute the mean of the elements of @var{x} --- 1,13 ---- ! @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 Statistics, Sets, Optimization, Top @chapter Statistics I hope that someday Octave will include more statistics functions. If you would like to help improve Octave in this area, please contact ! @email{bug-octave@@bevo.che.wisc.edu}. @deftypefn {Function File} {} mean (@var{x}) If @var{x} is a vector, compute the mean of the elements of @var{x} diff -cNr octave-2.0.2/doc/interpreter/stmt.texi octave-2.0.3/doc/interpreter/stmt.texi *** octave-2.0.2/doc/interpreter/stmt.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/stmt.texi Tue Feb 18 01:49:07 1997 *************** *** 1,8 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Statements, Functions and Scripts, Expressions, Top @chapter Statements @cindex statements --- 1,8 ---- ! @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 Statements, Functions and Scripts, Evaluation, Top @chapter Statements @cindex statements *************** *** 127,133 **** @var{body} is executed. If none of the conditions are true and the @code{else} clause is present, its body is executed. Only one @code{else} clause may appear, and it must be the last part of the ! satement. In the following example, if the first condition is true (that is, the value of @code{x} is divisible by 2), then the first @code{printf} --- 127,133 ---- @var{body} is executed. If none of the conditions are true and the @code{else} clause is present, its body is executed. Only one @code{else} clause may appear, and it must be the last part of the ! statement. In the following example, if the first condition is true (that is, the value of @code{x} is divisible by 2), then the first @code{printf} *************** *** 268,275 **** with the condition in an @code{if} statement, the condition in a @code{while} statement is considered true if its value is non-zero, and false if its value is zero. If the value of the conditional expression ! in an @code{if} statement is a vector or a matrix, it is considered true ! only if @emph{all} of the elements are non-zero. Octave's @code{while} statement looks like this: --- 268,275 ---- with the condition in an @code{if} statement, the condition in a @code{while} statement is considered true if its value is non-zero, and false if its value is zero. If the value of the conditional expression ! in a @code{while} statement is a vector or a matrix, it is considered ! true only if @emph{all} of the elements are non-zero. Octave's @code{while} statement looks like this: *************** *** 293,300 **** @var{condition} is no longer true. If @var{condition} is initially false, the body of the loop is never executed. ! This example creates a variable @code{fib} that contains the elements of ! the Fibonacci sequence. @example @group --- 293,300 ---- @var{condition} is no longer true. If @var{condition} is initially false, the body of the loop is never executed. ! This example creates a variable @code{fib} that contains the first ten ! elements of the Fibonacci sequence. @example @group *************** *** 351,358 **** The assignment expression in the @code{for} statement works a bit differently than Octave's normal assignment statement. Instead of assigning the complete result of the expression, it assigns each column ! of the expression to @var{var} in turn. If @var{expression} is either ! a row vector or a scalar, the value of @var{var} will be a scalar each time the loop body is executed. If @var{var} is a column vector or a matrix, @var{var} will be a column vector each time the loop body is executed. --- 351,358 ---- The assignment expression in the @code{for} statement works a bit differently than Octave's normal assignment statement. Instead of assigning the complete result of the expression, it assigns each column ! of the expression to @var{var} in turn. If @var{expression} is a range, ! a row vector, or a scalar, the value of @var{var} will be a scalar each time the loop body is executed. If @var{var} is a column vector or a matrix, @var{var} will be a column vector each time the loop body is executed. *************** *** 371,377 **** @end example @noindent ! This code works by first evaluating the expression @samp{3:10}, to produce a range of values from 3 to 10 inclusive. Then the variable @code{i} is assigned the first element of the range and the body of the loop is executed once. When the end of the loop body is reached, the --- 371,377 ---- @end example @noindent ! This code works by first evaluating the expression @code{3:10}, to produce a range of values from 3 to 10 inclusive. Then the variable @code{i} is assigned the first element of the range and the body of the loop is executed once. When the end of the loop body is reached, the *************** *** 414,438 **** @example @group ! octave:1> x.a = 1; x.b = [1, 2; 3, 4]; x.c = "string"; ! octave:2> for [val, key] = x; key, val, endfor ! @end group ! @end example ! ! @noindent will print ! ! @example ! @group ! key = a ! val = 1 ! key = b ! val = ! ! 1 2 ! 3 4 ! key = c ! val = string @end group @end example --- 414,437 ---- @example @group ! x.a = 1 ! x.b = [1, 2; 3, 4] ! x.c = "string" ! for [val, key] = x ! key ! val ! endfor ! @print{} key = a ! @print{} val = 1 ! @print{} key = b ! @print{} val = ! @print{} ! @print{} 1 2 ! @print{} 3 4 ! @print{} ! @print{} key = c ! @print{} val = string @end group @end example *************** *** 629,635 **** as @code{eval (@var{try}, @var{catch})} (which may now also use @code{__error_text__}) but it is more efficient since the commands do not need to be parsed each time the @var{try} and @var{catch} statements ! are evaluated. Octave's @var{try} block is a very limited variation on the Lisp condition-case form (limited because it cannot handle different classes --- 628,635 ---- as @code{eval (@var{try}, @var{catch})} (which may now also use @code{__error_text__}) but it is more efficient since the commands do not need to be parsed each time the @var{try} and @var{catch} statements ! are evaluated. @xref{Error Handling}, for more information about the ! @code{__error_text__} variable. Octave's @var{try} block is a very limited variation on the Lisp condition-case form (limited because it cannot handle different classes *************** *** 670,698 **** @example @group ! x = long_variable_name ... % comment one ! + longer_variable_name \ % comment two ! - 42 % last comment @end group @end example @noindent ! is equivalent to the one shown above. ! In some cases, Octave will allow you to continue lines without having to ! specify continuation characters. For example, it is possible to write ! statements like @example @group ! if (big_long_variable_name == other_long_variable_name ! || not_so_short_variable_name > 4 ! && y > x) ! some (code, here); endif @end group @end example @noindent ! without having to clutter up the if statement with continuation ! characters. --- 670,699 ---- @example @group ! x = long_variable_name ... # comment one ! + longer_variable_name \ # comment two ! - 42 # last comment @end group @end example @noindent ! is equivalent to the one shown above. Inside string constants, the ! continuation marker must appear at the end of the line just before the ! newline character. ! Input that occurs inside parentheses can be continued to the next line ! without having to use a continuation marker. For example, it is ! possible to write statements like @example @group ! if (fine_dining_destination == on_a_boat ! || fine_dining_destination == on_a_train) ! suess (i, will, not, eat, them, sam, i, am, i, ! will, not, eat, green, eggs, and, ham); endif @end group @end example @noindent ! without having to add to the clutter with continuation markers. diff -cNr octave-2.0.2/doc/interpreter/strings.texi octave-2.0.3/doc/interpreter/strings.texi *** octave-2.0.2/doc/interpreter/strings.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/strings.texi Tue Feb 18 01:47:05 1997 *************** *** 1,18 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. @cindex strings ! @node String Functions, System Utilities, Matrix Manipulation, Top ! @chapter String Functions ! @deftypefn {Function File} {} strcmp (@var{s1}, @var{s2}) ! Compares two strings, returning 1 if they are the same, and 0 otherwise. ! @strong{Note: For compatibility with @sc{Matlab}, Octave's strcmp ! function returns 1 if the strings are equal, and 0 otherwise. This is ! just the opposite of the corresponding C library function.} @end deftypefn @deftypefn {Function File} {} int2str (@var{n}) --- 1,129 ---- ! @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 Strings, Data Structures, Numeric Data Types, Top + @chapter Strings @cindex strings + @cindex character strings + @opindex " + @opindex ' + + A @dfn{string constant} consists of a sequence of characters enclosed in + either double-quote or single-quote marks. For example, both of the + following expressions ! @example ! @group ! "parrot" ! 'parrot' ! @end group ! @end example ! @noindent ! represent the string whose contents are @samp{parrot}. Strings in ! Octave can be of any length. ! Since the single-quote mark is also used for the transpose operator ! (@pxref{Arithmetic Ops}) but double-quote marks have no other purpose in ! Octave, it is best to use double-quote marks to denote strings. ! ! @c XXX FIXME XXX -- this is probably pretty confusing. ! ! @cindex escape sequence notation ! Some characters cannot be included literally in a string constant. You ! represent them instead with @dfn{escape sequences}, which are character ! sequences beginning with a backslash (@samp{\}). ! ! One use of an escape sequence is to include a double-quote ! (single-quote) character in a string constant that has been defined ! using double-quote (single-quote) marks. Since a plain double-quote ! would end the string, you must use @samp{\"} to represent a single ! double-quote character as a part of the string. The backslash character ! itself is another character that cannot be included normally. You must ! write @samp{\\} to put one backslash in the string. Thus, the string ! whose contents are the two characters @samp{"\} may be written ! @code{"\"\\"} or @code{'"\\'}. Similarly, the string whose contents are ! the two characters @samp{'\} may be written @code{'\'\\'} or @code{"'\\"}. ! ! Another use of backslash is to represent unprintable characters ! such as newline. While there is nothing to stop you from writing most ! of these characters directly in a string constant, they may look ugly. ! ! Here is a table of all the escape sequences used in Octave. They are ! the same as those used in the C programming language. ! ! @table @code ! @item \\ ! Represents a literal backslash, @samp{\}. ! ! @item \" ! Represents a literal double-quote character, @samp{"}. ! ! @item \' ! Represents a literal single-quote character, @samp{'}. ! ! @item \a ! Represents the ``alert'' character, control-g, ASCII code 7. ! ! @item \b ! Represents a backspace, control-h, ASCII code 8. ! ! @item \f ! Represents a formfeed, control-l, ASCII code 12. ! ! @item \n ! Represents a newline, control-j, ASCII code 10. ! ! @item \r ! Represents a carriage return, control-m, ASCII code 13. ! ! @item \t ! Represents a horizontal tab, control-i, ASCII code 9. ! ! @item \v ! Represents a vertical tab, control-k, ASCII code 11. ! ! @c We don't do octal or hex this way yet. ! @c ! @c @item \@var{nnn} ! @c Represents the octal value @var{nnn}, where @var{nnn} are one to three ! @c digits between 0 and 7. For example, the code for the ASCII ESC ! @c (escape) character is @samp{\033}.@refill ! @c ! @c @item \x@var{hh}@dots{} ! @c Represents the hexadecimal value @var{hh}, where @var{hh} are hexadecimal ! @c digits (@samp{0} through @samp{9} and either @samp{A} through @samp{F} or ! @c @samp{a} through @samp{f}). Like the same construct in @sc{ansi} C, ! @c the escape ! @c sequence continues until the first non-hexadecimal digit is seen. However, ! @c using more than two hexadecimal digits produces undefined results. (The ! @c @samp{\x} escape sequence is not allowed in @sc{posix} @code{awk}.)@refill ! @end table ! ! Strings may be concatenated using the notation for defining matrices. ! For example, the expression ! ! @example ! [ "foo" , "bar" , "baz" ] ! @end example ! ! @noindent ! produces the string whose contents are @samp{foobarbaz}. @xref{Numeric ! Data Types} for more information about creating matrices. ! ! @menu ! * Creating Strings:: ! * Searching and Replacing:: ! * String Conversions:: ! * Character Class Functions:: ! @end menu ! ! @node Creating Strings, Searching and Replacing, Strings, Strings ! @section Creating Strings ! ! @deftypefn {Function File} {} blanks (@var{n}) ! Returns a string of @var{n} blanks. @end deftypefn @deftypefn {Function File} {} int2str (@var{n}) *************** *** 28,161 **** character. For example, @example setstr ([97, 98, 99]) ! @end example ! ! @noindent ! creates the string ! ! @example ! abc @end example @end deftypefn ! @defvr {Built-in Variable} implicit_str_to_num_ok ! If the value of @code{implicit_str_to_num_ok} is nonzero, implicit ! conversions of strings to their numeric ASCII equivalents are allowed. ! Otherwise, an error message is printed and control is returned to the ! top level. The default value is 0. ! @end defvr ! ! @deftypefn {Built-in Function} {} undo_string_escapes (@var{s}) ! Converts special characters in strings back to their escaped forms. For ! example, the expression @example ! bell = "\a"; ! @end example ! ! @noindent ! assigns the value of the alert character (control-g, ASCII code 7) to ! the string variable @var{bell}. If this string is printed, the ! system will ring the terminal bell (if it is possible). This is ! normally the desired outcome. However, sometimes it is useful to be ! able to print the original representation of the string, with the ! special characters replaced by their escape sequences. For example, ! @example ! octave:13> undo_string_escapes (bell) ! ans = \a @end example - - @noindent - replaces the unprintable alert character with its printable - representation. @xref{String Constants}, for a description of string - escapes. @end deftypefn ! @deftypefn {Function File} {} bin2dec (@var{s}) ! Given a binary number represented as a string of zeros and ones, ! returns the corresponding decimal number. For example, @example ! bin2dec ("1110") ! @result{} 14 @end example ! @end deftypefn ! @deftypefn {Function File} {} blanks (var{n}) ! Returns a string of @var{n} blanks. ! @end deftypefn ! @deftypefn {Function File} {} deblank (@var{s}) ! Removes the trailing blanks from the string @var{s}. @end deftypefn ! @deftypefn {Function File} {} dec2bin (@var{n}) ! Given a nonnegative integer, returns the corresponding binary number as ! a string of ones and zeros. For example, ! ! @example ! dec2bin (14) ! @result{} "1110" ! @end example @end deftypefn ! @deftypefn {Function File} {} dec2hex (@var{n}) ! Given a nonnegative integer, returns the corresponding hexadecimal ! number as a string. For example, ! @example ! dec2hex (2748) ! @result{} "abc" ! @end example @end deftypefn @deftypefn {Function File} {} findstr (@var{s}, @var{t}, @var{overlap}) Returns the vector of all positions in the longer of the two strings ! @var{s} and @var{t} where an occurence of the shorter of the two starts. If the optional argument @var{overlap} is nonzero, the returned vector can include overlapping positions (this is the default). For example, @example findstr ("ababab", "a") ! @result{} [1 3 5] findstr ("abababa", "aba", 0) ! @result{} [1, 5] ! @end example ! @end deftypefn ! ! @deftypefn {Function File} {} hex2dec (@var{s}) ! Given a hexadecimal number represented as a string, returns the ! corresponding decimal number. For example, ! ! @example ! hex2dec ("12B") ! @result{} 299 ! hex2dec ("12b") ! @result{} 299 @end example @end deftypefn @deftypefn {Function File} {} index (@var{s}, @var{t}) ! Returns the position of the first occurence of the string @var{t} in the ! string @var{s}, or 0 if no occurence is found. For example, @example index ("Teststring", "t") ! @result{} 4 @end example @strong{Note:} This function does not work for arrays of strings. @end deftypefn @deftypefn {Function File} {} rindex (@var{s}, @var{t}) ! Returns the position of the last occurence of the string @var{t} in the ! string @var{s}, or 0 if no occurence is found. For example, @example rindex ("Teststring", "t") ! @result{} 6 @end example @strong{Note:} This function does not work for arrays of strings. --- 139,236 ---- character. For example, @example + @group setstr ([97, 98, 99]) ! @result{} "abc" ! @end group @end example @end deftypefn ! @deftypefn {Function File} {} strcat (@var{s1}, @var{s2}, @dots{}) ! Return a string containing all the arguments concatenated. For example, @example ! @group ! s = [ "ab"; "cde" ] ! strcat (s, s, s) ! @result{} "ab ab ab " ! "cdecdecde" ! @end group @end example @end deftypefn ! @defvr {Built-in Variable} string_fill_char ! The value of this variable is used to pad all strings in a string matrix ! to the same length. It should be a single character. The default value ! is @code{" "} (a single space). For example, @example ! @group ! string_fill_char = "X"; ! [ "these"; "are"; "strings" ] ! @result{} "theseXX" ! @result{} "areXXXX" ! @result{} "strings" ! @end group @end example ! @end defvr ! @deftypefn {Function File} {} str2mat (@var{s_1}, @dots{}, @var{s_n}) ! Returns a matrix containing the strings @var{s_1}, @dots{}, @var{s_n} as ! its rows. Each string is padded with blanks in order to form a valid ! matrix. ! @strong{Note:} ! This function is modelled after @sc{MATLAB}. In Octave, you can create ! a matrix of strings by @code{[@var{s_1}; @dots{}; @var{s_n}]} even if ! the strings are not all the same length. @end deftypefn ! @deftypefn {Built-in Function} {} isstr (@var{a}) ! Return 1 if @var{a} is a string. Otherwise, return 0. @end deftypefn ! @node Searching and Replacing, String Conversions, Creating Strings, Strings ! @section Searching and Replacing ! @deftypefn {Function File} {} deblank (@var{s}) ! Removes the trailing blanks from the string @var{s}. @end deftypefn @deftypefn {Function File} {} findstr (@var{s}, @var{t}, @var{overlap}) Returns the vector of all positions in the longer of the two strings ! @var{s} and @var{t} where an occurrence of the shorter of the two starts. If the optional argument @var{overlap} is nonzero, the returned vector can include overlapping positions (this is the default). For example, @example findstr ("ababab", "a") ! @result{} [ 1, 3, 5 ] findstr ("abababa", "aba", 0) ! @result{} [ 1, 5 ] @end example @end deftypefn @deftypefn {Function File} {} index (@var{s}, @var{t}) ! Returns the position of the first occurrence of the string @var{t} in the ! string @var{s}, or 0 if no occurrence is found. For example, @example index ("Teststring", "t") ! @result{} 4 @end example @strong{Note:} This function does not work for arrays of strings. @end deftypefn @deftypefn {Function File} {} rindex (@var{s}, @var{t}) ! Returns the position of the last occurrence of the string @var{t} in the ! string @var{s}, or 0 if no occurrence is found. For example, @example rindex ("Teststring", "t") ! @result{} 6 @end example @strong{Note:} This function does not work for arrays of strings. *************** *** 168,205 **** @example split ("Test string", "t") ! @result{} Tes ! s ! ring @end example @end deftypefn ! @deftypefn {Function File} {} str2num (@var{s}) ! Convert the string @var{s} to a number. ! @end deftypefn ! ! @deftypefn {Function File} {} str2mat (@var{s_1}, @dots{}, @var{s_n}) ! Returns a matrix containing the strings @var{s_1}, @dots{}, @var{s_n} as ! its rows. Each string is padded with blanks in order to form a valid ! matrix. ! @quotation ! @strong{Note:} ! This function is modelled after @sc{MATLAB}. In Octave, you can create ! a matrix of strings by @kbd{[@var{s_1}; @dots{}; @var{s_n}]}. ! @end quotation @end deftypefn - @defvr {Built-in Variable} string_fill_char - @end defvr - @deftypefn {Function File} {} strrep (@var{s}, @var{x}, @var{y}) ! Replaces all occurences of the substring @var{x} of the string @var{s} with the string @var{y}. For example, @example strrep ("This is a test string", "is", "&%$") ! @result{} Th&%$ &%$ a test string @end example @end deftypefn --- 243,269 ---- @example split ("Test string", "t") ! @result{} "Tes " ! " s " ! "ring" @end example @end deftypefn ! @deftypefn {Function File} {} strcmp (@var{s1}, @var{s2}) ! Compares two strings, returning 1 if they are the same, and 0 otherwise. ! @strong{Note:} For compatibility with @sc{Matlab}, Octave's strcmp ! function returns 1 if the strings are equal, and 0 otherwise. This is ! just the opposite of the corresponding C library function. @end deftypefn @deftypefn {Function File} {} strrep (@var{s}, @var{x}, @var{y}) ! Replaces all occurrences of the substring @var{x} of the string @var{s} with the string @var{y}. For example, @example strrep ("This is a test string", "is", "&%$") ! @result{} "Th&%$ &%$ a test string" @end example @end deftypefn *************** *** 209,224 **** @example substr ("This is a test string", 6, 9) ! @result{} is a test @end example @quotation @strong{Note:} This function is patterned after AWK. You can get the same result by ! @kbd{@var{s} (@var{beg} : (@var{beg} + @var{len} - 1))}. @end quotation @end deftypefn @deftypefn {Function File} {} tolower (@var{s}) Return a copy of the string @var{s}, with each upper-case character replaced by the corresponding lower-case one; nonalphabetic characters --- 273,349 ---- @example substr ("This is a test string", 6, 9) ! @result{} "is a test" @end example @quotation @strong{Note:} This function is patterned after AWK. You can get the same result by ! @code{@var{s} (@var{beg} : (@var{beg} + @var{len} - 1))}. @end quotation @end deftypefn + @node String Conversions, Character Class Functions, Searching and Replacing, Strings + @section String Conversions + + @deftypefn {Function File} {} bin2dec (@var{s}) + Given a binary number represented as a string of zeros and ones, + returns the corresponding decimal number. For example, + + @example + bin2dec ("1110") + @result{} 14 + @end example + @end deftypefn + + @deftypefn {Function File} {} dec2bin (@var{n}) + Given a nonnegative integer, returns the corresponding binary number as + a string of ones and zeros. For example, + + @example + dec2bin (14) + @result{} "1110" + @end example + @end deftypefn + + @deftypefn {Function File} {} dec2hex (@var{n}) + Given a nonnegative integer, returns the corresponding hexadecimal + number as a string. For example, + + @example + dec2hex (2748) + @result{} "abc" + @end example + @end deftypefn + + @deftypefn {Function File} {} hex2dec (@var{s}) + Given a hexadecimal number represented as a string, returns the + corresponding decimal number. For example, + + @example + hex2dec ("12B") + @result{} 299 + hex2dec ("12b") + @result{} 299 + @end example + @end deftypefn + + @deftypefn {Function File} {} str2num (@var{s}) + Convert the string @var{s} to a number. + @end deftypefn + + @deftypefn {Function File} {} toascii (@var{s}) + Return ASCII representation of @var{s} in a matrix. For example, + + @example + @group + toascii ("ASCII") + @result{} [ 65, 83, 67, 73, 73 ] + @end group + + @end example + @end deftypefn + @deftypefn {Function File} {} tolower (@var{s}) Return a copy of the string @var{s}, with each upper-case character replaced by the corresponding lower-case one; nonalphabetic characters *************** *** 226,232 **** @example tolower ("MiXeD cAsE 123") ! @result{} "mixed case 123" @end example @end deftypefn --- 351,357 ---- @example tolower ("MiXeD cAsE 123") ! @result{} "mixed case 123" @end example @end deftypefn *************** *** 238,309 **** @example @group toupper ("MiXeD cAsE 123") ! @result{} "MIXED CASE 123" @end group @end example @end deftypefn ! @deftypefn {Function File} {} toascii (@var{s}) ! Return ASCII representation of @var{s} in a matrix. For example, @example ! @group ! toascii ("ASCII") ! @result{} [ 65, 83, 67, 73, 73 ] ! @end group @end example @end deftypefn ! Octave also provides the following C-type character class test ! functions. They all operate on string arrays and return matrices of ! zeros and ones. Elements that are nonzero indicate that the condition ! was true for the corresponding character in the string array. @deftypefn {Mapping Function} {} isalnum (@var{s}) ! letter or a digit @end deftypefn @deftypefn {Mapping Function} {} isalpha (@var{s}) ! letter @end deftypefn @deftypefn {Mapping Function} {} isascii (@var{s}) ! ascii @end deftypefn @deftypefn {Mapping Function} {} iscntrl (@var{s}) ! control character @end deftypefn @deftypefn {Mapping Function} {} isdigit (@var{s}) ! digit @end deftypefn @deftypefn {Mapping Function} {} isgraph (@var{s}) ! printable (but not space character) @end deftypefn @deftypefn {Mapping Function} {} islower (@var{s}) ! lower case @end deftypefn @deftypefn {Mapping Function} {} isprint (@var{s}) ! printable (including space character) @end deftypefn @deftypefn {Mapping Function} {} ispunct (@var{s}) ! punctuation @end deftypefn @deftypefn {Mapping Function} {} isspace (@var{s}) ! whitespace @end deftypefn @deftypefn {Mapping Function} {} isupper (@var{s}) ! upper case @end deftypefn @deftypefn {Mapping Function} {} isxdigit (@var{s}) ! hexadecimal digit @end deftypefn --- 363,469 ---- @example @group toupper ("MiXeD cAsE 123") ! @result{} "MIXED CASE 123" @end group @end example @end deftypefn ! @deftypefn {Built-in Function} {} undo_string_escapes (@var{s}) ! Converts special characters in strings back to their escaped forms. For ! example, the expression @example ! bell = "\a"; ! @end example ! ! @noindent ! assigns the value of the alert character (control-g, ASCII code 7) to ! the string variable @code{bell}. If this string is printed, the ! system will ring the terminal bell (if it is possible). This is ! normally the desired outcome. However, sometimes it is useful to be ! able to print the original representation of the string, with the ! special characters replaced by their escape sequences. For example, + @example + octave:13> undo_string_escapes (bell) + ans = \a @end example + + @noindent + replaces the unprintable alert character with its printable + representation. @end deftypefn ! @defvr {Built-in Variable} implicit_str_to_num_ok ! If the value of @code{implicit_str_to_num_ok} is nonzero, implicit ! conversions of strings to their numeric ASCII equivalents are allowed. ! Otherwise, an error message is printed and control is returned to the ! top level. The default value is 0. ! @end defvr ! ! @node Character Class Functions, , String Conversions, Strings ! @section Character Class Functions ! ! Octave also provides the following character class test functions ! patterned after the functions in the standard C library. They all ! operate on string arrays and return matrices of zeros and ones. ! Elements that are nonzero indicate that the condition was true for the ! corresponding character in the string array. For example, ! ! @example ! @group ! isalpha ("!Q@@WERT^Y&") ! @result{} [ 0, 1, 0, 1, 1, 1, 1, 0, 1, 0 ] ! @end group ! @end example @deftypefn {Mapping Function} {} isalnum (@var{s}) ! Returns true for characters that are letters or digits (@code{isalpha ! (@var{a})} or @code{isdigit (@var{})} is true). @end deftypefn @deftypefn {Mapping Function} {} isalpha (@var{s}) ! Returns true for characters that are letters (@code{isupper (@var{a})} ! or @code{islower (@var{})} is true). @end deftypefn @deftypefn {Mapping Function} {} isascii (@var{s}) ! Returns true for characters that are ASCII (in the range 0 to 127 decimal). @end deftypefn @deftypefn {Mapping Function} {} iscntrl (@var{s}) ! Returns true for control characters. @end deftypefn @deftypefn {Mapping Function} {} isdigit (@var{s}) ! Returns true for characters that are decimal digits. @end deftypefn @deftypefn {Mapping Function} {} isgraph (@var{s}) ! Returns true for printable characters (but not the space character). @end deftypefn @deftypefn {Mapping Function} {} islower (@var{s}) ! Returns true for characters that are lower case letters. @end deftypefn @deftypefn {Mapping Function} {} isprint (@var{s}) ! Returns true for printable characters (including the space character). @end deftypefn @deftypefn {Mapping Function} {} ispunct (@var{s}) ! Returns true for punctuation characters. @end deftypefn @deftypefn {Mapping Function} {} isspace (@var{s}) ! Returns true for whitespace characters (space, formfeed, newline, ! carriage return, tab, and vertical tab). @end deftypefn @deftypefn {Mapping Function} {} isupper (@var{s}) ! Returns true for upper case letters. @end deftypefn @deftypefn {Mapping Function} {} isxdigit (@var{s}) ! Returns true for characters that are hexadecimal digits. @end deftypefn diff -cNr octave-2.0.2/doc/interpreter/struct.texi octave-2.0.3/doc/interpreter/struct.texi *** octave-2.0.2/doc/interpreter/struct.texi Wed Dec 31 18:00:00 1969 --- octave-2.0.3/doc/interpreter/struct.texi Sun Feb 16 22:48:26 1997 *************** *** 0 **** --- 1,201 ---- + @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 Data Structures, Variables, Strings, Top + @chapter Data Structures + @cindex structures + @cindex data structures + + Octave includes support for organizing data in structures. The current + implementation uses an associative array with indices limited to + strings, but the syntax is more like C-style structures. Here are some + examples of using data structures in Octave. + + Elements of structures can be of any value type. For example, the three + expressions + + @example + @group + x.a = 1 + x.b = [1, 2; 3, 4] + x.c = "string" + @end group + @end example + + @noindent + create a structure with three elements. To print the value of the + structure, you can type its name, just as for any other variable: + + @example + @group + octave:2> x + x = + @{ + a = 1 + b = + + 1 2 + 3 4 + + c = string + @} + @end group + @end example + + @noindent + Note that Octave may print the elements in any order. + + Structures may be copied. + + @example + @group + octave:1> y = x + y = + @{ + a = 1 + b = + + 1 2 + 3 4 + + c = string + @} + @end group + @end example + + Since structures are themselves values, structure elements may reference + other structures. The following statements change the value of the + element @code{b} of the structure @code{x} to be a data structure + containing the single element @code{d}, which has a value of 3. + + @example + @group + octave:1> x.b.d = 3 + x.b.d = 3 + octave:2> x.b + ans = + @{ + d = 3 + @} + octave:3> x + x = + @{ + a = 1 + b = + @{ + d = 3 + @} + + c = string + @} + @end group + @end example + + Note that when Octave prints the value of a structure that contains + other structures, only a few levels are displayed. For example, + + @example + @group + octave:1> a.b.c.d.e = 1; + octave:2> a + a = + @{ + b = + @{ + c = + @} + @} + @end group + @end example + + @noindent + This prevents long and confusing output from large deeply nested + structures. + + @defvr {Built-in Variable} struct_levels_to_print + You can tell Octave how many structure levels to display by setting the + built-in variable @code{struct_levels_to_print}. The default value is 2. + @end defvr + + Functions can return structures. For example, the following function + separates the real and complex parts of a matrix and stores them in two + elements of the same structure variable. + + @example + @group + octave:1> function y = f (x) + > y.re = real (x); + > y.im = imag (x); + > endfunction + @end group + @end example + + When called with a complex-valued argument, @code{f} returns the data + structure containing the real and imaginary parts of the original + function argument. + + @example + @group + octave:2> f (rand (3) + rand (3) * I); + ans = + @{ + im = + + 0.26475 0.14828 + 0.18436 0.83669 + + re = + + 0.040239 0.242160 + 0.238081 0.402523 + @} + @end group + @end example + + Function return lists can include structure elements, and they may be + indexed like any other variable. For example, + + @example + @group + octave:1> [ x.u, x.s(2:3,2:3), x.v ] = svd ([1, 2; 3, 4]) + x.u = + + -0.40455 -0.91451 + -0.91451 0.40455 + + x.s = + + 0.00000 0.00000 0.00000 + 0.00000 5.46499 0.00000 + 0.00000 0.00000 0.36597 + + x.v = + + -0.57605 0.81742 + -0.81742 -0.57605 + @end group + @end example + + It is also possible to cycle through all the elements of a structure in + a loop, using a special form of the @code{for} statement + (@pxref{The for Statement}) + + The following functions are available to give you information about + structures. + + @deftypefn {Built-in Function} {} is_struct (@var{expr}) + Returns 1 if the value of the expression @var{expr} is a structure. + @end deftypefn + + @deftypefn {Built-in Function} {} struct_contains (@var{expr}, @var{name}) + This function returns 1 if the expression @var{expr} is a structure and it + includes an element named @var{name}. The first argument must be a + structure and the second must be a string. + @end deftypefn + + @deftypefn {Built-in Function} {} struct_elements (@var{expr}) + If the expression @var{expr} is a structure, this function returns a + list of strings naming the elements of the structure. It is an error to + call @code{struct_elements} with an argument that is not a structure. + @end deftypefn diff -cNr octave-2.0.2/doc/interpreter/system.texi octave-2.0.3/doc/interpreter/system.texi *** octave-2.0.2/doc/interpreter/system.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/system.texi Tue Feb 18 01:48:10 1997 *************** *** 1,8 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node System Utilities, Command History Functions, String Functions, Top @chapter System Utilities This chapter describes the functions that are available to allow you to --- 1,8 ---- ! @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 System Utilities, Tips, Audio Processing, Top @chapter System Utilities This chapter describes the functions that are available to allow you to *************** *** 14,37 **** @menu * Timing Utilities:: * Filesystem Utilities:: ! * Interacting with the OS:: * Password Database Functions:: * Group Database Functions:: * System Information:: - * Other Functions:: @end menu @node Timing Utilities, Filesystem Utilities, System Utilities, System Utilities @section Timing Utilities ! @deftypefn {Loadable Function} {} time () ! Return the current time as the number of seconds since the epoch. The ! epoch is referenced to 00:00:00 CUT (Coordinated Universal Time) 1 Jan ! 1970. ! @end deftypefn ! ! Several of Octave's time functions a data structure for time that ! includes the following elements: @table @code @item usec --- 14,35 ---- @menu * Timing Utilities:: * Filesystem Utilities:: ! * Controlling Subprocesses:: ! * Process ID Information:: ! * Environment Variables:: ! * Current Working Directory:: * Password Database Functions:: * Group Database Functions:: * System Information:: @end menu @node Timing Utilities, Filesystem Utilities, System Utilities, System Utilities @section Timing Utilities ! Octave's core set of functions for manipulating time values are ! patterned after the corresponding functions from the standard C library. ! Several of these functions use a data structure for time that includes ! the following elements: @table @code @item usec *************** *** 69,95 **** Time zone. @end table ! @deftypefn {Loadable Function} {} mktime (@var{time_struct}) ! Convert a time structure to the number of seconds since the epoch. @end deftypefn @deftypefn {Loadable Function} {} localtime (@var{t}) Given a value returned from time (or any nonnegative integer), return a time structure corresponding to the local time zone. @end deftypefn ! @deftypefn {Loadable Function} {} gmtime (@var{t}) ! Given a value returned from time (or any nonnegative integer), ! return a time structure corresponding to CUT. @end deftypefn ! @deftypefn {Function File} {} asctime (@var{time_struct}) Convert a time structure to a string using the following five-field ! format: Thu Mar 28 08:40:14 1996. The function @code{ctime (time)} is ! equivalent to @code{asctime (localtime (time))}. @end deftypefn ! @deftypefn {Loadable Function} {} strftime (@var{time_struct}) Format a time structure in a flexible way using @samp{%} substitutions similar to those in @code{printf}. Except where noted, substituted fields have a fixed size; numeric fields are padded if necessary. --- 67,172 ---- Time zone. @end table ! @noindent ! In the descriptions of the following functions, this structure is ! referred to as a @var{tm_struct}. ! ! @deftypefn {Loadable Function} {} time () ! Return the current time as the number of seconds since the epoch. The ! epoch is referenced to 00:00:00 CUT (Coordinated Universal Time) 1 Jan ! 1970. For example, on Monday February 17, 1997 at 07:15:06 CUT, the ! value returned by @code{time} was 856163706. ! @end deftypefn ! ! @deftypefn {Function File} {} ctime (@var{t}) ! Convert a value returned from @code{time} (or any other nonnegative ! integer), to the local time and return a string of the same form as ! @code{asctime}. The function @code{ctime (time)} is equivalent to ! @code{asctime (localtime (time))}. For example, ! ! @example ! @group ! ctime (time ()) ! @result{} "Mon Feb 17 01:15:06 1997" ! @end group ! @end example ! @end deftypefn ! ! @deftypefn {Loadable Function} {} gmtime (@var{t}) ! Given a value returned from time (or any nonnegative integer), ! return a time structure corresponding to CUT. For example, ! ! @example ! @group ! gmtime (time ()) ! @result{} @{ ! usec = 0 ! year = 97 ! mon = 1 ! mday = 17 ! sec = 6 ! zone = CST ! min = 15 ! wday = 1 ! hour = 7 ! isdst = 0 ! yday = 47 ! @} ! @end group ! @end example @end deftypefn @deftypefn {Loadable Function} {} localtime (@var{t}) Given a value returned from time (or any nonnegative integer), return a time structure corresponding to the local time zone. + + @example + @group + locatltime (time ()) + @result{} @{ + usec = 0 + year = 97 + mon = 1 + mday = 17 + sec = 6 + zone = CST + min = 15 + wday = 1 + hour = 1 + isdst = 0 + yday = 47 + @} + @end group + @end example @end deftypefn ! @deftypefn {Loadable Function} {} mktime (@var{tm_struct}) ! Convert a time structure to the number of seconds since the epoch. For ! example, ! ! @example ! @group ! mktime (localtime (time ()) ! @result{} 856163706 ! @end group ! @end example @end deftypefn ! @deftypefn {Function File} {} asctime (@var{tm_struct}) Convert a time structure to a string using the following five-field ! format: Thu Mar 28 08:40:14 1996. For example, ! ! @example ! @group ! asctime (localtime (time ()) ! @result{} "Mon Feb 17 01:15:06 1997\n" ! @end group ! @end example ! ! This is equivalent to @code{ctime (time ())}. @end deftypefn ! @deftypefn {Loadable Function} {} strftime (@var{tm_struct}) Format a time structure in a flexible way using @samp{%} substitutions similar to those in @code{printf}. Except where noted, substituted fields have a fixed size; numeric fields are padded if necessary. *************** *** 97,103 **** number, padding can be changed or inhibited by following the @samp{%} with one of the modifiers described below. Unknown field specifiers are copied as normal characters. All other characters are copied to the ! output without change. Octave's @code{strftime} function supports a superset of the ANSI C field specifiers. --- 174,187 ---- number, padding can be changed or inhibited by following the @samp{%} with one of the modifiers described below. Unknown field specifiers are copied as normal characters. All other characters are copied to the ! output without change. For example, ! ! @example ! @group ! strftime ("%r (%Z) %A %e %B %Y", localtime (time ()) ! @result{} "01:15:06 AM (CST) Monday 17 February 1997" ! @end group ! @end example Octave's @code{strftime} function supports a superset of the ANSI C field specifiers. *************** *** 120,129 **** Numeric modifiers (a nonstandard extension): @table @code ! @item - Do not pad the field. ! @item _ Pad the field with spaces. @end table --- 204,213 ---- Numeric modifiers (a nonstandard extension): @table @code ! @item - (dash) Do not pad the field. ! @item _ (underscore) Pad the field with spaces. @end table *************** *** 231,245 **** @end table @end deftypefn @deftypefn {Function File} {} clock () Return a vector containing the current year, month (1-12), day (1-31), hour (0-23), minute (0-59) and second (0-61). For example, @example ! octave:13> clock ! ans = ! ! 1993 8 20 4 56 1 @end example The function clock is more accurate on systems that have the --- 315,334 ---- @end table @end deftypefn + Most of the remaining functions described in this section are not + patterned after the standard C library. Some are available for + compatiblity with @sc{Matlab} and others are provided because they are + useful. + @deftypefn {Function File} {} clock () Return a vector containing the current year, month (1-12), day (1-31), hour (0-23), minute (0-59) and second (0-61). For example, @example ! @group ! clock () ! @result{} [ 1993, 8, 20, 4, 56, 1 ] ! @end group @end example The function clock is more accurate on systems that have the *************** *** 251,274 **** example, @example ! octave:13> date ! ans = 20-Aug-93 ! @end example ! @end deftypefn ! ! @deftypefn {Function File} {} tic () ! @deftypefnx {Function File} {} toc () ! These functions set and check a wall-clock timer. For example, ! ! @example ! tic (); ! # many computations later... ! elapsed_time = toc (); @end example - - @noindent - will set the variable @code{elapsed_time} to the number of seconds since - the most recent call to the function @code{tic}. @end deftypefn @deftypefn {Function File} {} etime (@var{t1}, @var{t2}) --- 340,350 ---- example, @example ! @group ! date () ! @result{} "20-Aug-93" ! @end group @end example @end deftypefn @deftypefn {Function File} {} etime (@var{t1}, @var{t2}) *************** *** 293,298 **** --- 369,377 ---- executing in user mode and the number of CPU seconds spent executing in system mode, respectively. If your system does not have a way to report CPU time usage, @code{cputime} returns 0 for each of its output values. + Note that because Octave used some CPU time to start, it is reasonable + to check to see if @code{cputime} works by checking to see if the total + CPU time used is nonzero. @end deftypefn @deftypefn {Function File} {} is_leap_year (@var{year}) *************** *** 301,453 **** For example, @example ! octave:13> is_leap_year (2000) ! ans = 1 @end example @end deftypefn ! @node Filesystem Utilities, Interacting with the OS, Timing Utilities, System Utilities @section Filesystem Utilities Octave includes the following functions for renaming and deleting files, creating, deleting, and reading directories, and for getting information about the status of files. ! @deftypefn {Built-in Function} {} rename (@var{from}, @var{to}) ! Rename a file. @end deftypefn ! @deftypefn {Built-in Function} {} unlink (@var{file}) ! Delete a file. @end deftypefn ! @deftypefn {Built-in Function} {} readdir (@var{dir}) ! Returns names of files in the directory @var{dir} as an array of ! strings. @end deftypefn ! @deftypefn {Built-in Function} {} mkdir (@var{dir}) ! Create a directory @end deftypefn ! @deftypefn {Built-in Function} {} rmdir (@var{dir}) ! Remove a directory. @end deftypefn @c XXX FIXME XXX -- this needs to be explained, but I don't feel up to @c it just now... @deftypefn {Built-in Function} {} umask (@var{mask}) ! Set permission mask for file creation. @end deftypefn ! @deftypefn {Built-in Function} {} stat (@var{file}) ! Get information about a file. If @var{file} is a symbolic link, ! @code{stat} returns information about the file that the symbolic link ! references. ! @end deftypefn ! @deftypefn {Built-in Function} {} lstat (@var{file}) ! Get information about a symbolic link. If @var{file} is not a symbolic ! link, @code{lstat} is equivalent to @code{stat}. ! @end deftypefn ! @deftypefn {Built-in Function} {} glob (@var{pattern}) ! Given an array of strings in @var{pattern}, return the list of file ! names that any of them, or an empty string if no patterns match. Tilde ! expansion is performed on each of the patterns before looking for ! matching file names. ! @end deftypefn ! @deftypefn {Built-in Function} {} fnmatch (@var{pattern}, @var{string}) ! Return 1 or zero for each element of @var{string} that matches any of ! the elements of the string array @var{pattern}, using the rules of ! filename pattern matching. ! @end deftypefn ! @node Interacting with the OS, Password Database Functions, Filesystem Utilities, System Utilities ! @section Interacting with the OS ! @deftypefn {Built-in Function} {} fork () ! Create a copy of the current process. ! @end deftypefn ! @deftypefn {Built-in Function} {} exec (@var{file}, @var{args}) ! Replace current process with a new process. ! @end deftypefn ! @deftypefn {Built-in Function} {fid =} dup2 (@var{old}, @var{new}) ! Duplicate a file descriptor. ! @end deftypefn ! @deftypefn {Built-in Function} {[@var{file_ids}, @var{status}] =} pipe () ! Create an interprocess channel. ! @end deftypefn ! @deftypefn {Built-in Function} {} fcntl (@var{fid}, @var{request}, @var{argument}) ! Control open file descriptors. ! @vtable @code ! @item F_DUPFD ! @item F_GETFD ! @item F_GETFL ! @item F_SETFD ! @item F_SETFL ! @item O_APPEND ! @item O_CREAT ! @item O_EXCL ! @item O_NONBLOCK ! @item O_RDONLY ! @item O_RDWR ! @item O_TRUNC ! @item O_WRONLY ! @end vtable ! @end deftypefn ! @deftypefn {Built-in Function} {} getpgrp () ! Return the process group id of the current process. ! @end deftypefn ! @deftypefn {Built-in Function} {} getpid () ! Return the process id of the current process. ! @end deftypefn ! @deftypefn {Built-in Function} {} getppid () ! Return the process id of the parent process. ! @end deftypefn ! @deftypefn {Built-in Function} {} geteuid () ! Return the effective user id of the current process. ! @end deftypefn ! @deftypefn {Built-in Function} {} getuid () ! Return the real user id of the current process. ! @end deftypefn ! @deftypefn {Built-in Function} {} getegid () ! Return the effective group id of the current process. @end deftypefn ! @deftypefn {Built-in Function} {} getgid () ! Return the real group id of the current process. @end deftypefn ! @deftypefn {Built-in Function} {} mkfifo ! Create a FIFO special file. @end deftypefn ! @deftypefn {Built-in Function} {} waitpid ! Check the status of or wait for subprocesses. @end deftypefn ! @deftypefn {Built-in Function} {} atexit (@var{fcn}) ! Register function to be called when Octave exits. @end deftypefn @deftypefn {Built-in Function} {} system (@var{string}, @var{return_output}, @var{type}) Execute a shell command specified by @var{string}. The second argument is optional. If @var{type} is @code{"async"}, the process is started in the ! background and the process id of the child proces is returned immediately. Otherwise, the process is started, and Octave waits until it exits. If @var{type} argument is omitted, a value of @code{"sync"} is assumed. --- 380,688 ---- For example, @example ! @group ! is_leap_year (2000) ! @result{} 1 ! @end group ! @end example ! @end deftypefn ! ! @deftypefn {Function File} {} tic () ! @deftypefnx {Function File} {} toc () ! These functions set and check a wall-clock timer. For example, ! ! @example ! tic (); ! # many computations later... ! elapsed_time = toc (); ! @end example ! ! @noindent ! will set the variable @code{elapsed_time} to the number of seconds since ! the most recent call to the function @code{tic}. ! ! If you are more interested in the CPU time that your process used, you ! should use the @code{cputime} function instead. The @code{tic} and ! @code{toc} functions report the actual wall clock time that elapsed ! between the calls. This may include time spent processing other jobs or ! doing nothing at all. For example, ! ! @example ! @group ! tic (); sleep (5); toc () ! @result{} 5 ! t = cputime (); sleep (5); cputime () - t ! @result{} 0 ! @end group @end example + + @noindent + (This example also illustrates that the CPU timer may have a fairly + coarse resolution.) + @end deftypefn + + @deftypefn {Built-in Function} {} pause (@var{seconds}) + Suspend the execution of the program. If invoked without any arguments, + Octave waits until you type a character. With a numeric argument, it + pauses for the given number of seconds. For example, the following + statement prints a message and then waits 5 seconds before clearing the + screen. + + @example + @group + fprintf (stderr, "wait please...\n"); + pause (5); + clc; + @end group + @end example + @end deftypefn + + @deftypefn {Built-in Function} {} sleep (@var{seconds}) + Suspend the execution of the program for the given number of seconds. + @end deftypefn + + @deftypefn {Built-in Function} {} usleep (@var{microseconds}) + Suspend the execution of the program for the given number of + microseconds. On systems where it is not possible to sleep for periods + of time less than one second, @code{usleep} will pause the execution for + @code{round (@var{microseconds} / 1e6)} seconds. @end deftypefn ! @node Filesystem Utilities, Controlling Subprocesses, Timing Utilities, System Utilities @section Filesystem Utilities Octave includes the following functions for renaming and deleting files, creating, deleting, and reading directories, and for getting information about the status of files. ! @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} rename (@var{old}, @var{new}) ! Change the name of file @var{old} to @var{new}. ! ! If successful, @var{err} is 0 and @var{msg} is an empty string. ! Otherwise, @var{err} is nonzero and @var{msg} contains a ! system-dependent error message. ! @end deftypefn ! ! @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} unlink (@var{file}) ! Delete @var{file}. ! ! If successful, @var{err} is 0 and @var{msg} is an empty string. ! Otherwise, @var{err} is nonzero and @var{msg} contains a ! system-dependent error message. @end deftypefn ! @deftypefn {Built-in Function} {[@var{files}, @var{err}, @var{msg}] =} readdir (@var{dir}) ! Return names of the files in the directory @var{dir} as an array of ! strings. If an error occurs, return an empty matrix in @var{files}. ! ! If successful, @var{err} is 0 and @var{msg} is an empty string. ! Otherwise, @var{err} is nonzero and @var{msg} contains a ! system-dependent error message. @end deftypefn ! @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} mkdir (@var{dir}) ! Create a directory named @var{dir}. ! ! If successful, @var{err} is 0 and @var{msg} is an empty string. ! Otherwise, @var{err} is nonzero and @var{msg} contains a ! system-dependent error message. @end deftypefn ! @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} rmdir (@var{dir}) ! Remove the directory named @var{dir}. ! ! If successful, @var{err} is 0 and @var{msg} is an empty string. ! Otherwise, @var{err} is nonzero and @var{msg} contains a ! system-dependent error message. @end deftypefn ! @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} mkfifo (@var{name}) ! Create a FIFO special file. ! ! If successful, @var{err} is 0 and @var{msg} is an empty string. ! Otherwise, @var{err} is nonzero and @var{msg} contains a ! system-dependent error message. @end deftypefn @c XXX FIXME XXX -- this needs to be explained, but I don't feel up to @c it just now... @deftypefn {Built-in Function} {} umask (@var{mask}) ! Set the permission mask for file creation. The parameter @var{mask} is ! interpreted as an octal number. @end deftypefn ! @deftypefn {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} stat (@var{file}) ! @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{file}) ! Return a structure @var{s} containing the following information about ! @var{file}. ! @table @code ! @item dev ! ID of device containing a directory entry for this file. ! @item ino ! File number of the file. ! @item modestr ! File mode, as a string of ten letters or dashes as would be returned by ! @kbd{ls -l}. ! @item nlink ! Number of links. ! @item uid ! User ID of file's owner. ! @item gid ! Group ID of file's group. ! @item rdev ! ID of device for block or character special files. ! @item size ! Size in bytes. ! @item atime ! Time of last access in the same form as time values returned from ! @code{time}. @xref{Timing Utilities}. ! @item mtime ! Time of last modification in the same form as time values returned from ! @code{time}. @xref{Timing Utilities}. ! @item ctime ! Time of last file status change in the same form as time values returned from ! @code{time}. @xref{Timing Utilities}. ! @item blksize ! Size of blocks in the file. ! @item blocks ! Number of blocks allocated for file. ! @end table ! If the call is successful @var{err} is 0 and @var{msg} is an empty ! string. If the file does not exist, or some other error occurs, @var{s} ! is an empty matrix, @var{err} is @minus{}1, and @var{msg} contains the ! corresponding system error message. ! ! If @var{file} is a symbolic link, @code{stat} will return information ! about the actual file the is referenced by the link. Use @code{lstat} ! if you want information about the symbolic link itself. ! For example, ! @example ! @group ! [s, err, msg] = stat ("/vmlinuz") ! ! @result{} s = ! @{ ! atime = 855399756 ! rdev = 0 ! ctime = 847219094 ! uid = 0 ! size = 389218 ! blksize = 4096 ! mtime = 847219094 ! gid = 6 ! nlink = 1 ! blocks = 768 ! modestr = -rw-r--r-- ! ino = 9316 ! dev = 2049 ! @} ! ! @result{} err = 0 ! ! @result{} msg = ! ! @end group ! @end example @end deftypefn ! @deftypefn {Built-in Function} {} glob (@var{pattern}) ! Given an array of strings in @var{pattern}, return the list of file ! names that any of them, or an empty string if no patterns match. Tilde ! expansion is performed on each of the patterns before looking for ! matching file names. For example, ! ! @example ! @group ! glob ("/vm*") ! @result{} "/vmlinuz" ! @end group ! @end example ! ! Note that multiple values are returned in a string matrix with the fill ! character set to ASCII NUL. @end deftypefn ! @deftypefn {Built-in Function} {} fnmatch (@var{pattern}, @var{string}) ! Return 1 or zero for each element of @var{string} that matches any of ! the elements of the string array @var{pattern}, using the rules of ! filename pattern matching. For example, ! ! @example ! @group ! fnmatch ("a*b", ["ab"; "axyzb"; "xyzab"]) ! @result{} [ 1; 1; 0 ] ! @end group ! @end example @end deftypefn ! @deftypefn {Built-in Function} {} file_in_path (@var{path}, @var{file}) ! Return the absolute name name of @var{file} if it can be found in ! @var{path}. The value of @var{path} should be a colon-separated list of ! directories in the format described for the built-in variable ! @code{LOADPATH}. ! ! If the file cannot be found in the path, an empty matrix is returned. ! For example, ! ! @example ! file_in_path (LOADPATH, "nargchk.m") ! @result{} "@value{OCTAVEHOME}/share/octave/2.0/m/general/nargchk.m" ! @end example @end deftypefn ! @deftypefn {Built-in Function} {} tilde_expand (@var{string}) ! Performs tilde expansion on @var{string}. If @var{string} begins with a ! tilde character, (@samp{~}), all of the characters preceding the first ! slash (or all characters, if there is no slash) are treated as a ! possible user name, and the tilde and the following characters up to the ! slash are replaced by the home directory of the named user. If the ! tilde is followed immediately by a slash, the tilde is replaced by the ! home directory of the user running Octave. For example, ! ! @example ! @group ! tilde_expand ("~joeuser/bin") ! @result{} "/home/joeuser/bin" ! tilde_expand ("~/bin") ! @result{} "/home/jwe/bin" ! @end group ! @end example @end deftypefn + @node Controlling Subprocesses, Process ID Information, Filesystem Utilities, System Utilities + @section Controlling Subprocesses + + Octave includes some high-level commands like @code{system} and + @code{popen} for starting subprocesses. If you want to run another + program to perform some task and then look at its output, you will + probably want to use these functions. + + Octave also provides several very low-level Unix-like functions which + can also be used for starting subprocesses, but you should probably only + use them if you can't find any way to do what you need with the + higher-level functions. + @deftypefn {Built-in Function} {} system (@var{string}, @var{return_output}, @var{type}) Execute a shell command specified by @var{string}. The second argument is optional. If @var{type} is @code{"async"}, the process is started in the ! background and the process id of the child process is returned immediately. Otherwise, the process is started, and Octave waits until it exits. If @var{type} argument is omitted, a value of @code{"sync"} is assumed. *************** *** 484,489 **** --- 719,788 ---- variable @code{status} to the integer @samp{2}. @end deftypefn + @deftypefn {Built-in Function} {fid =} popen (@var{command}, @var{mode}) + Start a process and create a pipe. The name of the command to run is + given by @var{command}. The file identifier corresponding to the input + or output stream of the process is returned in @var{fid}. The argument + @var{mode} may be + + @table @code + @item "r" + The pipe will be connected to the standard output of the process, and + open for reading. + + @item "w" + The pipe will be connected to the standard input of the process, and + open for writing. + @end table + + For example, + + @example + @group + fid = popen ("ls -ltr / | tail -3", "r"); + while (isstr (s = fgets (fid))) + fputs (stdout, s); + endwhile + @print{} drwxr-xr-x 33 root root 3072 Feb 15 13:28 etc + @print{} drwxr-xr-x 3 root root 1024 Feb 15 13:28 lib + @print{} drwxrwxrwt 15 root root 2048 Feb 17 14:53 tmp + @end group + @end example + @end deftypefn + + @deftypefn {Built-in Function} {} pclose (@var{fid}) + Close a file identifier that was opened by @code{popen}. You may also + use @code{fclose} for the same purpose. + @end deftypefn + + @deftypefn {Built-in Function} {[@var{in}, @var{out}, @var{pid}] =} popen2 (@var{command}, @var{args}) + Start a subprocess with two-way communication. The name of the process + is given by @var{command}, and @var{args} is an array of strings + containing options for the command. The file identifiers for the input + and output streams of the subprocess are returned in @var{in} and + @var{out}. If execution of the command is successful, @var{pid} + contains the process ID of the subprocess. Otherwise, @var{pid} is + @minus{}1. + + For example, + + @example + @group + [in, out, pid] = popen2 ("sort", "-nr"); + fputs (in, "these\nare\nsome\nstrings\n"); + fclose (in); + while (isstr (s = fgets (out))) + fputs (stdout, s); + endwhile + fclose (out); + @print{} are + @print{} some + @print{} strings + @print{} these + @end group + @end example + @end deftypefn + @defvr {Built-in Variable} EXEC_PATH The variable @code{EXEC_PATH} is a colon separated list of directories to search when executing subprograms. Its initial value is taken from *************** *** 494,502 **** begins (ends) with a colon, the directories @example OCTAVE_HOME/libexec/octave/site/exec/ARCH OCTAVE_HOME/libexec/octave/VERSION/exec/ARCH ! OCTAVE_HOME/bin @end example @noindent --- 793,802 ---- begins (ends) with a colon, the directories @example + @group OCTAVE_HOME/libexec/octave/site/exec/ARCH OCTAVE_HOME/libexec/octave/VERSION/exec/ARCH ! @end group @end example @noindent *************** *** 507,512 **** --- 807,996 ---- your shell path. @end defvr + In most cases, the following functions simply decode their arguments and + make the corresponding Unix system calls. For a complete example of how + they can be used, look at the definition of the function @code{popen2}. + + @deftypefn {Built-in Function} {[@var{pid}, @var{msg}] =} fork () + Create a copy of the current process. + + Fork can return one of the following values: + + @table @asis + @item > 0 + You are in the parent process. The value returned from @code{fork} is + the process id of the child process. You should probably arrange to + wait for any child processes to exit. + + @item 0 + You are in the child process. You can call @code{exec} to start another + process. If that fails, you should probably call @code{exit}. + + @item < 0 + The call to @code{fork} failed for some reason. You must take evasive + action. A system dependent error message will be waiting in @var{msg}. + @end table + @end deftypefn + + @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} exec (@var{file}, @var{args}) + Replace current process with a new process. Calling @code{exec} without + first calling @code{fork} will terminate your current Octave process and + replace it with the program named by @var{file}. For example, + + @example + exec ("ls" "-l") + @end example + + @noindent + will run @code{ls} and return you to your shell prompt. + + If successful, @code{exec} does not return. If @code{exec} does return, + @var{err} will be nonzero, and @var{msg} will contain a system-dependent + error message. + @end deftypefn + + @deftypefn {Built-in Function} {[@var{file_ids}, @var{err}, @var{msg}] =} pipe () + Create a pipe and return the vector @var{file_ids}, which corresponding + to the reading and writing ends of the pipe. + + If successful, @var{err} is 0 and @var{msg} is an empty string. + Otherwise, @var{err} is nonzero and @var{msg} contains a + system-dependent error message. + @end deftypefn + + @deftypefn {Built-in Function} {[fid, msg] =} dup2 (@var{old}, @var{new}) + Duplicate a file descriptor. + + If successful, @var{fid} is greater than zero and contains the new file + ID. Otherwise, @var{fid} is negative and @var{msg} contains a + system-dependent error message. + @end deftypefn + + @deftypefn {Built-in Function} {[@var{pid}, @var{msg}] =} waitpid (@var{pid}, @var{options}) + Wait for process @var{pid} to terminate. The @var{pid} argument can be: + + @table @asis + @item @minus{}1 + Wait for any child process. + + @item 0 + Wait for any child process whose process group ID is equal to that of + the Octave interpreter process. + + @item > 0 + Wait for termination of the child process with ID @var{PID}. + @end table + + The @var{options} argument can be: + + @table @asis + @item 0 + Wait until signal is received or a child process exits (this is the + default if the @var{options} argument is missing). + + @item 1 + Do not hang if status is not immediately available. + + @item 2 + Report the status of any child processes that are stopped, and whose + status has not yet been reported since they stopped. + + @item 3 + Implies both 1 and 2. + @end table + + If the returned value of @var{pid} is greater than 0, it is the process + ID of the child process that exited. If an error occurs, @var{pid} will + be less than zero and @var{msg} will contain a system-dependent error + message. + @end deftypefn + + @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} fcntl (@var{fid}, @var{request}, @var{arg}) + Change the properties of the open file @var{fid}. The following values + may be passed as @var{request}: + + @vtable @code + @item F_DUPFD + Return a duplicate file descriptor. + + @item F_GETFD + Return the file descriptor flags for @var{fid}. + + @item F_SETFD + Set the file descriptor flags for @var{fid}. + + @item F_GETFL + Return the file status flags for @var{fid}. The following codes may be + returned (some of the flags may be undefined on some systems). + + @vtable @code + @item O_RDONLY + Open for reading only. + + @item O_WRONLY + Open for writing only. + + @item O_RDWR + Open for reading and writing. + + @item O_APPEND + Append on each write. + + @item O_NONBLOCK + Nonblocking mode. + + @item O_SYNC + Wait for writes to complete. + + @item O_ASYNC + Asynchronous I/O. + @end vtable + + @item F_SETFL + Set the file status flags for @var{fid} to the value specified by + @var{arg}. The only flags that can be changed are @code{O_APPEND} and + @code{O_NONBLOCK}. + @end vtable + + If successful, @var{err} is 0 and @var{msg} is an empty string. + Otherwise, @var{err} is nonzero and @var{msg} contains a + system-dependent error message. + @end deftypefn + + @node Process ID Information, Environment Variables, Controlling Subprocesses, System Utilities + @section Process, Group, and User IDs + + @deftypefn {Built-in Function} {} getpgrp () + Return the process group id of the current process. + @end deftypefn + + @deftypefn {Built-in Function} {} getpid () + Return the process id of the current process. + @end deftypefn + + @deftypefn {Built-in Function} {} getppid () + Return the process id of the parent process. + @end deftypefn + + @deftypefn {Built-in Function} {} geteuid () + Return the effective user id of the current process. + @end deftypefn + + @deftypefn {Built-in Function} {} getuid () + Return the real user id of the current process. + @end deftypefn + + @deftypefn {Built-in Function} {} getegid () + Return the effective group id of the current process. + @end deftypefn + + @deftypefn {Built-in Function} {} getgid () + Return the real group id of the current process. + @end deftypefn + + @node Environment Variables, Current Working Directory, Process ID Information, System Utilities + @section Environment Variables + @deftypefn {Built-in Function} {} getenv (@var{var}) Returns the value of the environment variable @var{var}. For example, *************** *** 522,531 **** Set the value of the environment variable @var{var} to @var{value}. @end deftypefn ! @deftypefn {Built-in Function} {} clc () ! @deftypefnx {Built-in Function} {} home () ! Clear the terminal screen and move the cursor to the upper left corner. ! @end deftypefn @deffn {Command} cd dir @deffnx {Command} chdir dir --- 1006,1013 ---- Set the value of the environment variable @var{var} to @var{value}. @end deftypefn ! @node Current Working Directory, Password Database Functions, Environment Variables, System Utilities ! @section Current Working Directory @deffn {Command} cd dir @deffnx {Command} chdir dir *************** *** 551,565 **** command. @end defvr ! @deffn {Command} ls ! @deffnx {Command} dir List directory contents. For example, @example ! octave:13> ls -l ! total 12 ! -rw-r--r-- 1 jwe users 4488 Aug 19 04:02 foo.m ! -rw-r--r-- 1 jwe users 1315 Aug 17 23:14 bar.m @end example The @code{dir} and @code{ls} commands are implemented by calling your --- 1033,1047 ---- command. @end defvr ! @deffn {Command} ls options ! @deffnx {Command} dir options List directory contents. For example, @example ! ls -l ! @print{} total 12 ! @print{} -rw-r--r-- 1 jwe users 4488 Aug 19 04:02 foo.m ! @print{} -rw-r--r-- 1 jwe users 1315 Aug 17 23:14 bar.m @end example The @code{dir} and @code{ls} commands are implemented by calling your *************** *** 567,573 **** from system to system. @end deffn ! @node Password Database Functions, Group Database Functions, Interacting with the OS, System Utilities @section Password Database Functions Octave's password database functions return information in a structure --- 1049,1055 ---- from system to system. @end deffn ! @node Password Database Functions, Group Database Functions, Current Working Directory, System Utilities @section Password Database Functions Octave's password database functions return information in a structure *************** *** 596,616 **** The initial shell. @end table ! @deftypefn {Loadable Function} {passwd_struct =} getpwent () ! Return an entry from the password database, opening it if necessary. ! Once the end of the data has been reached, @code{getpwent} returns 0. @end deftypefn ! @deftypefn {Loadable Function} {passwd_struct =} getpwuid (@var{uid}). ! Return the first entry from the password database with the user ID ! @var{uid}. If the user ID does not exist in the database, ! @code{getpwuid} returns 0. @end deftypefn ! @deftypefn {Loadable Function} {passwd_struct =} getpwnam (@var{name}) ! Return the first entry from the password database with the user name ! @var{name}. If the user name does not exist in the database, ! @code{getpwname} returns 0. @end deftypefn @deftypefn {Loadable Function} {} setpwent () --- 1078,1102 ---- The initial shell. @end table ! In the descriptions of the following functions, this data structure is ! referred to as a @var{pw_struct}. ! ! @deftypefn {Loadable Function} {@var{pw_struct} = } getpwent () ! Return a structure containing an entry from the password database, ! opening it if necessary. Once the end of the data has been reached, ! @code{getpwent} returns 0. @end deftypefn ! @deftypefn {Loadable Function} {@var{pw_struct} = } getpwuid (@var{uid}). ! Return a structure containing the first entry from the password database ! with the user ID @var{uid}. If the user ID does not exist in the ! database, @code{getpwuid} returns 0. @end deftypefn ! @deftypefn {Loadable Function} {@var{pw_struct} = } getpwnam (@var{name}) ! Return a structure containing the first entry from the password database ! with the user name @var{name}. If the user name does not exist in the ! database, @code{getpwname} returns 0. @end deftypefn @deftypefn {Loadable Function} {} setpwent () *************** *** 641,658 **** The members of the group. @end table ! @deftypefn {Loadable Function} {group_struct =} getgrent () Return an entry from the group database, opening it if necessary. Once the end of the data has been reached, @code{getgrent} returns 0. @end deftypefn ! @deftypefn {Loadable Function} {group_struct =} getgrgid (@var{gid}). Return the first entry from the group database with the group ID @var{gid}. If the group ID does not exist in the database, @code{getgrgid} returns 0. @end deftypefn ! @deftypefn {Loadable Function} {group_struct =} getgrnam (@var{name}) Return the first entry from the group database with the group name @var{name}. If the group name does not exist in the database, @code{getgrname} returns 0. --- 1127,1147 ---- The members of the group. @end table ! In the descriptions of the following functions, this data structure is ! referred to as a @var{grp_struct}. ! ! @deftypefn {Loadable Function} {grp_struct =} getgrent () Return an entry from the group database, opening it if necessary. Once the end of the data has been reached, @code{getgrent} returns 0. @end deftypefn ! @deftypefn {Loadable Function} {grp_struct =} getgrgid (@var{gid}). Return the first entry from the group database with the group ID @var{gid}. If the group ID does not exist in the database, @code{getgrgid} returns 0. @end deftypefn ! @deftypefn {Loadable Function} {grp_struct =} getgrnam (@var{name}) Return the first entry from the group database with the group name @var{name}. If the group name does not exist in the database, @code{getgrname} returns 0. *************** *** 666,681 **** Close the group database. @end deftypefn ! @node System Information, Other Functions, Group Database Functions, System Utilities @section System Information @deftypefn {Built-in Function} {} computer () ! Returns a string of the form @var{cpu}-@var{vendor}-@var{os} that ! identifies the kind of computer Octave is running on. For example, @example ! octave:13> computer ! sparc-sun-sunos4.1.2 @end example @end deftypefn --- 1155,1177 ---- Close the group database. @end deftypefn ! @node System Information, , Group Database Functions, System Utilities @section System Information @deftypefn {Built-in Function} {} computer () ! Print or return a string of the form @var{cpu}-@var{vendor}-@var{os} ! that identifies the kind of computer Octave is running on. If invoked ! with an output argument, the value is returned instead of printed. For ! example, @example ! @group ! computer () ! @print{} i586-pc-linux-gnu ! ! x = computer () ! @result{} x = "i586-pc-linux-gnu" ! @end group @end example @end deftypefn *************** *** 686,692 **** @deftypefn {Built-in Function} {} version () Returns Octave's version number as a string. This is also the value of ! the built-in variable @code{OCTAVE_VERSION}. @xref{Built-in Variables}. @end deftypefn @deftypefn {Loadable Function} {} getrusage () --- 1182,1197 ---- @deftypefn {Built-in Function} {} version () Returns Octave's version number as a string. This is also the value of ! the built-in variable @code{OCTAVE_VERSION}. ! @end deftypefn ! ! @defvr {Built-in Variable} OCTAVE_VERSION ! The version number of Octave, as a string. ! @end defvr ! ! @deftypefn {Built-in Function} {} octave_config_info () ! Return a structure containing configuration and installation ! information. @end deftypefn @deftypefn {Loadable Function} {} getrusage () *************** *** 749,777 **** A structure containing the user CPU time used. The structure has the elements @code{sec} (seconds) @code{usec} (microseconds). @end table - @end deftypefn - - @node Other Functions, , System Information, System Utilities - @section Other Functions - - @c XXX FIXME XXX -- need to define tilde expansion. - - @deftypefn {Built-in Function} {} tilde_expand (@var{string}) - Performs tilde expansion on @var{string}. - @end deftypefn - - @deftypefn {Built-in Function} {} pause (@var{seconds}) - Suspend the execution of the program. If invoked without any arguments, - Octave waits until you type a character. With a numeric argument, it - pauses for the given number of seconds. For example, the following - statement prints a message and then waits 5 seconds before clearing the - screen. - - @example - @group - fprintf (stderr, "wait please...\n"); - pause (5); - clc; - @end group - @end example @end deftypefn --- 1254,1257 ---- diff -cNr octave-2.0.2/doc/interpreter/tips.texi octave-2.0.3/doc/interpreter/tips.texi *** octave-2.0.2/doc/interpreter/tips.texi Wed Dec 31 18:00:00 1969 --- octave-2.0.3/doc/interpreter/tips.texi Mon Feb 17 16:56:47 1997 *************** *** 0 **** --- 1,363 ---- + @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 Tips, Trouble, System Utilities, Top + @appendix Tips and Standards + @cindex tips + @cindex standards of coding style + @cindex coding standards + + This chapter describes no additional features of Octave. Instead it + gives advice on making effective use of the features described in the + previous chapters. + + @menu + * Style Tips:: Writing clean and robust programs. + * Coding Tips:: Making code run faster. + * Documentation Tips:: Writing readable documentation strings. + * Comment Tips:: Conventions for writing comments. + * Function Headers:: Standard headers for functions. + @end menu + + @node Style Tips, Coding Tips, Tips, Tips + @section Writing Clean Octave Programs + + Here are some tips for avoiding common errors in writing Octave code + intended for widespread use: + + @itemize @bullet + @item + Since all global variables share the same name space, and all functions + share another name space, you should choose a short word to distinguish + your program from other Octave programs. Then take care to begin the + names of all global variables, constants, and functions with the chosen + prefix. This helps avoid name conflicts. + + If you write a function that you think ought to be added to Octave under + a certain name, such as @code{fiddle_matrix}, don't call it by that name + in your program. Call it @code{mylib_fiddle_matrix} in your program, + and send mail to @email{bug-octave@@bevo.che.wisc.edu} suggesting that it + be added to Octave. If and when it is, the name can be changed easily + enough. + + If one prefix is insufficient, your package may use two or three + alternative common prefixes, so long as they make sense. + + Separate the prefix from the rest of the symbol name with an underscore + @samp{_}. This will be consistent with Octave itself and with most + Octave programs. + + @item + When you encounter an error condition, call the function @code{error} + (or @code{usage}). The @code{error} and @code{usage} functions do not + return. + @xref{Errors}. + + @item + Please put a copyright notice on the file if you give copies to anyone. + Use the same lines that appear at the top of the function files + distributed with Octave. If you have not signed papers to assign the + copyright to anyone else, then place your name in the copyright notice. + @end itemize + + @node Coding Tips, Documentation Tips, Style Tips, Tips + @section Tips for Making Code Run Faster. + @cindex execution speed + @cindex speedups + + Here are some ways of improving the execution speed of Octave programs. + + @itemize @bullet + @item + Avoid looping wherever possible. + + @item + Use iteration rather than recursion whenever possible. + Function calls are slow in Octave. + + @item + Avoid resizing matrices unnecessarily. When building a single result + matrix from a series of calculations, set the size of the result matrix + first, then insert values into it. Write + + @example + @group + result = zeros (big_n, big_m) + for i = over:and_over + r1 = @dots{} + r2 = @dots{} + result (r1, r2) = new_value (); + endfor + @end group + @end example + + @noindent + instead of + + @example + @group + result = []; + for i = ever:and_ever + result = [ result, new_value() ]; + endfor + @end group + @end example + + @item + Avoid calling @code{eval} or @code{feval} whenever possible, because + they require Octave to parse input or look up the name of a function in + the symbol table. + + If you are using @code{eval} as an exception handling mechanism and not + because you need to execute some arbitrary text, use the @code{try} + statement instead. @xref{The try Statement}. + + @item + If you are calling lots of functions but none of them will need to + change during your run, set the variable + @code{ignore_function_time_stamp} to @code{"all"} so that Octave doesn't + waste a lot of time checking to see if you have updated your function + files. + @end itemize + + @node Documentation Tips, Comment Tips, Coding Tips, Tips + @section Tips for Documentation Strings + + Here are some tips for the writing of documentation strings. + + @itemize @bullet + @item + Every command, function, or variable intended for users to know about + should have a documentation string. + + @item + An internal variable or subroutine of an Octave program might as well have + a documentation string. + + @item + The first line of the documentation string should consist of one or two + complete sentences that stand on their own as a summary. + + The documentation string can have additional lines that expand on the + details of how to use the function or variable. The additional lines + should also be made up of complete sentences. + + @item + For consistency, phrase the verb in the first sentence of a + documentation string as an infinitive with ``to'' omitted. For + instance, use ``Return the frob of A and B.'' in preference to ``Returns + the frob of A and B@.'' Usually it looks good to do likewise for the + rest of the first paragraph. Subsequent paragraphs usually look better + if they have proper subjects. + + @item + Write documentation strings in the active voice, not the passive, and in + the present tense, not the future. For instance, use ``Return a list + containing A and B.'' instead of ``A list containing A and B will be + returned.'' + + @item + Avoid using the word ``cause'' (or its equivalents) unnecessarily. + Instead of, ``Cause Octave to display text in boldface,'' write just + ``Display text in boldface.'' + + @item + Do not start or end a documentation string with whitespace. + + @item + Format the documentation string so that it fits in an Emacs window on an + 80-column screen. It is a good idea for most lines to be no wider than + 60 characters. + + However, rather than simply filling the entire documentation string, you + can make it much more readable by choosing line breaks with care. + Use blank lines between topics if the documentation string is long. + + @item + @strong{Do not} indent subsequent lines of a documentation string so + that the text is lined up in the source code with the text of the first + line. This looks nice in the source code, but looks bizarre when users + view the documentation. Remember that the indentation before the + starting double-quote is not part of the string! + + @item + The documentation string for a variable that is a yes-or-no flag should + start with words such as ``Nonzero means@dots{}'', to make it clear that + all nonzero values are equivalent and indicate explicitly what zero and + nonzero mean. + + @item + When a function's documentation string mentions the value of an argument + of the function, use the argument name in capital letters as if it were + a name for that value. Thus, the documentation string of the operator + @code{/} refers to its second argument as @samp{DIVISOR}, because the + actual argument name is @code{divisor}. + + Also use all caps for meta-syntactic variables, such as when you show + the decomposition of a list or vector into subunits, some of which may + vary. + @end itemize + + @node Comment Tips, Function Headers, Documentation Tips, Tips + @section Tips on Writing Comments + + Here are the conventions to follow when writing comments. + + @table @samp + @item # + Comments that start with a single sharp-sign, @samp{#}, should all be + aligned to the same column on the right of the source code. Such + comments usually explain how the code on the same line does its job. In + the Emacs mode for Octave, the @kbd{M-;} (@code{indent-for-comment}) + command automatically inserts such a @samp{#} in the right place, or + aligns such a comment if it is already present. + + @item ## + Comments that start with two semicolons, @samp{##}, should be aligned to + the same level of indentation as the code. Such comments usually + describe the purpose of the following lines or the state of the program + at that point. + @end table + + @noindent + The indentation commands of the Octave mode in Emacs, such as @kbd{M-;} + (@code{indent-for-comment}) and @kbd{TAB} (@code{octave-indent-line}) + automatically indent comments according to these conventions, + depending on the number of semicolons. @xref{Comments,, + Manipulating Comments, emacs, The GNU Emacs Manual}. + + @node Function Headers, , Comment Tips, Tips + @section Conventional Headers for Octave Functions + @cindex header comments + + Octave has conventions for using special comments in function files + to give information such as who wrote them. This section explains these + conventions. + + The top of the file should contain a copyright notice, followed by a + block of comments that can be used as the help text for the function. + Here is an example: + + @example + ## Copyright (C) 1996 John W. Eaton + ## + ## This file is part of Octave. + ## + ## Octave is free software; you can redistribute it and/or + ## modify it under the terms of the GNU General Public + ## License as published by the Free Software Foundation; + ## either version 2, or (at your option) any later version. + ## + ## Octave is distributed in the hope that it will be useful, + ## but WITHOUT ANY WARRANTY; without even the implied + ## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + ## PURPOSE. See the GNU General Public License for more + ## details. + ## + ## You should have received a copy of the GNU General Public + ## License along with Octave; see the file COPYING. If not, + ## write to the Free Software Foundation, 59 Temple Place - + ## Suite 330, Boston, MA 02111-1307, USA. + + ## usage: [IN, OUT, PID] = popen2 (COMMAND, ARGS) + ## + ## Start a subprocess with two-way communication. COMMAND + ## specifies the name of the command to start. ARGS is an + ## array of strings containing options for COMMAND. IN and + ## OUT are the file ids of the input and streams for the + ## subprocess, and PID is the process id of the subprocess, + ## or -1 if COMMAND could not be executed. + ## + ## Example: + ## + ## [in, out, pid] = popen2 ("sort", "-nr"); + ## fputs (in, "these\nare\nsome\nstrings\n"); + ## fclose (in); + ## while (isstr (s = fgets (out))) + ## fputs (stdout, s); + ## endwhile + ## fclose (out); + @end example + + Octave uses the first block of comments in a function file that do not + appear to be a copyright notice as the help text for the file. For + Octave to recognize the first comment block as a copyright notice, it + must match the regular expression + + @example + ^ Copyright (C).*\n\n This file is part of Octave. + @end example + + @noindent + or + + @example + ^ Copyright (C).*\n\n This program is free softwar + @end example + + @noindent + (after stripping the leading comment characters). This is a fairly + strict requirement, and may be relaxed somewhat in the future. + + After the copyright notice and help text come several @dfn{header + comment} lines, each beginning with @samp{## @var{header-name}:}. For + example, + + @example + @group + ## Author: jwe + ## Keywords: subprocesses input-output + ## Maintainer: jwe + @end group + @end example + + Here is a table of the conventional possibilities for @var{header-name}: + + @table @samp + @item Author + This line states the name and net address of at least the principal + author of the library. + + @smallexample + ## Author: John W. Eaton + @end smallexample + + @item Maintainer + This line should contain a single name/address as in the Author line, or + an address only, or the string @samp{jwe}. If there is no maintainer + line, the person(s) in the Author field are presumed to be the + maintainers. The example above is mildly bogus because the maintainer + line is redundant. + + The idea behind the @samp{Author} and @samp{Maintainer} lines is to make + possible a function to ``send mail to the maintainer'' without + having to mine the name out by hand. + + Be sure to surround the network address with @samp{<@dots{}>} if + you include the person's full name as well as the network address. + + @item Created + This optional line gives the original creation date of the + file. For historical interest only. + + @item Version + If you wish to record version numbers for the individual Octave program, + put them in this line. + + @item Adapted-By + In this header line, place the name of the person who adapted the + library for installation (to make it fit the style conventions, for + example). + + @item Keywords + This line lists keywords. Eventually, it will be used by an apropos + command to allow people will find your package when they're looking for + things by topic area. To separate the keywords, you can use spaces, + commas, or both. + @end table + + Just about every Octave function ought to have the @samp{Author} and + @samp{Keywords} header comment lines. Use the others if they are + appropriate. You can also put in header lines with other header + names---they have no standard meanings, so they can't do any harm. diff -cNr octave-2.0.2/doc/interpreter/var.texi octave-2.0.3/doc/interpreter/var.texi *** octave-2.0.2/doc/interpreter/var.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/var.texi Sun Feb 16 22:48:26 1997 *************** *** 1,248 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @node Built-in Variables, Arithmetic, Functions and Scripts, Top ! @chapter Built-in Variables ! @cindex variables ! @cindex built-in variables ! @cindex variables, built-in ! ! Most Octave variables are available for you to use for your own ! purposes; they never change except when your program assigns values to ! them, and never affect anything except when your program examines them. ! ! A number of variables have special built-in meanings. Some of them, ! like @code{pi} and @code{eps} provide useful predefined constant values. ! Others, like @code{do_fortran_indexing} and @code{page_screen_output} ! are examined automatically by Octave, so that you can to tell Octave how ! to do certain things. There are also two special variables, @code{ans} ! and @code{PWD}, that are set automatically and carry information from ! the internal workings of Octave to your program. ! ! This chapter documents the built-in variables of Octave that don't seem ! to belong anywhere else. Many more of Octave's built-in variables are ! documented in the chapters that describe functions that use them, or are ! affected by their values. @menu ! * Miscellaneous Built-in Variables:: ! * Summary of Preference Variables:: @end menu ! @node Miscellaneous Built-in Variables, Summary of Preference Variables, Built-in Variables, Built-in Variables ! @section Miscellaneous Built-in Variables ! This section describes the variables that you can use to customize ! Octave's behavior. ! Normally, preferences are set in the file @file{~/.octaverc}, so that ! you can customize your environment in the same way each time you use ! Octave without having to remember and retype all the necessary commands. ! @xref{Startup Files} for more information. ! @defvr {Built-in Variable} OCTAVE_VERSION ! The version number of Octave, as a string. ! @end defvr ! @defvr {Built-in Variable} PS1 ! The primary prompt string. When executing interactively, Octave ! displays the primary prompt @code{PS1} when it is ready to read a ! command. Octave allows the prompt to be customized by inserting a ! number of backslash-escaped special characters that are decoded as ! follows: ! ! @table @samp ! @item \t ! The time. ! @item \d ! The date. ! @item \n ! Begins a new line by printing the equivalent of a carriage return ! followed by a line feed. ! @item \s ! The name of the program (usually just @code{octave}). ! @item \w ! The current working directory. ! @item \W ! The basename of the current working directory. ! @item \u ! The username of the current user. ! @item \h ! The hostname. ! @item \H ! The hostname, up to the first `.'. ! @item \# ! The command number of this command, counting from when Octave starts. ! @item \! ! The history number of this command. This differs from @samp{\#} by the ! number of commands in the history list when Octave starts. ! @item \$ ! If the effective UID is 0, a #, otherwise a $. ! @item \nnn ! The character whose character code in octal is @samp{nnn}. ! @item \\ ! A backslash. ! @end table ! The default value of @code{PS1} is @code{"\s:\#> "}. To change it, use a ! command like @example ! octave:13> PS1 = "\\u@@\\H> " @end example @noindent ! which will result in the prompt @samp{boris@@kremvax> } for the user ! @samp{boris} logged in on the host @samp{kremvax.kgb.su}. Note that two ! backslashes are required to enter a backslash into a string. ! @xref{String Constants}. ! @end defvr ! @defvr {Built-in Variable} PS2 ! The secondary prompt string, which is printed when Octave is ! expecting additional input to complete a command. For example, when ! defining a function over several lines, Octave will print the value of ! @code{PS1} at the beginning of each line after the first. Octave allows ! @code{PS2} to be customized in the same way as @code{PS1}. The default ! value of @code{PS2} is @code{"> "}. ! @end defvr ! @defvr {Built-in Variable} PS4 ! If Octave is invoked with the @code{--echo-input} option, the value of ! @code{PS4} is printed before each line of input that is echoed. Octave ! allows @code{PS4} to be customized in the same way as @code{PS1}. The ! default value of @code{PS4} is @code{"+ "}. @xref{Invoking Octave}, for ! a description of @code{--echo-input}. ! @end defvr ! @defvr {Built-in Variable} ans ! This variable holds the most recently computed result that was not ! explicitly assigned to a variable. For example, after the expression @example ! 3^2 + 4^2 @end example @noindent ! is evaluated, the value of @code{ans} is @samp{25}. ! @end defvr ! @defvr {Built-in Variable} completion_append_char ! The value of @code{completion_append_char} is used as the character to ! append to successful command-line completion attempts. The default ! value is @code{" "} (a single space). @end defvr ! @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"}. ! @end defvr ! @defvr {Built-in Variable} print_answer_id_name ! If the value of @code{print_answer_id_name} is nonzero, variable ! names are printed along with the result. Otherwise, only the result ! values are printed. The default value is 1. ! @end defvr ! @defvr {Built-in Variable} propagate_empty_matrices ! If the value of @code{propagate_empty_matrices} is nonzero, ! functions like @code{inverse} and @code{svd} will return an empty matrix ! if they are given one as an argument. The default value is 1. ! @xref{Empty Matrices}. ! @end defvr ! @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 Summary of Preference Variables, , Miscellaneous Built-in Variables, Built-in Variables ! @section Summary of Preference Variables ! Here is a summary of all of Octave's preference variables and their ! default values. In the following table @code{OCT_HOME} stands for ! the root directory where Octave is installed, @code{VERSION} stands ! for the Octave version number, and @code{SYS} stands for the type of ! system for which Octave was compiled (for example, ! @code{alpha-dec-osf3.2}). ! ! @smallexample ! EDITOR "vi" ! EXEC_PATH ":$PATH" ! INFO_FILE "OCT_HOME/info/octave.info" ! INFO_PROGRAM "OCT_HOME/libexec/octave/VERSION/exec/SYS/info" ! LOADPATH ".:OCT_HOME/lib/VERSION" ! PAGER "less", or "more" ! PS1 "\s:\#> " ! PS2 "> " ! PS4 "+ " ! automatic_replot 0 ! ! beep_on_error 0 ! completion_append_char " " ! default_return_value [] ! do_fortran_indexing 0 ! define_all_return_values 0 ! empty_list_elements_ok "warn" ! gnuplot_binary "gnuplot" ! history_file "~/.octave_hist" ! history_size 1024 ! ignore_function_time_stamp "system" ! ! implicit_str_to_num_ok 0 ! ok_to_lose_imaginary_part "warn" ! output_max_field_width 10 ! output_precision 5 ! page_screen_output 1 ! prefer_column_vectors 0 ! prefer_zero_one_indexing 0 ! print_answer_id_name 1 ! print_empty_dimensions 1 ! resize_on_range_error 1 ! ! return_last_computed_value 0 ! save_precision 17 ! saving_history 1 ! silent_functions 0 ! split_long_rows 1 ! struct_levels_to_print 2 ! suppress_verbose_help_message 1 ! treat_neg_dim_as_zero 0 ! warn_assign_as_truth_value 1 ! warn_comma_in_global_decl 1 ! ! warn_divide_by_zero 1 ! warn_function_name_clash 1 ! whitespace_in_literal_matrix "" ! @end smallexample ! ! The following variables may be set from the environment or by a command ! line option. ! ! @smallexample ! Variable Environment Variable Option ! -------- -------------------- ------ ! EDITOR EDITOR ! EXEC_PATH OCTAVE_EXEC_PATH --exec-path PATH ! LOADPATH OCTAVE_PATH --path PATH ! INFO_FILE OCTAVE_INFO_FILE --info-file FILE ! INFO_PROGRAM OCTAVE_INFO_PROGRAM --info-program PROGRAM ! history_size OCTAVE_HISTSIZE ! history_file OCTAVE_HISTFILE ! @end smallexample ! @c XXX FIXME XXX Might be nice to have a list of the settings required ! @c to have Octave behave as much like @sc{Matlab} as is possible. --- 1,555 ---- ! @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 Variables, Expressions, Data Structures, Top ! @chapter Variables ! @cindex variables, user-defined ! @cindex user-defined variables ! ! Variables let you give names to values and refer to them later. You have ! already seen variables in many of the examples. The name of a variable ! must be a sequence of letters, digits and underscores, but it may not begin ! with a digit. Octave does not enforce a limit on the length of variable ! names, but it is seldom useful to have variables with names longer than ! about 30 characters. The following are all valid variable names ! ! @cindex job hunting ! @cindex getting a good job ! @cindex flying high and fast ! @example ! @group ! x ! x15 ! __foo_bar_baz__ ! fucnrdthsucngtagdjb ! @end group ! @end example ! ! @noindent ! However, names like @code{__foo_bar_baz__} that begin and end with two ! underscores are understood to be reserved for internal use by Octave. ! You should not use them in code you write, except to access Octave's ! documented internal variables and built-in symbolic constants. ! ! Case is significant in variable names. The symbols @code{a} and ! @code{A} are distinct variables. ! ! A variable name is a valid expression by itself. It represents the ! variable's current value. Variables are given new values with ! @dfn{assignment operators} and @dfn{increment operators}. ! @xref{Assignment Ops, ,Assignment Expressions}. ! ! A number of variables have special built-in meanings. For example, ! @code{PWD} holds the current working directory, and @code{pi} names the ! ratio of the circumference of a circle to its diameter. @xref{Summary of ! Built-in Variables}, for a list of all the predefined variables. Some ! of these built-in symbols are constants and may not be changed. Others ! can be used and assigned just like all other variables, but their values ! are also used or changed automatically by Octave. ! ! Variables in Octave do not have fixed types, so it is possible to first ! store a numeric value in a variable and then to later use the same name ! to hold a string value in the same program. Variables may not be used ! before they have been given a value. Doing so results in an error. @menu ! * Global Variables:: ! * Status of Variables:: ! * Summary of Built-in Variables:: ! * Defaults from the Environment:: @end menu ! @node Global Variables, Status of Variables, Variables, Variables ! @section Global Variables ! @cindex global variables ! @cindex @code{global} statement ! @cindex variables, global ! A variable that has been declared @dfn{global} may be accessed from ! within a function body without having to pass it as a formal parameter. ! A variable may be declared global using a @code{global} declaration ! statement. The following statements are all global declarations. ! @example ! @group ! global a ! global b = 2 ! global c = 3, d, e = 5 ! @end group ! @end example ! It is necessary declare a variable as global within a function body in ! order to access it. For example, ! @example ! @group ! global x ! function f () ! x = 1; ! endfunction ! f () ! @end group ! @end example ! ! @noindent ! does @emph{not} set the value of the global variable @code{x} to 1. In ! order to change the value of the global variable @code{x}, you must also ! declare it to be global within the function body, like this @example ! @group ! function f () ! global x; ! x = 1; ! endfunction ! @end group ! @end example ! ! Passing a global variable in a function parameter list will ! make a local copy and not modify the global value. For example, given ! the function ! ! @example ! @group ! function f (x) ! x = 0 ! endfunction ! @end group @end example @noindent ! and the definition of @code{x} as a global variable at the top level, ! @example ! global x = 13 ! @end example ! @noindent ! the expression ! ! @example ! f (x) ! @end example ! @noindent ! will display the value of @code{x} from inside the function as 0, ! but the value of @code{x} at the top level remains unchanged, because ! the function works with a @emph{copy} of its argument. ! ! @defvr {Built-in Variable} warn_comma_in_global_decl ! If the value of @code{warn_comma_in_global_decl} is nonzero, a ! warning is issued for statements like @example ! global a = 1, b @end example @noindent ! which makes the variables @code{a} and @code{b} global and assigns the ! value 1 to the variable @code{a}, because in this context, the comma is ! not interpreted as a statement separator. ! The default value of @code{warn_comma_in_global_decl} is nonzero. @end defvr ! @deftypefn {Built-in Function} {} is_global (@var{name}) ! Return 1 if @var{name} is globally visible. Otherwise, return 0. For ! example, ! @example ! @group ! global x ! is_global ("x") ! @result{} 1 ! @end group ! @end example ! @end deftypefn ! @node Status of Variables, Summary of Built-in Variables, Global Variables, Variables ! @section Status of Variables ! @deffn {Command} clear options pattern @dots{} ! Delete the names matching the given patterns from the symbol table. The ! pattern may contain the following special characters: ! @table @code ! @item ? ! Match any single character. ! ! @item * ! Match zero or more characters. ! ! @item [ @var{list} ] ! Match the list of characters specified by @var{list}. If the first ! character is @code{!} or @code{^}, match all characters except those ! specified by @var{list}. For example, the pattern @samp{[a-zA-Z]} will ! match all lower and upper case alphabetic characters. ! @end table ! ! For example, the command @example ! clear foo b*r @end example @noindent ! clears the name @code{foo} and all names that begin with the letter ! @code{b} and end with the letter @code{r}. ! ! If @code{clear} is called without any arguments, all user-defined ! variables (local and global) are cleared from the symbol table. If ! @code{clear} is called with at least one argument, only the visible ! names matching the arguments are cleared. For example, suppose you have ! defined a function @code{foo}, and then hidden it by performing the ! assignment @code{foo = 2}. Executing the command @kbd{clear foo} once ! will clear the variable definition and restore the definition of ! @code{foo} as a function. Executing @kbd{clear foo} a second time will ! clear the function definition. ! ! This command may not be used within a function body. ! @end deffn ! ! @deffn {Command} who options pattern @dots{} ! @deffnx {Command} whos options pattern @dots{} ! List currently defined symbols matching the given patterns. The ! following are valid options. They may be shortened to one character but ! may not be combined. ! ! @table @code ! @item -all ! List all currently defined symbols. ! ! @item -builtins ! List built-in variables and functions. This includes all currently ! compiled function files, but does not include all function files that ! are in the @code{LOADPATH}. ! ! @item -functions ! List user-defined functions. ! ! @item -long ! Print a long listing including the type and dimensions of any symbols. ! The symbols in the first column of output indicate whether it is ! possible to redefine the symbol, and whether it is possible for it to be ! cleared. ! ! @item -variables ! List user-defined variables. ! @end table ! ! Valid patterns are the same as described for the @code{clear} command ! above. If no patterns are supplied, all symbols from the given category ! are listed. By default, only user defined functions and variables ! visible in the local scope are displayed. ! ! The command @kbd{whos} is equivalent to @kbd{who -long}. ! @end deffn ! ! @deftypefn {Built-in Function} {} exist (@var{name}) ! Return 1 if the name exists as a variable, and 2 if the name (after ! appending @samp{.m}) is a function file in the path. Otherwise, return ! 0. ! @end deftypefn ! ! @deftypefn {Built-in Function} {} document (@var{symbol}, @var{text}) ! Set the documentation string for @var{symbol} to @var{text}. ! @end deftypefn ! ! @deffn {Command} type options name @dots{} ! Display the definition of each @var{name} that refers to a function. ! ! Normally also displays if each @var{name} is user-defined or builtin; ! the @code{-q} option suppresses this behaviour. ! ! Currently, Octave can only display functions that can be compiled ! cleanly, because it uses its internal representation of the function to ! recreate the program text. ! ! Comments are not displayed because Octave's parser currently discards ! them as it converts the text of a function file to its internal ! representation. This problem may be fixed in a future release. ! @end deffn ! ! @deffn {Command} which name @dots{} ! Display the type of each @var{name}. If @var{name} is defined from a ! function file, the full name of the file is also displayed. ! @end deffn ! ! @node Summary of Built-in Variables, Defaults from the Environment, Status of Variables, Variables ! @section Summary of Built-in Variables ! ! Here is a summary of all of Octave's built-in variables along with ! cross references to additional information and their default values. In ! the following table @code{OCT_HOME} stands for the root directory where ! Octave is installed (for example, @file{@value{OCTAVEHOME}}, @code{VERSION} ! stands for the Octave version number (for example, @value{VERSION}, and ! @code{SYS} stands for the type of system for which Octave was compiled ! (for example, @code{@value{TARGETHOSTTYPE}}). ! ! @vtable @code ! @item EDITOR ! @xref{Commands For History}. ! ! Default value: @code{"vi"}. ! ! @item EXEC_PATH ! @xref{Controlling Subprocesses}. ! ! Default value: @code{":$PATH"}. ! ! @item INFO_FILE ! @xref{Getting Help}. ! ! Default value: @code{"OCT_HOME/info/octave.info"}. ! ! @item INFO_PROGRAM ! @xref{Getting Help}. ! ! Default value: @code{"OCT_HOME/libexec/octave/VERSION/exec/SYS/info"}. ! ! @item LOADPATH ! @xref{Function Files}. ! ! Default value: @code{".:OCT_HOME/lib/VERSION"}. ! ! @item PAGER ! @xref{Input and Output}. ! ! Default value: @code{"less", or "more"}. ! ! @item PS1 ! @xref{Customizing the Prompt}. ! ! Default value: @code{"\s:\#> "}. ! ! @item PS2 ! @xref{Customizing the Prompt}. ! ! Default value: @code{"> "}. ! ! @item PS4 ! @xref{Customizing the Prompt}. ! ! Default value: @code{"+ "}. ! ! @item automatic_replot ! @xref{Two-Dimensional Plotting}. ! ! Default value: 0. ! ! @item beep_on_error ! @xref{Error Handling}. ! ! Default value: 0. ! ! @item completion_append_char ! @xref{Commands For Completion}. ! ! Default value: @code{" "}. ! ! @item default_return_value ! @xref{Multiple Return Values}. ! ! Default value: @code{[]}. ! ! @item do_fortran_indexing ! @xref{Index Expressions}. ! ! Default value: 0. ! ! @item define_all_return_values ! @xref{Multiple Return Values}. ! ! Default value: 0. ! ! @item empty_list_elements_ok ! @xref{Empty Matrices}. ! ! Default value: @code{"warn"}. ! ! @item gnuplot_binary ! @xref{Three-Dimensional Plotting}. ! ! Default value: @code{"gnuplot"}. ! ! @item history_file ! @xref{Commands For History}. ! ! Default value: @code{"~/.octave_hist"}. ! ! @item history_size ! @xref{Commands For History}. ! ! Default value: 1024. ! ! @item ignore_function_time_stamp ! @xref{Function Files}. ! ! Default value: @code{"system"}. ! ! @item implicit_str_to_num_ok ! @xref{String Conversions}. ! ! Default value: 0. ! ! @item ok_to_lose_imaginary_part ! @xref{Special Utility Matrices}. ! ! Default value: @code{"warn"}. ! ! @item output_max_field_width ! @xref{Matrices}. ! ! Default value: 10. ! ! @item output_precision ! @xref{Matrices}. ! ! Default value: 5. ! ! @item page_screen_output ! @xref{Input and Output}. ! ! Default value: 1. ! ! @item prefer_column_vectors ! @xref{Index Expressions}. ! ! Default value: 0. ! ! @item prefer_zero_one_indexing ! @xref{Index Expressions}. ! ! Default value: 0. ! ! @item print_answer_id_name ! @xref{Terminal Output}. ! ! Default value: 1. ! ! @item print_empty_dimensions ! @xref{Empty Matrices}. ! ! Default value: 1. ! ! @item resize_on_range_error ! @xref{Index Expressions}. ! ! Default value: 1. ! ! @item return_last_computed_value ! @xref{Returning From a Function}. ! ! Default value: 0. ! ! @item save_precision ! @xref{Simple File I/O}. ! ! Default value: 17. ! ! @item saving_history ! @xref{Commands For History}. ! ! Default value: 1. ! ! @item silent_functions ! @xref{Defining Functions}. ! ! Default value: 0. ! ! @item split_long_rows ! @xref{Matrices}. ! ! Default value: 1. ! ! @item struct_levels_to_print ! @xref{Data Structures}. ! ! Default value: 2. ! ! @item suppress_verbose_help_message ! @xref{Getting Help}. ! ! Default value: 1. ! ! @item treat_neg_dim_as_zero ! @xref{Special Utility Matrices}. ! ! Default value: 0. ! ! @item warn_assign_as_truth_value ! @xref{The if Statement}. ! ! Default value: 1. ! ! @item warn_comma_in_global_decl ! @xref{Global Variables}. ! ! Default value: 1. ! ! @item warn_divide_by_zero ! @xref{Arithmetic Ops}. ! ! Default value: 1. ! ! @item warn_function_name_clash ! @xref{Function Files}. ! ! Default value: 1. ! ! @item whitespace_in_literal_matrix ! @xref{Matrices}. ! ! Default value: @code{""}. ! @end vtable ! ! ! @node Defaults from the Environment, , Summary of Built-in Variables, Variables ! @section Defaults from the Environment ! ! Octave uses the values of the following environment variables to set the ! default values for the corresponding built-in variables. In addition, ! the values from the environment may be overridden by command-line ! arguments. @xref{Command Line Options}. ! ! @vtable @code ! @item EDITOR ! @xref{Commands For History}. ! ! Built-in variable: @code{EDITOR}. ! ! @item OCTAVE_EXEC_PATH ! @xref{Controlling Subprocesses}. ! ! Built-in variable: @code{EXEC_PATH}. ! Command-line argument: @code{--exec-path}. ! ! @item OCTAVE_PATH ! @xref{Function Files}. ! ! Built-in variable: @code{LOADPATH}. ! Command-line argument: @code{--path}. ! ! @item OCTAVE_INFO_FILE ! @xref{Getting Help}. ! ! Built-in variable: @code{INFO_FILE}. ! Command-line argument: @code{--info-file}. ! ! @item OCTAVE_INFO_PROGRAM ! @xref{Getting Help}. ! ! Built-in variable: @code{INFO_PROGRAM}. ! Command-line argument: @code{--info-program}. ! ! @item OCTAVE_HISTSIZE ! @xref{Commands For History}. ! Built-in variable: @code{history_size}. ! @item OCTAVE_HISTFILE ! @xref{Commands For History}. ! Built-in variable: @code{history_file}. ! @end vtable diff -cNr octave-2.0.2/doc/interpreter/vr-idx.texi octave-2.0.3/doc/interpreter/vr-idx.texi *** octave-2.0.2/doc/interpreter/vr-idx.texi Wed Jan 22 11:13:31 1997 --- octave-2.0.3/doc/interpreter/vr-idx.texi Sun Feb 16 22:48:25 1997 *************** *** 1,4 **** ! @c Copyright (C) 1996 John W. Eaton @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. --- 1,4 ---- ! @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. diff -cNr octave-2.0.2/doc/liboctave/Makefile.in octave-2.0.3/doc/liboctave/Makefile.in *** octave-2.0.2/doc/liboctave/Makefile.in Fri Jan 24 22:37:23 1997 --- octave-2.0.3/doc/liboctave/Makefile.in Sun Feb 2 21:25:18 1997 *************** *** 20,29 **** SOURCES = ! TEXINFO = array.texi bugs.texi cp-idx.texi diffeq.texi error.texi \ ! factor.texi fn-idx.texi install.texi intro.texi liboctave.texi \ ! matvec.texi nleqn.texi ode.texi optim.texi preface.texi \ ! quad.texi range.texi FORMATTED = liboctave.dvi liboctave.ps liboctave.info liboctave.info-[0-9]* --- 20,29 ---- SOURCES = ! TEXINFO = array.texi bugs.texi cp-idx.texi dae.texi diffeq.texi \ ! error.texi factor.texi fn-idx.texi install.texi intro.texi \ ! liboctave.texi matvec.texi nleqn.texi nlfunc.texi ode.texi \ ! optim.texi preface.texi quad.texi range.texi FORMATTED = liboctave.dvi liboctave.ps liboctave.info liboctave.info-[0-9]* diff -cNr octave-2.0.2/doc/liboctave/conf.texi octave-2.0.3/doc/liboctave/conf.texi *** octave-2.0.2/doc/liboctave/conf.texi Mon Jan 27 00:19:16 1997 --- octave-2.0.3/doc/liboctave/conf.texi Fri Feb 14 14:46:08 1997 *************** *** 2,6 **** @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @set VERSION 2.0.2 @set OCTAVEHOME /usr/local --- 2,7 ---- @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. ! @set VERSION 2.0.3 @set OCTAVEHOME /usr/local + @set TARGETHOSTTYPE %TARGET_HOST_TYPE% diff -cNr octave-2.0.2/doc/liboctave/dae.texi octave-2.0.3/doc/liboctave/dae.texi *** octave-2.0.2/doc/liboctave/dae.texi Wed Dec 31 18:00:00 1969 --- octave-2.0.3/doc/liboctave/dae.texi Sun Feb 2 21:27:07 1997 *************** *** 0 **** --- 1,23 ---- + @node Differential Algebraic Equations, Error Handling, Ordinary Differential Equations, Top + @chapter Differential Algebraic Equations + @cindex DAE + + @deftypefn {} {}DAE (void) + @deftypefnx {} {}DAE (int @var{n}) + @deftypefnx {} {}DAE (const ColumnVector &@var{x}, double @var{time}, DAEFunc &@var{f}) + @deftypefnx {} {}DAE (const ColumnVector &@var{x}, ColumnVector &@var{xdot}, double @var{time}, DAEFunc &@var{f}) + @end deftypefn + + @deftypefn {} ColumnVector deriv (void) + @end deftypefn + + @deftypefn {} {virtual void} initialize (const ColumnVector &@var{x}, double @var{t}) + @deftypefnx {} {virtual void} initialize (const ColumnVector &@var{x}, ColumnVector &@var{xdot}, double @var{t}) + @end deftypefn + + @deftypefn {} ColumnVector integrate (double @var{t}) + @end deftypefn + + @deftypefn {} Matrix integrate (const ColumnVector &@var{tout}, Matrix &@var{xdot_out}) + @deftypefnx {} Matrix integrate (const ColumnVector &@var{tout}, Matrix &@var{xdot_out}, const ColumnVector &@var{tcrit}) + @end deftypefn diff -cNr octave-2.0.2/doc/liboctave/diffeq.texi octave-2.0.3/doc/liboctave/diffeq.texi *** octave-2.0.2/doc/liboctave/diffeq.texi Thu Jul 18 21:20:16 1996 --- octave-2.0.3/doc/liboctave/diffeq.texi Sun Feb 2 21:27:07 1997 *************** *** 1,4 **** ! @node Ordinary Differential Equations, Installation, Quadrature, Top @chapter Ordinary Differential Equations @cindex ODE --- 1,4 ---- ! @node Ordinary Differential Equations, Differential Algebraic Equations, Quadrature, Top @chapter Ordinary Differential Equations @cindex ODE *************** *** 75,102 **** @deftypefn {} Matrix integrate (const ColumnVector &@var{tout}) @deftypefnx {} Matrix integrate (const ColumnVector &@var{tout}, const ColumnVector &@var{tcrit}) @end deftypefn - - @node Differential Algebraic Equations, , Ordinary Differential Equations - @chapter Differential Algebraic Equations - @cindex DAE - - @deftypefn {} {}DAE (void) - @deftypefnx {} {}DAE (int @var{n}) - @deftypefnx {} {}DAE (const ColumnVector &@var{x}, double @var{time}, DAEFunc &@var{f}) - @deftypefnx {} {}DAE (const ColumnVector &@var{x}, ColumnVector &@var{xdot}, double @var{time}, DAEFunc &@var{f}) - @end deftypefn - - @deftypefn {} ColumnVector deriv (void) - @end deftypefn - - @deftypefn {} {virtual void} initialize (const ColumnVector &@var{x}, double @var{t}) - @deftypefnx {} {virtual void} initialize (const ColumnVector &@var{x}, ColumnVector &@var{xdot}, double @var{t}) - @end deftypefn - - @deftypefn {} ColumnVector integrate (double @var{t}) - @end deftypefn - - @deftypefn {} Matrix integrate (const ColumnVector &@var{tout}, Matrix &@var{xdot_out}) - @deftypefnx {} Matrix integrate (const ColumnVector &@var{tout}, Matrix &@var{xdot_out}, const ColumnVector &@var{tcrit}) - @end deftypefn - --- 75,77 ---- diff -cNr octave-2.0.2/doc/liboctave/error.texi octave-2.0.3/doc/liboctave/error.texi *** octave-2.0.2/doc/liboctave/error.texi Thu Jul 18 21:20:16 1996 --- octave-2.0.3/doc/liboctave/error.texi Sun Feb 2 21:27:07 1997 *************** *** 1,3 **** ! @node Error Handling @chapter Error Handling --- 1,3 ---- ! @node Error Handling, Installation, Differential Algebraic Equations, Top @chapter Error Handling diff -cNr octave-2.0.2/doc/liboctave/install.texi octave-2.0.3/doc/liboctave/install.texi *** octave-2.0.2/doc/liboctave/install.texi Thu Jul 18 21:20:16 1996 --- octave-2.0.3/doc/liboctave/install.texi Sun Feb 2 21:27:07 1997 *************** *** 1,3 **** ! @node Installation, Bugs, Ordinary Differential Equations, Top @chapter Installation @cindex installation --- 1,3 ---- ! @node Installation, Bugs, Error Handling, Top @chapter Installation @cindex installation diff -cNr octave-2.0.2/doc/liboctave/liboctave.texi octave-2.0.3/doc/liboctave/liboctave.texi *** octave-2.0.2/doc/liboctave/liboctave.texi Thu Jul 18 21:20:16 1996 --- octave-2.0.3/doc/liboctave/liboctave.texi Sun Feb 2 21:27:07 1997 *************** *** 24,30 **** @defindex op ! @c xt@include conf.texi @settitle Octave C++ Classes --- 24,30 ---- @defindex op ! @c @include conf.texi @settitle Octave C++ Classes *************** *** 98,106 **** * Matrix Factorizations:: * Ranges:: * Nonlinear Functions:: ! * Objective Functions:: * Quadrature:: * Ordinary Differential Equations:: * Installation:: * Bugs:: * Concept Index:: --- 98,109 ---- * Matrix Factorizations:: * Ranges:: * Nonlinear Functions:: ! * Nonlinear Equations:: ! * Optimization:: * Quadrature:: * Ordinary Differential Equations:: + * Differential Algebraic Equations:: + * Error Handling:: * Installation:: * Bugs:: * Concept Index:: *************** *** 115,120 **** --- 118,136 ---- Arrays * Constructors and Assignment:: + + Optimization + + * Objective Functions:: + * Bounds:: + * Linear Constraints:: + * Nonlinear Constraints:: + * Quadratic Programming:: + * Nonlinear Programming:: + + Quadrature + + * Collocation Weights:: @end menu @include preface.texi *************** *** 124,133 **** --- 140,151 ---- @include matvec.texi @include factor.texi @include range.texi + @include nlfunc.texi @include nleqn.texi @include optim.texi @include quad.texi @include diffeq.texi + @include dae.texi @include error.texi @include install.texi @include bugs.texi diff -cNr octave-2.0.2/doc/liboctave/nleqn.texi octave-2.0.3/doc/liboctave/nleqn.texi *** octave-2.0.2/doc/liboctave/nleqn.texi Thu Jul 18 21:20:16 1996 --- octave-2.0.3/doc/liboctave/nleqn.texi Sun Feb 2 21:27:07 1997 *************** *** 1,29 **** ! @node Nonlinear Functions, Objective Functions, Ranges, Top ! @chapter Nonlinear Functions ! @cindex nonlinear functions ! ! @deftypefn {} {}NLFunc (void) ! @deftypefnx {} {}NLFunc (const @var{nonlinear_fcn}) ! @deftypefnx {} {}NLFunc (const @var{nonlinear_fcn}, const @var{jacobian_fcn}) ! @deftypefnx {} {}NLFunc (const NLFunc &@var{a}) ! @end deftypefn ! ! @deftypefn {} NLFunc& {operator =} (const NLFunc &@var{a}) ! @end deftypefn ! ! @deftypefn {} nonlinear_fcn function (void) const; ! @end deftypefn ! ! @deftypefn {} NLFunc& set_function (const nonlinear_fcn @var{f}) ! @end deftypefn ! ! @deftypefn {} jacobian_fcn jacobian_function (void) const; ! @end deftypefn ! ! @deftypefn {} NLFunc& set_jacobian_function (const jacobian_fcn @var{j}) ! @end deftypefn ! ! @node Nonlinear Equations, , Nonlinear Functions @chapter Nonlinear Equations @cindex nonlinear equations --- 1,4 ---- ! @node Nonlinear Equations, Optimization, Nonlinear Functions, Top @chapter Nonlinear Equations @cindex nonlinear equations diff -cNr octave-2.0.2/doc/liboctave/nlfunc.texi octave-2.0.3/doc/liboctave/nlfunc.texi *** octave-2.0.2/doc/liboctave/nlfunc.texi Wed Dec 31 18:00:00 1969 --- octave-2.0.3/doc/liboctave/nlfunc.texi Sun Feb 2 21:27:07 1997 *************** *** 0 **** --- 1,24 ---- + @node Nonlinear Functions, Nonlinear Equations, Ranges, Top + @chapter Nonlinear Functions + @cindex nonlinear functions + + @deftypefn {} {}NLFunc (void) + @deftypefnx {} {}NLFunc (const @var{nonlinear_fcn}) + @deftypefnx {} {}NLFunc (const @var{nonlinear_fcn}, const @var{jacobian_fcn}) + @deftypefnx {} {}NLFunc (const NLFunc &@var{a}) + @end deftypefn + + @deftypefn {} NLFunc& {operator =} (const NLFunc &@var{a}) + @end deftypefn + + @deftypefn {} nonlinear_fcn function (void) const; + @end deftypefn + + @deftypefn {} NLFunc& set_function (const nonlinear_fcn @var{f}) + @end deftypefn + + @deftypefn {} jacobian_fcn jacobian_function (void) const; + @end deftypefn + + @deftypefn {} NLFunc& set_jacobian_function (const jacobian_fcn @var{j}) + @end deftypefn diff -cNr octave-2.0.2/doc/liboctave/optim.texi octave-2.0.3/doc/liboctave/optim.texi *** octave-2.0.2/doc/liboctave/optim.texi Thu Jul 18 21:20:16 1996 --- octave-2.0.3/doc/liboctave/optim.texi Sun Feb 2 21:27:07 1997 *************** *** 1,5 **** ! @node Objective Functions, Quadrature, Nonlinear Functions, Top ! @chapter Objective Functions @cindex objective functions @deftypefn {} {}Objective (void) --- 1,18 ---- ! @node Optimization, Quadrature, Nonlinear Equations, Top ! @chapter Optimization ! @cindex optimization ! ! @menu ! * Objective Functions:: ! * Bounds:: ! * Linear Constraints:: ! * Nonlinear Constraints:: ! * Quadratic Programming:: ! * Nonlinear Programming:: ! @end menu ! ! @node Objective Functions, Bounds, Optimization, Optimization ! @section Objective Functions @cindex objective functions @deftypefn {} {}Objective (void) *************** *** 25,32 **** @c ------------------------------------------------------------------------ ! @node Bounds, Linear Constraints, Objective Functions ! @chapter Bounds @cindex bounds @deftypefn {} {}Bounds (void) --- 38,45 ---- @c ------------------------------------------------------------------------ ! @node Bounds, Linear Constraints, Objective Functions, Optimization ! @section Bounds @cindex bounds @deftypefn {} {}Bounds (void) *************** *** 76,83 **** @c ------------------------------------------------------------------------ ! @node Linear Constraints, Nonlinear Constraints, Bounds ! @chapter Linear Constraints @cindex linear Constraints @deftypefn {} {}LinConst (void) --- 89,96 ---- @c ------------------------------------------------------------------------ ! @node Linear Constraints, Nonlinear Constraints, Bounds, Optimization ! @section Linear Constraints @cindex linear Constraints @deftypefn {} {}LinConst (void) *************** *** 113,120 **** @c ------------------------------------------------------------------------ ! @node Nonlinear Constraints, Quadratic Programming, Linear Constraints ! @chapter Nonlinear Constraints @cindex nonlinear Constraints @deftypefn {} {}NLConst (void) --- 126,133 ---- @c ------------------------------------------------------------------------ ! @node Nonlinear Constraints, Quadratic Programming, Linear Constraints, Optimization ! @section Nonlinear Constraints @cindex nonlinear Constraints @deftypefn {} {}NLConst (void) *************** *** 126,133 **** @deftypefn {} NLConst& {operator =} (const NLConst &@var{a}) @end deftypefn ! @node Quadratic Programming, Nonlinear Programming, Nonlinear Constraints ! @chapter Quadratic Programming @cindex QP @cindex quadratic programming --- 139,146 ---- @deftypefn {} NLConst& {operator =} (const NLConst &@var{a}) @end deftypefn ! @node Quadratic Programming, Nonlinear Programming, Nonlinear Constraints, Optimization ! @section Quadratic Programming @cindex QP @cindex quadratic programming *************** *** 208,215 **** @c ------------------------------------------------------------------------ ! @node Nonlinear Programming, , Quadratic Programming ! @chapter Nonlinear Programming @cindex NLP @cindex nonlinear programming --- 221,228 ---- @c ------------------------------------------------------------------------ ! @node Nonlinear Programming, , Quadratic Programming, Optimization ! @section Nonlinear Programming @cindex NLP @cindex nonlinear programming diff -cNr octave-2.0.2/doc/liboctave/quad.texi octave-2.0.3/doc/liboctave/quad.texi *** octave-2.0.2/doc/liboctave/quad.texi Thu Jul 18 21:20:16 1996 --- octave-2.0.3/doc/liboctave/quad.texi Sun Feb 2 21:27:07 1997 *************** *** 1,4 **** ! @node Quadrature, Ordinary Differential Equations, Objective Functions, Top @chapter Quadrature @cindex quadrature @cindex numerical integration --- 1,4 ---- ! @node Quadrature, Ordinary Differential Equations, Optimization, Top @chapter Quadrature @cindex quadrature @cindex numerical integration *************** *** 55,62 **** @deftypefnx {} {}IndefQuad (integrand_fcn @var{fcn}, double @var{abs}, double @var{rel}) @end deftypefn ! @node Collocation Weights, , Quadrature ! @chapter Collocation Weights @cindex orthogonal collocation @cindex collocation weights --- 55,66 ---- @deftypefnx {} {}IndefQuad (integrand_fcn @var{fcn}, double @var{abs}, double @var{rel}) @end deftypefn ! @menu ! * Collocation Weights:: ! @end menu ! ! @node Collocation Weights, , Quadrature, Quadrature ! @section Collocation Weights @cindex orthogonal collocation @cindex collocation weights diff -cNr octave-2.0.2/doc/texinfo.tex octave-2.0.3/doc/texinfo.tex *** octave-2.0.2/doc/texinfo.tex Thu Nov 7 13:25:22 1996 --- octave-2.0.3/doc/texinfo.tex Tue Feb 18 03:08:50 1997 *************** *** 1,7 **** ! %% TeX macros to handle texinfo files % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, ! % 94, 95, 1996 Free Software Foundation, Inc. %This texinfo.tex file is free software; you can redistribute it and/or %modify it under the terms of the GNU General Public License as --- 1,8 ---- ! %% TeX macros to handle Texinfo files. ! %% $Id: texinfo.tex,v 1.4 1997/02/18 09:08:50 jwe Exp $ % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, ! % 94, 95, 96, 97 Free Software Foundation, Inc. %This texinfo.tex file is free software; you can redistribute it and/or %modify it under the terms of the GNU General Public License as *************** *** 35,41 **** % This automatically updates the version number based on RCS. \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} ! \deftexinfoversion$Revision: 1.2 $ \message{Loading texinfo package [Version \texinfoversion]:} % If in a .fmt file, print the version number --- 36,42 ---- % This automatically updates the version number based on RCS. \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} ! \deftexinfoversion$Revision: 1.4 $ \message{Loading texinfo package [Version \texinfoversion]:} % If in a .fmt file, print the version number *************** *** 59,65 **** \let\ptexrbrace=\} \let\ptexstar=\* \let\ptext=\t - \let\ptextilde=\~ % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space --- 60,65 ---- *************** *** 72,78 **** \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } - \let\~ = \tie % And make it available as @~. \message{Basics,} --- 72,77 ---- *************** *** 104,111 **** \hyphenation{eshell} % Margin to add to right of even pages, to left of odd pages. ! \newdimen \bindingoffset ! \newdimen \normaloffset \newdimen\pagewidth \newdimen\pageheight % Sometimes it is convenient to have everything in the transcript file --- 103,110 ---- \hyphenation{eshell} % Margin to add to right of even pages, to left of odd pages. ! \newdimen \bindingoffset ! \newdimen \normaloffset \newdimen\pagewidth \newdimen\pageheight % Sometimes it is convenient to have everything in the transcript file *************** *** 136,157 **** % %---------------------End change----------------------- % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. - \chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}} \def\onepageout#1{% \hoffset=\normaloffset \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi {% ! \escapechar = `\\ % use backslash in output files. ! \indexdummies \shipout\vbox{% ! {\let\hsize=\pagewidth \makeheadline}% \pagebody{#1}% ! {\let\hsize=\pagewidth \makefootline}% }% - }% \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } --- 135,173 ---- % %---------------------End change----------------------- + % Main output routine. + \chardef\PAGE = 255 + \output = {\onepageout{\pagecontents\PAGE}} + + \newbox\headlinebox \newbox\footlinebox + % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. \def\onepageout#1{% \hoffset=\normaloffset \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi + % + % Do this outside of the \shipout so @code etc. will be expanded in + % the headline as they should be, not taken literally (outputting ''code). + \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% + \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% + % {% ! % Have to do this stuff outside the \shipout because we want it to ! % take effect in \write's, yet the group defined by the \vbox ends ! % before the \shipout runs. ! % ! \escapechar = `\\ % use backslash in output files. ! \indexdummies % don't expand commands in the output. ! \normalturnoffactive % \ in index entries must not stay \, e.g., if ! % the page break happens to be in the middle of an example. \shipout\vbox{% ! \unvbox\headlinebox \pagebody{#1}% ! \unvbox\footlinebox ! }% }% \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } *************** *** 850,856 **** % didn't need it. Make sure the catcode of space is correct to avoid % losing inside @example, for instance. % ! \def\set{\begingroup\catcode` =10 \parsearg\setxxx} \def\setxxx#1{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% \def\temp{#2}% --- 866,874 ---- % didn't need it. Make sure the catcode of space is correct to avoid % losing inside @example, for instance. % ! \def\set{\begingroup\catcode` =10 ! \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. ! \parsearg\setxxx} \def\setxxx#1{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% \def\temp{#2}% *************** *** 871,880 **** % @value{foo} gets the text saved in variable foo. % ! \def\value#1{\expandafter ! \ifx\csname SET#1\endcsname\relax ! {\{No value for ``#1''\}} ! \else \csname SET#1\endcsname \fi} % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. --- 889,904 ---- % @value{foo} gets the text saved in variable foo. % ! \def\value{\begingroup ! \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. ! \valuexxx} ! \def\valuexxx#1{% ! \expandafter\ifx\csname SET#1\endcsname\relax ! {\{No value for ``#1''\}}% ! \else ! \csname SET#1\endcsname ! \fi ! \endgroup} % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. *************** *** 927,934 **** % At the `@end #1', redefine \E#1 to be its previous value. \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% }% ! \temp ! } % We need to expand lots of \csname's, but we don't want to expand the % control sequences after we've constructed them. --- 951,957 ---- % At the `@end #1', redefine \E#1 to be its previous value. \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% }% ! \temp} % We need to expand lots of \csname's, but we don't want to expand the % control sequences after we've constructed them. *************** *** 1289,1304 **** { \catcode`\-=\active \catcode`\_=\active \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} % The following is used by \doprintindex to insure that long function names % wrap around. It is necessary for - and _ to be active before the index is % read from the file, as \entry parses the arguments long before \code is % ever called. -- mycroft ! \global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder} } \def\realdash{-} - \def\realunder{_} \def\codedash{-\discretionary{}{}{}} \def\codeunder{\normalunderscore\discretionary{}{}{}} \def\codex #1{\tclose{#1}\endgroup} --- 1312,1332 ---- { \catcode`\-=\active \catcode`\_=\active + \catcode`\|=\active \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} % The following is used by \doprintindex to insure that long function names % wrap around. It is necessary for - and _ to be active before the index is % read from the file, as \entry parses the arguments long before \code is % ever called. -- mycroft ! % _ is always active; and it shouldn't be \let = to an _ that is a ! % subscript character anyway. Then, @cindex @samp{_} (for example) ! % fails. --karl ! \global\def\indexbreaks{% ! \catcode`\-=\active \let-\realdash ! } } \def\realdash{-} \def\codedash{-\discretionary{}{}{}} \def\codeunder{\normalunderscore\discretionary{}{}{}} \def\codex #1{\tclose{#1}\endgroup} *************** *** 1318,1324 **** % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. ! % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Typeset a dimension, e.g., `in' or `pt'. The only reason for the --- 1346,1352 ---- % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. ! % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Typeset a dimension, e.g., `in' or `pt'. The only reason for the *************** *** 1879,1885 **** % To make preamble: % ! % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % --- 1907,1913 ---- % To make preamble: % ! % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % *************** *** 1897,1909 **** % the preamble, break the line within one argument and it % will parse correctly, i.e., % ! % @multitable {Column 1 template} {Column 2 template} {Column 3 % template} % Not: ! % @multitable {Column 1 template} {Column 2 template} % {Column 3 template} ! % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. --- 1925,1937 ---- % the preamble, break the line within one argument and it % will parse correctly, i.e., % ! % @multitable {Column 1 template} {Column 2 template} {Column 3 % template} % Not: ! % @multitable {Column 1 template} {Column 2 template} % {Column 3 template} ! % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. *************** *** 1915,1929 **** % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col ! % @item ! % first col stuff ! % @tab ! % second col stuff ! % @tab ! % third col ! % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. ! % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable --- 1943,1957 ---- % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col ! % @item ! % first col stuff ! % @tab ! % second col stuff ! % @tab ! % third col ! % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. ! % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable *************** *** 1937,1943 **** % 0pt means it depends on current normal line spacing. %%%% ! % Dimensions \newskip\multitableparskip \newskip\multitableparindent --- 1965,1971 ---- % 0pt means it depends on current normal line spacing. %%%% ! % Dimensions \newskip\multitableparskip \newskip\multitableparindent *************** *** 2007,2024 **** % To parse everything between @multitable and @item : \setuptable#1 \endsetuptable % Need to reset this to 0 after \setuptable. ! \global\colcount=0\relax% % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. ! % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup&\global\advance\colcount by 1\relax% \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. ! % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % If user has set preamble in terms of percent of \hsize % we will use that dimension as the width of the column, and --- 2035,2052 ---- % To parse everything between @multitable and @item : \setuptable#1 \endsetuptable % Need to reset this to 0 after \setuptable. ! \global\colcount=0\relax% % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. ! % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup&\global\advance\colcount by 1\relax% \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. ! % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % If user has set preamble in terms of percent of \hsize % we will use that dimension as the width of the column, and *************** *** 2030,2048 **** \ifsetpercent \else % If user has set preamble in terms of percent of \hsize ! % we will advance \hsize by \multitablecolspace \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi ! \noindent##\multistrut}\cr% % \everycr will reset column counter, \colcount, at the end of ! % each line. Every column entry will cause \colcount to advance by one. % The table preamble % looks at the current \colcount to find the correct column width. \global\everycr{\noalign{% ! \filbreak%% keeps underfull box messages off when table breaks over pages. \global\colcount=0\relax}} } --- 2058,2088 ---- \ifsetpercent \else % If user has set preamble in terms of percent of \hsize ! % we will advance \hsize by \multitablecolspace \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi ! % Ignoring space at the beginning and end avoids an occasional spurious ! % blank line, when TeX decides to break the line at the space before the ! % box from the multistrut, so the strut ends up on a line by itself. ! % For example: ! % @multitable @columnfractions .11 .89 ! % @item @code{#} ! % @tab Legal holiday which is valid in major parts of the whole country. ! % Is automatically provided with highlighting sequences respectively marking ! % characters. ! \noindent\ignorespaces##\unskip\multistrut}\cr % \everycr will reset column counter, \colcount, at the end of ! % each line. Every column entry will cause \colcount to advance by one. % The table preamble % looks at the current \colcount to find the correct column width. \global\everycr{\noalign{% ! % \filbreak%% keeps underfull box messages off when table breaks over pages. ! % Maybe so, but it also creates really weird page breaks when the table ! % breaks over pages Wouldn't \vfil be better? Wait until the problem ! % manifests itself, so it can be fixed for real --karl. \global\colcount=0\relax}} } *************** *** 2054,2060 **** %% to keep lines equally spaced \let\multistrut = \strut %% Test to see if parskip is larger than space between lines of ! %% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. \else \gdef\multistrut{\vrule height\multitablelinespace depth\dp0 --- 2094,2100 ---- %% to keep lines equally spaced \let\multistrut = \strut %% Test to see if parskip is larger than space between lines of ! %% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. \else \gdef\multistrut{\vrule height\multitablelinespace depth\dp0 *************** *** 2296,2302 **** \indexdummies % Must do this here, since \bf, etc expand at this stage \escapechar=`\\ {% ! \let\folio=0 % We will expand all macros now EXCEPT \folio. \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % --- 2336,2342 ---- \indexdummies % Must do this here, since \bf, etc expand at this stage \escapechar=`\\ {% ! \let\folio=0% We will expand all macros now EXCEPT \folio. \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % *************** *** 2570,2576 **** \endgroup % Back to normal single-column typesetting, but take account of the % fact that we just accumulated some stuff on the output page. ! \pagegoal=\vsize } \def\balancecolumns{% % Called on the last page of the double column material. --- 2610,2616 ---- \endgroup % Back to normal single-column typesetting, but take account of the % fact that we just accumulated some stuff on the output page. ! \pagegoal=\vsize } \def\balancecolumns{% % Called on the last page of the double column material. *************** *** 3096,3102 **** % Print any size section title. ! % % #1 is the section type (sec/subsec/subsubsec), #2 is the section % number (maybe empty), #3 the text. \def\sectionheading#1#2#3{% --- 3136,3142 ---- % Print any size section title. ! % % #1 is the section type (sec/subsec/subsubsec), #2 is the section % number (maybe empty), #3 the text. \def\sectionheading#1#2#3{% *************** *** 3348,3361 **** \escapechar=`\\ % \let\,=\ptexcomma - \let\~=\ptextilde \let\{=\ptexlbrace \let\}=\ptexrbrace \let\.=\ptexdot \let\*=\ptexstar ! \let\dots=\ptexdots ! \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}} ! \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi} \def\@{@}% \let\bullet=\ptexbullet \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext --- 3388,3400 ---- \escapechar=`\\ % \let\,=\ptexcomma \let\{=\ptexlbrace \let\}=\ptexrbrace \let\.=\ptexdot \let\*=\ptexstar ! \let\dots=\ptexdots% ! \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% ! \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% \let\bullet=\ptexbullet \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext *************** *** 3729,3735 **** % This is used for \def{tp,vr}parsebody. It could probably be used for % some of the others, too, with some judicious conditionals. ! % \def\parsebodycommon#1#2#3{% \begingroup\inENV % \medbreak % --- 3768,3774 ---- % This is used for \def{tp,vr}parsebody. It could probably be used for % some of the others, too, with some judicious conditionals. ! % \def\parsebodycommon#1#2#3{% \begingroup\inENV % \medbreak % *************** *** 3763,3779 **** } % Fine, but then we have to eventually remove the \empty *and* the ! % braces (if any). That's what this does, putting the result in \tptemp. ! % ! \def\removeemptybraces\empty#1\relax{\def\tptemp{#1}}% % After \spacesplit has done its work, this is called -- #1 is the final % thing to call, #2 the type name (which starts with \empty), and #3 % (which might be empty) the arguments. ! % \def\parsetpheaderline#1#2#3{% ! \removeemptybraces#2\relax ! #1{\tptemp}{#3}% }% \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % --- 3802,3817 ---- } % Fine, but then we have to eventually remove the \empty *and* the ! % braces (if any). That's what this does. ! % ! \def\removeemptybraces\empty#1\relax{#1} % After \spacesplit has done its work, this is called -- #1 is the final % thing to call, #2 the type name (which starts with \empty), and #3 % (which might be empty) the arguments. ! % \def\parsetpheaderline#1#2#3{% ! #1{\removeemptybraces#2\relax}{#3}% }% \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % *************** *** 4007,4025 **** \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} ! % #1 is the data type. #2 is the name. \def\deftypevarheader #1#2{% ! \doind {vr}{\code{#2}}% Make entry in variables index \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% \interlinepenalty=10000 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 \endgroup} % @deftypevr {Global Flag} int enable \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} ! \def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}% \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} \interlinepenalty=10000 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 --- 4045,4065 ---- \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} ! % #1 is the data type. #2 is the name, perhaps followed by text that ! % is actually part of the data type, which should not be put into the index. \def\deftypevarheader #1#2{% ! \dovarind#2 \relax% Make entry in variables index \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% \interlinepenalty=10000 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 \endgroup} + \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} % @deftypevr {Global Flag} int enable \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} ! \def\deftypevrheader #1#2#3{\dovarind#3 \relax% \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} \interlinepenalty=10000 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 *************** *** 4142,4148 **** % Use \turnoffactive so that punctuation chars such as underscore % work in node names. ! \def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat% \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% \next}} --- 4182,4188 ---- % Use \turnoffactive so that punctuation chars such as underscore % work in node names. ! \def\dosetq #1#2{{\let\folio=0 \turnoffactive \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% \next}} *************** *** 4211,4294 **** #2% Output the suffix in any case. } - % Read the last existing aux file, if any. No error if none exists. - % This is the macro invoked by entries in the aux file. ! \def\xrdef #1#2{ ! {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}} ! \def\readauxfile{% ! \begingroup ! \catcode `\^^@=\other ! \catcode `\=\other ! \catcode `\=\other ! \catcode `\^^C=\other ! \catcode `\^^D=\other ! \catcode `\^^E=\other ! \catcode `\^^F=\other ! \catcode `\^^G=\other ! \catcode `\^^H=\other ! \catcode `\ =\other ! \catcode `\^^L=\other ! \catcode `\=\other ! \catcode `\=\other ! \catcode `\=\other ! \catcode `\=\other ! \catcode `\=\other ! \catcode `\=\other ! \catcode `\=\other ! \catcode `\=\other ! \catcode `\=\other ! \catcode `\=\other ! \catcode `\=\other ! \catcode `\=\other ! \catcode 26=\other ! \catcode `\^^[=\other ! \catcode `\^^\=\other ! \catcode `\^^]=\other ! \catcode `\^^^=\other ! \catcode `\^^_=\other ! \catcode `\@=\other ! \catcode `\^=\other ! \catcode `\~=\other ! \catcode `\[=\other ! \catcode `\]=\other ! \catcode`\"=\other ! \catcode`\_=\other ! \catcode`\|=\other ! \catcode`\<=\other ! \catcode`\>=\other ! \catcode `\$=\other ! \catcode `\#=\other ! \catcode `\&=\other ! % `\+ does not work, so use 43. ! \catcode 43=\other ! % Make the characters 128-255 be printing characters ! {% ! \count 1=128 ! \def\loop{% ! \catcode\count 1=\other ! \advance\count 1 by 1 ! \ifnum \count 1<256 \loop \fi }% ! }% ! % the aux file uses ' as the escape. ! % Turn off \ as an escape so we do not lose on ! % entries which were dumped with control sequences in their names. ! % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ ! % Reference to such entries still does not work the way one would wish, ! % but at least they do not bomb out when the aux file is read in. ! \catcode `\{=1 \catcode `\}=2 ! \catcode `\%=\other ! \catcode `\'=0 ! \catcode`\^=7 % to make ^^e4 etc usable in xref tags ! \catcode `\\=\other ! \openin 1 \jobname.aux ! \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue ! \global\warnedobstrue ! \fi ! % Open the new aux file. Tex will close it automatically at exit. ! \openout \auxfile=\jobname.aux \endgroup} --- 4251,4351 ---- #2% Output the suffix in any case. } % This is the macro invoked by entries in the aux file. ! \def\xrdef #1#2{{% ! \catcode`\'=\other ! \expandafter\gdef\csname X#1\endcsname{#2}% ! }} ! % Read the last existing aux file, if any. No error if none exists. ! \def\readauxfile{\begingroup ! \catcode`\^^@=\other ! \catcode`\=\other ! \catcode`\=\other ! \catcode`\^^C=\other ! \catcode`\^^D=\other ! \catcode`\^^E=\other ! \catcode`\^^F=\other ! \catcode`\^^G=\other ! \catcode`\^^H=\other ! \catcode`\ =\other ! \catcode`\^^L=\other ! \catcode`\=\other ! \catcode`\=\other ! \catcode`\=\other ! \catcode`\=\other ! \catcode`\=\other ! \catcode`\=\other ! \catcode`\=\other ! \catcode`\=\other ! \catcode`\=\other ! \catcode`\=\other ! \catcode`\=\other ! \catcode`\=\other ! \catcode26=\other ! \catcode`\^^[=\other ! \catcode`\^^\=\other ! \catcode`\^^]=\other ! \catcode`\^^^=\other ! \catcode`\^^_=\other ! \catcode`\@=\other ! \catcode`\^=\other ! % It was suggested to define this as 7, which would allow ^^e4 etc. ! % in xref tags, i.e., node names. But since ^^e4 notation isn't ! % supported in the main text, it doesn't seem desirable. Furthermore, ! % that is not enough: for node names that actually contain a ^ ! % character, we would end up writing a line like this: 'xrdef {'hat ! % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first ! % argument, and \hat is not an expandable control sequence. It could ! % all be worked out, but why? Either we support ^^ or we don't. ! % ! % The other change necessary for this was to define \auxhat: ! % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter ! % and then to call \auxhat in \setq. ! % ! \catcode`\~=\other ! \catcode`\[=\other ! \catcode`\]=\other ! \catcode`\"=\other ! \catcode`\_=\other ! \catcode`\|=\other ! \catcode`\<=\other ! \catcode`\>=\other ! \catcode`\$=\other ! \catcode`\#=\other ! \catcode`\&=\other ! % `\+ does not work, so use 43. ! \catcode43=\other ! % Make the characters 128-255 be printing characters ! {% ! \count 1=128 ! \def\loop{% ! \catcode\count 1=\other ! \advance\count 1 by 1 ! \ifnum \count 1<256 \loop \fi ! }% }% ! % The aux file uses ' as the escape (for now). ! % Turn off \ as an escape so we do not lose on ! % entries which were dumped with control sequences in their names. ! % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ ! % Reference to such entries still does not work the way one would wish, ! % but at least they do not bomb out when the aux file is read in. ! \catcode`\{=1 ! \catcode`\}=2 ! \catcode`\%=\other ! \catcode`\'=0 ! \catcode`\\=\other ! % ! \openin 1 \jobname.aux ! \ifeof 1 \else ! \closein 1 ! \input \jobname.aux ! \global\havexrefstrue ! \global\warnedobstrue ! \fi ! % Open the new aux file. TeX will close it automatically at exit. ! \openout\auxfile=\jobname.aux \endgroup} *************** *** 4329,4335 **** % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % ! \long\gdef\footnotezzz#1{\insert\footins{% % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. --- 4386,4396 ---- % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % ! % Oh yes, they do; otherwise, @ifset and anything else that uses ! % \parseargline fail inside footnotes because the tokens are fixed when ! % the footnote is read. --karl, 16nov96. ! % ! \long\gdef\footnotezzz{\insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. *************** *** 4351,4358 **** % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut ! #1\strut}% } }%end \catcode `\@=11 --- 4412,4424 ---- % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut ! \futurelet\next\fo@t } + \def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t + \else\let\next\f@t\fi \next} + \def\f@@t{\bgroup\aftergroup\@foot\let\next} + \def\f@t#1{#1\@foot} + \def\@foot{\strut\egroup} }%end \catcode `\@=11 *************** *** 4584,4590 **** \def~{{\tt \char '176}} \chardef\hat=`\^ \catcode`\^=\active - \def\auxhat{\def^{'hat}} \def^{{\tt \hat}} \catcode`\_=\active --- 4650,4655 ---- diff -cNr octave-2.0.2/examples/Makefile.in octave-2.0.3/examples/Makefile.in *** octave-2.0.2/examples/Makefile.in Fri Jan 24 22:37:14 1997 --- octave-2.0.3/examples/Makefile.in Tue Feb 18 00:33:35 1997 *************** *** 16,26 **** INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ SCRIPTS = info-emacs-info info-emacs-octave-help ! SOURCES = hello.cc make_int.cc DISTFILES = Makefile.in $(SOURCES) $(SCRIPTS) --- 16,27 ---- INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_DATA = @INSTALL_DATA@ SCRIPTS = info-emacs-info info-emacs-octave-help ! SOURCES = hello.cc oregonator.m oregonator.cc make_int.cc DISTFILES = Makefile.in $(SOURCES) $(SCRIPTS) *************** *** 34,39 **** --- 35,43 ---- .PHONY: all install: + for f in $(SCRIPTS); do \ + $(INSTALL_SCRIPT) $(srcdir)/$$f $(archlibdir)/$$f ; \ + done .PHONY: install tags: diff -cNr octave-2.0.2/examples/info-emacs-octave-help octave-2.0.3/examples/info-emacs-octave-help *** octave-2.0.2/examples/info-emacs-octave-help Thu Jul 11 14:40:38 1996 --- octave-2.0.3/examples/info-emacs-octave-help Mon Feb 3 23:50:44 1997 *************** *** 1,9 **** #!/bin/sh # info-emacs-octave-help ! # Written by Kurt Hornik on 1996/07/01 # Make Octave's `help -i' use Emacs octave-help. ! # Requires a running Emacs and gnuserv, and installed `octave.el'. ! cmd="(require 'octave)" if [ $3 = "--directory" ]; then cmd="$cmd (add-to-list 'Info-directory-list \"$4\")" --- 1,10 ---- #!/bin/sh # info-emacs-octave-help ! # Written by KH on 1996/07/01 ! # Updated by KH on 1997/01/30 # Make Octave's `help -i' use Emacs octave-help. ! # Requires a running Emacs and gnuserv. ! cmd="(load \"octave-hlp\")" if [ $3 = "--directory" ]; then cmd="$cmd (add-to-list 'Info-directory-list \"$4\")" diff -cNr octave-2.0.2/examples/oregonator.cc octave-2.0.3/examples/oregonator.cc *** octave-2.0.2/examples/oregonator.cc Wed Dec 31 18:00:00 1969 --- octave-2.0.3/examples/oregonator.cc Tue Feb 18 00:32:38 1997 *************** *** 0 **** --- 1,17 ---- + #include + + #include + + DEFUN_DLD (oregonator, args, , + "The `oregonator'.") + { + ColumnVector dx (3); + + ColumnVector x = args(0).vector_value (); + + dx(0) = 77.27 * (x(1) - x(0)*x(1) + x(0) - 8.375e-06*pow (x(0), 2)); + dx(1) = (x(2) - x(0)*x(1) - x(1)) / 77.27; + dx(2) = 0.161*(x(0) - x(2)); + + return octave_value (dx); + } diff -cNr octave-2.0.2/examples/oregonator.m octave-2.0.3/examples/oregonator.m *** octave-2.0.2/examples/oregonator.m Wed Dec 31 18:00:00 1969 --- octave-2.0.3/examples/oregonator.m Tue Feb 18 00:33:02 1997 *************** *** 0 **** --- 1,11 ---- + ## The `oregonator'. + + function dx = oregonator (x, t) + + dx = zeros (3, 1); + + dx(1) = 77.27*(x(2) - x(1)*x(2) + x(1) - 8.375e-06*x(1)^2); + dx(2) = (x(3) - x(1)*x(2) - x(2)) / 77.27; + dx(3) = 0.161*(x(1) - x(3)); + + end diff -cNr octave-2.0.2/glob/Makefile octave-2.0.3/glob/Makefile *** octave-2.0.2/glob/Makefile Wed Dec 31 18:00:00 1969 --- octave-2.0.3/glob/Makefile Tue Feb 18 12:05:03 1997 *************** *** 0 **** --- 1,70 ---- + # Generated automatically from Makefile.in by configure. + # Makefile for standalone distribution of libglob.a (fnmatch, glob). + + # Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc. + # This file is part of the GNU C Library. + + # This library is free software; you can redistribute it and/or + # modify it under the terms of the GNU Library General Public License + # as published by the Free Software Foundation; either version 2 of + # the License, or (at your option) any later version. + + # This library is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + # Library General Public License for more details. + + # You should have received a copy of the GNU Library General Public + # License along with this library; see the file COPYING.LIB. If + # not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + # Boston, MA 02111-1307, USA. + + # Ultrix 2.2 make doesn't expand the value of VPATH. + # This must repeat the value, because configure will remove `VPATH = .'. + srcdir = . + + CC = gcc + CPPFLAGS = + CFLAGS = -g -O2 + + # Information determined by configure. + DEFS = -DSTDC_HEADERS=1 -DHAVE_MEMORY_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_DIRENT_H=1 -DHAVE_BCOPY=1 -DHAVE_BZERO=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRCOLL=1 + + # How to invoke ar. + AR = ar + ARFLAGS = rv + + # How to invoke ranlib. + RANLIB = ranlib + + .PHONY: all + all: libglob.a + + libglob.a: glob.o fnmatch.o + $(AR) $(ARFLAGS) $@ glob.o fnmatch.o + $(RANLIB) $@ + + # For some reason, Unix make wants the dependencies on the source files. + # Otherwise it refuses to use an implicit rule! + # And, get this: it doesn't work to use $(srcdir)/foo.c!! + glob.o: $(srcdir)/glob.h $(srcdir)/fnmatch.h glob.c + fnmatch.o: $(srcdir)/fnmatch.h fnmatch.c + + .c.o: + $(CC) -I. -I$(srcdir) -c \ + $(DEFS) $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION) + + .PHONY: clean maintainer-clean glob-clean glob-maintainer-clean distclean + clean glob-clean distclean glob-maintainer-clean:: + -rm -f libglob.a *.o core + + distclean glob-maintainer-clean:: + -rm -f TAGS tags Makefile config.status config.h config.log + + realclean: distclean + + # For inside the C library. + glob.tar glob.tar.Z: + $(MAKE) -C .. $@ + + install: diff -cNr octave-2.0.2/install-octave octave-2.0.3/install-octave *** octave-2.0.2/install-octave Mon Jan 27 19:35:15 1997 --- octave-2.0.3/install-octave Fri Feb 14 16:29:23 1997 *************** *** 214,245 **** cp info/info $archlibdir/info chmod 755 $archlibdir/info ! echo "installing shared libraries in $libdir" ! for f in `cat LIBRARIES` ! do ! file=`basename $f` ! cp $f $libdir/$file ! chmod 644 $libdir/$file ! done ! echo "installing .oct files in $octfiledir" ! cd src ! for f in `find . -name '*.oct' -print` ! do ! file=`basename $f` ! cp $f $octfiledir/$file ! chmod 755 $octfiledir/$file ! done ! if test -f links-to-make; then ! cat links-to-make | while read src dest do ! if test -n "$src" && test -n "$dest"; then ! cd $octfiledir ! ln $src $dest ! fi done fi - cd $distdir echo "installing .m files in $fcnfiledir" cd scripts --- 214,250 ---- cp info/info $archlibdir/info chmod 755 $archlibdir/info ! if test -f LIBRARIES; then ! echo "installing shared libraries in $libdir" ! for f in `cat LIBRARIES` ! do ! file=`basename $f` ! cp $f $libdir/$file ! chmod 644 $libdir/$file ! done ! fi ! oct_files=`find . -name '*.oct' -print` ! if test -n "$oct_files"; then ! echo "installing .oct files in $octfiledir" ! cd src ! for f in $oct_files do ! file=`basename $f` ! cp $f $octfiledir/$file ! chmod 755 $octfiledir/$file done + if test -f links-to-make; then + cat links-to-make | while read src dest + do + if test -n "$src" && test -n "$dest"; then + cd $octfiledir + ln $src $dest + fi + done + fi + cd $distdir fi echo "installing .m files in $fcnfiledir" cd scripts diff -cNr octave-2.0.2/kpathsea/CVS/Entries octave-2.0.3/kpathsea/CVS/Entries *** octave-2.0.2/kpathsea/CVS/Entries Sat Jan 25 22:40:03 1997 --- octave-2.0.3/kpathsea/CVS/Entries Fri Feb 14 16:31:37 1997 *************** *** 32,38 **** /concatn.c/1.2/Sun Jun 25 19:56:32 1995// /concatn.h/1.2/Sun Jun 25 19:56:32 1995// /config.h/1.2/Sun Jun 25 19:56:32 1995// - /configure.in/1.1/Fri Jul 19 01:53:43 1996// /copying.texi/1.1/Fri Jul 19 01:53:34 1996// /db.c/1.2/Sun Jun 25 19:56:32 1995// /db.h/1.2/Sun Jun 25 19:56:32 1995// --- 32,37 ---- *************** *** 120,124 **** /c-unistd.h/1.3/Sun Nov 3 21:36:44 1996// /config.guess/1.3/Tue Dec 3 17:48:21 1996// /config.sub/1.3/Fri Dec 6 00:58:45 1996// ! /ChangeLog/1.7/Sun Jan 26 04:34:07 1997// ! /Makefile.in/1.12/Sat Jan 25 05:24:58 1997// --- 119,124 ---- /c-unistd.h/1.3/Sun Nov 3 21:36:44 1996// /config.guess/1.3/Tue Dec 3 17:48:21 1996// /config.sub/1.3/Fri Dec 6 00:58:45 1996// ! /configure.in/1.2/Fri Feb 14 03:13:37 1997// ! /ChangeLog/1.9/Fri Feb 14 03:36:46 1997// ! /Makefile.in/1.15/Fri Feb 14 22:22:16 1997// diff -cNr octave-2.0.2/kpathsea/ChangeLog octave-2.0.3/kpathsea/ChangeLog *** octave-2.0.2/kpathsea/ChangeLog Sat Jan 25 22:34:07 1997 --- octave-2.0.3/kpathsea/ChangeLog Thu Feb 13 21:36:46 1997 *************** *** 1,3 **** --- 1,12 ---- + Thu Feb 13 17:35:20 1997 John W. Eaton + + * configure.in: Update config for shared libraries. + * Makefile.in (stamp-shared): Use $(SH_LD) $(SH_LDFLAGS) instead + of $(CXX) -shared. + (tex-file.o, pic/tex-file.o, gmalloc.o, pic/gmalloc.o): Update rules. + + * Makefile.in (stamp-picdir): Silence noise about making pic. + Sat Jan 25 22:33:56 1997 John W. Eaton * Makefile.in (bin-dist): New target. diff -cNr octave-2.0.2/kpathsea/Makefile octave-2.0.3/kpathsea/Makefile *** octave-2.0.2/kpathsea/Makefile Wed Dec 31 18:00:00 1969 --- octave-2.0.3/kpathsea/Makefile Tue Feb 18 12:05:09 1997 *************** *** 0 **** --- 1,894 ---- + # Generated automatically from Makefile.in by configure. + # Makefile for kpathsea --kb@cs.umb.edu. + version = 2.52 + + # paths.make -- installation directories. + # + # The compile-time paths are defined in kpathsea/paths.h, which is built + # from kpathsea/paths.h.in and these definitions. See kpathsea/INSTALL + # for a description of how the various path-related files are used and + # created. + + # Do not change prefix and exec_prefix in Makefile.in! + # configure doesn't propagate the change to the other Makefiles. + # Instead, give the -prefix/-exec-prefix options to configure. + # (See kpathsea/INSTALL for more details.) This is arguably + # a bug, but it's not likely to change soon. + prefix = /usr/local + exec_prefix = ${prefix} + + # Architecture-dependent executables. + bindir = $(exec_prefix)/bin + + # Architecture-independent executables. + scriptdir = $(bindir) + + # Architecture-dependent files, such as lib*.a files. + libdir = $(exec_prefix)/lib + + # Architecture-independent files. + datadir = $(prefix)/lib + + # Header files. + includedir = $(prefix)/include + + # GNU .info* files. + infodir = $(prefix)/info + + # Unix man pages. + manext = 1 + mandir = $(prefix)/man/man$(manext) + + # TeX & MF-specific directories. Not all of the following are relevant + # for all programs, but it seems cleaner to collect everything in one place. + + # The default paths are now in kpathsea/paths.h.in. Passing all the + # paths to sub-makes can make the arg list too long on system V. + + # The root of the tree. + texmf = $(datadir)/texmf + + # TeX and MF source files. + texinputdir = $(texmf)/tex + mfinputdir = $(texmf)/mf + + # MakeTeXPK.site, texmf.cnf, etc. + web2cdir = $(texmf)/web2c + + # The top-level font directory. + fontdir = $(texmf)/fonts + + # Memory dumps (.fmt and .base). + fmtdir = $(texmf)/ini + basedir = $(fmtdir) + + # Pool files. + texpooldir = $(texmf)/ini + mfpooldir = $(texpooldir) + + # If install_fonts=true, the PostScript/LaserJet TFM and VF files for + # the builtin fonts get installed in subdirectories of this directory, + # named for the typeface families of these directories. If you don't + # have the default directory setup, you will want to set + # install_fonts=false. Ditto for install_macros. + install_fonts = true + install_macros = true + + # Where the .map files from fontname are installed. + fontnamedir = $(texmf)/fontname + + # Where the dvips configuration files get installed, and where + # psfonts.map is. + dvipsdir = $(texmf)/dvips + psheaderdir = $(dvipsdir) + + # MakeTeXPK will go here to create dc*. + dcfontdir = $(fontdir)/public/dc + + # MakeTeXPK will go here if it exists to create nonstandard CM fonts, + # e.g., cmr11. See ftp.cs.umb.edu:pub/tex/sauter.tar.gz. The Sauter + # files must be in your regular MFINPUTS. + sauterdir = $(fontdir)/public/sauter + + # If a font can't be found close enough to its stated size, we look for + # each of these sizes in the order given. This colon-separated list is + # overridden by the envvar TEXSIZES, and by a program-specific variable + # (e.g., XDVISIZES), and perhaps by a config file (e.g., in dvips). + default_texsizes = 300:600 + + # End of paths.make. + # makevars.make -- the directory names we pass. + # It's important that none of these values contain [ @%], for the sake + # of kpathsea/texmf.sed. + makevars = prefix=$(prefix) exec_prefix=$(exec_prefix) \ + bindir=$(bindir) scriptdir=$(scriptdir) libdir=$(libdir) \ + datadir=$(datadir) infodir=$(infodir) includedir=$(includedir) \ + manext=$(manext) mandir=$(mandir) \ + texmf=$(texmf) web2cdir=$(web2cdir) \ + texinputdir=$(texinputdir) mfinputdir=$(mfinputdir) \ + fontdir=$(fontdir) \ + fmtdir=$(fmtdir) basedir=$(basedir) \ + texpooldir=$(texpooldir) mfpooldir=$(mfpooldir) \ + install_fonts=$(install_fonts) \ + dvipsdir=$(dvipsdir) psheaderdir=$(psheaderdir) \ + default_texsizes='$(default_texsizes)' + # End of makevars.make. + + # Add -DNO_DEBUG to disable debugging, for unnoticeably better performance. + DEFS = $(XDEFS) + + # common.make -- used by all Makefiles. + SHELL = /bin/sh + + top_srcdir = . + srcdir = . + + CPICFLAG = -fPIC + + SHLEXT = so + + SH_LD = gcc + SH_LDFLAGS = -shared + + SHARED_LIBS = false + + CC = gcc + # CFLAGS is used for both compilation and linking. + CFLAGS = -g -O2 $(XCFLAGS) + + # Do not override CPPFLAGS; change XCPPFLAGS, CFLAGS, XCFLAGS, or DEFS instead. + CPPFLAGS = $(XCPPFLAGS) -I. -I$(srcdir) \ + -I$(kpathsea_parent) -I$(kpathsea_srcdir_parent) \ + $(prog_cflags) $(DEFS) + + %.o : %.c + $(CC) $(CPPFLAGS) $(CFLAGS) -c $< + + pic/%.o : %.c + $(CC) $(CPPFLAGS) $(CPICFLAG) $(CFLAGS) -c $< -o $@ + + # Installation. + INSTALL = /usr/bin/install -c + INSTALL_PROGRAM = ${INSTALL} + INSTALL_DATA = ${INSTALL} -m 644 + + # This is used to recursively copy a fonts/ or tex/ directory to + # $(fontdir) or $(texinputdir). + # The first arg is `.', and the second is the target directory. + CP_R = cp -r + + # This is so kpathsea will get remade automatically if you change + # something in it and recompile from the package directory. + kpathsea_parent = .. + kpathsea_dir = $(kpathsea_parent)/kpathsea + kpathsea_srcdir_parent = $(top_srcdir)/.. + kpathsea_srcdir = $(kpathsea_srcdir_parent)/kpathsea + kpathsea = $(kpathsea_dir)/libkpathsea.a + + ##ifeq ($(CC), gcc) + ##XDEFS = -Wall -Wpointer-arith $(warn_more) + ##CFLAGS = -g $(XCFLAGS) + ##endif + # End of common.make. + # library.make -- stuff only useful for libraries. + AR = ar + ARFLAGS = cq + RANLIB = ranlib + # End of library.make. + # programs.make -- used by Makefiles for executables only. + # Linking. Don't include $(CFLAGS), since ld -g under Linux forces + # static libraries, including libc.a and libX*.a + LDFLAGS = $(XLDFLAGS) + LIBS = + # proglib is for web2c; + # XLOADLIBES is for the installer. + LOADLIBES= $(proglib) $(kpathsea) $(LIBS) -lm $(XLOADLIBES) + + # Why separate CCLD from CC? No particular reason. + CCLD = $(CC) + link_command = $(CCLD) -o $@ $(LDFLAGS) + # End of programs.make. + # texi.make -- making .dvi and .info from .texi. + + MAKEINFO = makeinfo + MAKEINFO_FLAGS = --paragraph-indent=2 -I$(srcdir) + TEXI2DVI = texi2dvi + + .SUFFIXES: .info .dvi .texi + .texi.info: + -$(MAKEINFO) $(MAKEINFO_FLAGS) $< -o $@ + .texi.dvi: + -$(TEXI2DVI) $(TEXI2DVI_FLAGS) $< + + # Install these header files (except c-auto.h). + install_headers = *.h + + ##ifdef HOSTNAME + ##warn_more = -Wmissing-prototypes -Wwrite-strings -Wshadow + ##MAKEINFO_FLAGS := $(MAKEINFO_FLAGS) --no-split + ##malloc = onefile.o # gmalloc.o + ##endif + + # Put tex-file.o first, because it's what depends on the paths, and may + # reduce frustration if the paths are wrong by doing it first. + + objects = tex-file.o absolute.o basename.o cnf.o concat.o concat3.o \ + concatn.o db.o debug.o dir.o elt-dirs.o expand.o extend-fname.o file-p.o \ + find-suffix.o fn.o fontmap.o getopt.o getopt1.o hash.o itoa.o kdefault.o \ + line.o magstep.o make-suffix.o path-elt.o pathsearch.o proginit.o \ + progname.o putenv.o readable.o rm-suffix.o str-list.o str-llist.o \ + tex-glyph.o tex-make.o tilde.o truncate.o uppercasify.o variable.o \ + version.o xcalloc.o xfopen.o xmalloc.o xopendir.o xputenv.o xrealloc.o \ + xstat.o xstrdup.o $(malloc) + + LIBS_TO_INSTALL = libkpathsea.a + + SH_LIBS_TO_INSTALL = libkpathsea.$(SHLEXT) + + ifeq ($(SHARED_LIBS), true) + BINDISTFILES = libkpathsea.$(SHLEXT) + BINDISTLIBS = $(addprefix kpathsea/, libkpathsea.$(SHLEXT)) + endif + + default all: stamp-picdir kpsewhich MakeTeXPK kpathsea.info stamp-shared + + stamp-picdir: + @if $(SHARED_LIBS); then \ + if [ -n "$(CPICFLAG)" ]; then \ + if [ -d pic ]; then \ + true ; \ + else \ + echo "mkdir pic" ; \ + mkdir pic ; \ + fi ; \ + else \ + true ; \ + fi ; \ + fi + touch stamp-picdir + + libkpathsea.a: $(objects) + rm -f $@ + $(AR) $(ARFLAGS) $@ $(objects) + $(RANLIB) $@ + + ifeq ($(SHARED_LIBS), true) + ifdef CPICFLAG + PICOBJ := $(addprefix pic/, $(objects)) + else + PICOBJ := $(objects) + endif + endif + + stamp-shared: $(PICOBJ) + if $(SHARED_LIBS); then \ + $(SH_LD) $(SH_LDFLAGS) -o libkpathsea.$(SHLEXT) $(PICOBJ) ; \ + fi + touch stamp-shared + + kpsewhich: libkpathsea.a kpsewhich.o + $(link_command) kpsewhich.o $(LOADLIBES) + + MakeTeXPK: MakeTeXPK.in $(top_srcdir)/../make/paths.make + sed -e 's,${prefix}/share,$(datadir),g' \ + -e 's,@psheaderdir@,$(psheaderdir),g' \ + -e 's,@fontnamedir@,$(fontnamedir),g' \ + -e 's,@fontdir@,$(fontdir),g' \ + -e 's,@dcfontdir@,$(dcfontdir),g' \ + -e 's,@sauterdir@,$(sauterdir),g' \ + -e 's,@web2cdir@,$(web2cdir),g' \ + <$(srcdir)/MakeTeXPK.in >$@.tmp + mv $@.tmp $@ + -chmod a+x $@ + + # Besides the straight variable substitutions, also change all + # occurrences of `$(texmf)/' to `$TEXMF', so simply setting that envvar + # changes the root of the whole tree. + texmf.cnf: texmf.cnf.in texmf.sed + sed -f texmf.sed -e 's%$(texmf)/%$$TEXMF/%g' $(srcdir)/texmf.cnf.in >$@ + + # The idea is to turn each var=value into s%@var@%value%g. Seems simpler + # to put the substitutions in a file than to play shell games. + texmf.sed: $(top_srcdir)/../make/makevars.make + echo $(makevars) \ + | tr ' ' '\012' \ + | sed -e 's/^/s%@/' -e 's/=/@%/' -e 's/$$/%/' -e 's/$$/g/' \ + >$@ + + # First null out comments and leading/trailing whitespace, then remove + # lines that define invalid C identifiers, then remove blank lines. Each + # line remaining looks like + # = + # (but = and surrounding spaces are optional, hence can't remove all spaces). + # Change this to #ifndef DEFAULT_name@#define DEFAULT_name "value"@#endif, + # then change the @'s to newlines (sed isn't good at multiline replacements), + # then change $TEXMF back to $(texmf) + # + # No backslash-newline escapes in the long sed replacement because that + # will turn into a space in the output. + # + # Without the $TEXMF substitution, if the cnf file was not found for + # some reason, none of the compile-time paths would be of any use, since + # TEXMF wouldn't be defined. Alternatively, we could have a way to + # specify compile-time default values for variables in general, but I + # think it's better to keep the last-resort paths as simple as possible. + # + # The definition of DEFAULT_TEXMF (and possibly other variables) + # that winds up in the final paths.h will not be used. + paths.h: texmf.cnf + echo "/* paths.h: Generated from texmf.cnf `date`. */" >$@ + sed -e 's/%.*//' -e 's/^[ ]*//' -e 's/[ ]*$$//' texmf.cnf \ + | grep '^[ ]*[A-Za-z_]*[ =]' \ + | sed '/^$$/d' \ + | sed 's/^\([^ =]*\)[ ]*=*[ ]*\(.*\)/#ifndef DEFAULT_\1@#define DEFAULT_\1 "\2"@#endif/' \ + | tr @ '\012' \ + | sed 's@\$$TEXMF@$(texmf)@g' \ + >>$@ + + # A few object files need extra definitions. The dependencies are below. + tex-file.o: + $(CC) $(CPPFLAGS) $(CFLAGS) \ + -DDEFAULT_FONT_SIZES='"$(default_texsizes)"' -c $(srcdir)/tex-file.c + + pic/tex-file.o: + $(CC) $(CPPFLAGS) $(CPICFLAG) $(CFLAGS) \ + -DDEFAULT_FONT_SIZES='"$(default_texsizes)"'\ + -c $(srcdir)/tex-file.c -o pic/$@ + + # Need the -DHAVE_CONFIG_H. + gmalloc.o: + $(CC) $(CPPFLAGS) -DHAVE_CONFIG_H $(CFLAGS) -c $(srcdir)/gmalloc.c + + pic/gmalloc.o: + $(CC) $(CPPFLAGS) $(CPICFLAG) -DHAVE_CONFIG_H $(CFLAGS) \ + -c $(srcdir)/gmalloc.c -o pic/gmalloc.o + + check: + + install: + for f in $(LIBS_TO_INSTALL); do \ + if [ -f $$f ]; then $(INSTALL_DATA) $$f $(libdir)/$$f; fi; \ + done + for f in $(SH_LIBS_TO_INSTALL); do \ + if [ -f $$f ]; then $(INSTALL_PROGRAM) $$f $(libdir)/$$f; fi; \ + done + + uninstall: + + # Installation of kpathsea itself is complicated by the fact that we + # want to install texmf.cnf, kpathsea.info, and MakeTeXPK by default, + # but not the headers or the .a file itself. So we have a separate + # target `install-library' to install the latter stuff. + #install: install-exec install-data + #uninstall: uninstall-exec uninstall-data + # + #install-exec: kpsewhich MakeTeXPK + # $(SHELL) $(top_srcdir)/../mkdirchain $(bindir) $(scriptdir) + # if grep 'original MakeTeXPK --' $(scriptdir)/MakeTeXPK >/dev/null 2>&1\ + # || test ! -r $(scriptdir)/MakeTeXPK; then \ + # $(INSTALL_PROGRAM) MakeTeXPK $(scriptdir)/MakeTeXPK; \ + # else true; fi + # $(INSTALL_PROGRAM) kpsewhich $(bindir)/kpsewhich + #uninstall-exec: + # rm -f $(bindir)/kpsewhich + # + #install-data: texmf.cnf kpathsea.info + # $(SHELL) $(top_srcdir)/../mkdirchain $(texmf) $(infodir) $(web2cdir) + # if grep 'original texmf.cnf --' $(web2cdir)/texmf.cnf >/dev/null 2>&1 \ + # || test ! -r $(web2cdir)/texmf.cnf; then \ + # $(INSTALL_DATA) texmf.cnf $(web2cdir)/texmf.cnf; \ + # else true; fi + # $(INSTALL_DATA) $(srcdir)/kpathsea.info $(infodir)/kpathsea.info + #uninstall-data: + # rm -f $(infodir)/kpathsea.info* + # + #install-library: libkpathsea.a + # $(SHELL) $(top_srcdir)/../mkdirchain $(includedir)/kpathsea $(libdir) + # $(INSTALL_DATA) libkpathsea.a $(libdir)/libkpathsea.a + # for f in $(install_headers); do \ + # $(INSTALL_DATA) $$f $(includedir)/kpathsea/$$f; done + # rm -f $(includedir)/kpathsea/c-auto.h + #uninstall-library: + # rm -f $(libdir)/libkpathsea.a + # for f in $(install_headers); do rm -f $(includedir)/$$f; done + + # distdir is used by other distributions; they define $(distdir). + distdir: INSTALL TAGS kpathsea.info kpathsea.dvi + rm -rf $(distdir) + mkdir -p $(distdir) + ln $(ln_files) $(distdir) + cp -p $(HOME)/gnu/gnuorg/*.texi $(distdir) + touch *.info* + ln *.info* *.texi kpathsea.aux kpathsea.cps $(distdir) + ln CONFIGURE HIER common.ac $(distdir) + cd $(distdir); rm -f paths.h + cd $(distdir); add-version $(version) version.c + + bin-dist: + if [ -n "$(BINDISTFILES)" ]; then \ + ln $(BINDISTFILES) ../`cat ../.fname`/kpathsea ; \ + fi + if [ -n "$(BINDISTLIBS)" ]; then \ + echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES ; \ + fi + .PHONY: bin-dist + + # config.make -- autoconf rules to remake the Makefile, c-auto.h, etc. + + ##ifdef HOSTNAME + ##ac_dir = $(gnu)/share/autoconf + ##autoconf = $(ac_dir)/acspecific.m4 $(ac_dir)/acgeneral.m4 $(ac_dir)/acsite.m4 + ##autoheader = $(ac_dir)/acconfig.h + ## + ### I define $(autoconf) to acgeneral.m4 and the other Autoconf files, so + ### configure automatically gets remade in the sources with a new Autoconf + ### release. But it would be bad for installers with Autoconf to remake + ### configure (not to mention require Autoconf), so I take out the variable + ### $(autoconf) definition before release. + ##configure_in = $(srcdir)/configure.in $(kpathsea_srcdir)/common.ac + ##$(srcdir)/configure: $(configure_in) $(autoconf) + ## cd $(srcdir) && autoconf + ##endif + + config.status: $(srcdir)/configure + $(SHELL) $(srcdir)/configure --no-create --verbose + + Makefile: $(srcdir)/Makefile.in config.status $(top_srcdir)/../make/*.make + $(SHELL) config.status + + # This rule isn't used for web2c or the top-level Makefile, but it + # doesn't hurt. We don't depend on config.status because configure + # always rewrites config.status, even when it doesn't change. Thus it + # might be newer than c-auto.h when we don't need to remake the latter. + c-auto.h: $(srcdir)/stamp-auto + $(srcdir)/stamp-auto: $(srcdir)/c-auto.h.in + $(SHELL) config.status + touch $(srcdir)/stamp-auto + + ##ifdef HOSTNAME + ### autoheader reads acconfig.h (and c-auto.h.top) automatically. + ##$(srcdir)/c-auto.h.in: $(srcdir)/stamp-auto.in + ##$(srcdir)/stamp-auto.in: $(configure_in) $(autoheader) $(srcdir)/acconfig.h + ## cd $(srcdir) && autoheader + ## touch $(srcdir)/stamp-auto.in + ##endif + + info: kpathsea.info + dvi: kpathsea.dvi + INSTALL: kpathsea.texi install.texi + $(MAKEINFO) $(MAKEINFO_FLAGS) --no-headers $< -o - \ + | sed -n -e '/^Installation/,/wrong fonts/'p >$@ + add-info-toc $@ + + # misc.make -- cleaning, etc. + TAGS: *.c *.h + if pwd | grep kpathsea >/dev/null; then \ + etags *.c *.h; else etags -i $(kpathsea_dir)/TAGS *.c *.h; fi + + mostlyclean:: + rm -f *.o $(program) $(programs) squeeze $(library).a pic/*.o + if $(SHARED_LIBS); then rm -f *.$(SHLEXT); fi + + clean:: mostlyclean + rm -f *.dvi *.lj + + distclean:: clean + rm -f Makefile MakeTeXPK *.pool + rm -f config.status config.log config.cache c-auto.h + rm -f stamp-picdir + -rmdir pic + + # Although we can remake configure and c-auto.h.in, we don't remove + # them, since many people may lack Autoconf. Use configclean for that. + maintainer-clean:: distclean + rm -f TAGS *.info* + + extraclean:: + rm -f *.aux *.bak *.bbl *.blg *.dvi *.log *.orig *.pl *.rej + rm -f *.i *.s *.tfm *.vf *.vpl *\#* *gf *pk *~ + rm -f CONTENTS.tex a.out core mfput.* texput.* + + configclean: + rm -f configure c-auto.h.in c-auto.h + + # Prevent GNU make 3.[59,63) from overflowing arg limit on system V. + .NOEXPORT: + # End of misc.make. + + mostlyclean:: + rm -f kpsewhich + distclean:: + rm -f paths.h texmf.cnf texmf.sed so_locations + rm -f libkpathsea.a libkpathsea.$(SHLEXT) + + # rdepend.make -- rules for remaking the dependencies. + # Have to use -M, not -MM, since we use instead of + # "kpathsea/..." in the sources. But that means we have to remove the + # directory prefixes and all the system include files. + # And is generated, not part of the distribution. + depend depend.make:: c-auto.h $(top_srcdir)/../make/rdepend.make + $(CC) -M $(CPPFLAGS) *.c \ + | sed -e 's,\.\./kpathsea/,$$(kpathsea_srcdir)/,g' \ + -e 's,$$(kpathsea_srcdir)/paths.h,paths.h,g' \ + -e 's,/usr[^ ]* ,,g' \ + -e 's,/usr[^ ]*$$,,g' \ + -e 's,dvi2xx.o,dvilj.o dvilj2p.o dvilj4.o dvilj4l.o,' \ + | grep -v '^ *\\$$' \ + >depend.make + # End of rdepend.make. + absolute.o: absolute.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/c-pathch.h + basename.o: basename.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-pathch.h + cnf.o: cnf.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-fopen.h $(kpathsea_srcdir)/c-ctype.h \ + $(kpathsea_srcdir)/cnf.h $(kpathsea_srcdir)/db.h $(kpathsea_srcdir)/str-list.h \ + $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/line.h paths.h \ + $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/tex-file.h \ + $(kpathsea_srcdir)/variable.h + concat.o: concat.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h + concat3.o: concat3.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h + concatn.o: concatn.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/concatn.h $(kpathsea_srcdir)/c-vararg.h + db.o: db.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-fopen.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/db.h \ + $(kpathsea_srcdir)/str-list.h $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/line.h \ + $(kpathsea_srcdir)/readable.h $(kpathsea_srcdir)/variable.h + debug.o: debug.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h + dir.o: dir.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-dir.h \ + $(kpathsea_srcdir)/c-stat.h \ + $(kpathsea_srcdir)/hash.h + elt-dirs.o: elt-dirs.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/fn.h \ + $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/xopendir.h \ + $(kpathsea_srcdir)/c-dir.h + expand.o: expand.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/pathsearch.h \ + $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/tilde.h $(kpathsea_srcdir)/variable.h + extend-fname.o: extend-fname.c $(kpathsea_srcdir)/config.h ./c-auto.h \ + $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h + file-p.o: file-p.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/xstat.h $(kpathsea_srcdir)/c-stat.h + find-suffix.o: find-suffix.c $(kpathsea_srcdir)/config.h ./c-auto.h \ + $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-pathch.h + fn.o: fn.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h $(kpathsea_srcdir)/fn.h + fontmap.o: fontmap.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-fopen.h $(kpathsea_srcdir)/fontmap.h $(kpathsea_srcdir)/hash.h \ + $(kpathsea_srcdir)/line.h $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ + $(kpathsea_srcdir)/str-list.h + getopt.o: getopt.c \ + getopt.h + getopt1.o: getopt1.c getopt.h + hash.o: hash.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/str-list.h + itoa.o: itoa.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h + kdefault.o: kdefault.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/default.h + kpsewhich.o: kpsewhich.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/getopt.h $(kpathsea_srcdir)/line.h $(kpathsea_srcdir)/proginit.h \ + $(kpathsea_srcdir)/progname.h $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/tex-glyph.h \ + $(kpathsea_srcdir)/variable.h + kpsexpand.o: kpsexpand.c \ + tex-file.h $(kpathsea_srcdir)/c-proto.h $(kpathsea_srcdir)/types.h + line.o: line.c + magstep.o: magstep.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/magstep.h + make-suffix.o: make-suffix.c $(kpathsea_srcdir)/config.h ./c-auto.h \ + $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h + path-elt.o: path-elt.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h + pathsearch.o: pathsearch.c $(kpathsea_srcdir)/config.h ./c-auto.h \ + $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-fopen.h $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/expand.h \ + $(kpathsea_srcdir)/db.h $(kpathsea_srcdir)/str-list.h $(kpathsea_srcdir)/pathsearch.h \ + $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/readable.h $(kpathsea_srcdir)/variable.h + proginit.o: proginit.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/proginit.h $(kpathsea_srcdir)/progname.h \ + $(kpathsea_srcdir)/tex-file.h + progname.o: progname.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/progname.h + putenv.o: putenv.c ./c-auto.h + readable.o: readable.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-stat.h \ + $(kpathsea_srcdir)/readable.h $(kpathsea_srcdir)/truncate.h + rm-suffix.o: rm-suffix.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h + str-list.o: str-list.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/str-list.h + str-llist.o: str-llist.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/str-llist.h + tex-file.o: tex-file.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-vararg.h $(kpathsea_srcdir)/cnf.h $(kpathsea_srcdir)/default.h \ + $(kpathsea_srcdir)/expand.h paths.h $(kpathsea_srcdir)/pathsearch.h \ + $(kpathsea_srcdir)/str-llist.h $(kpathsea_srcdir)/tex-file.h + tex-glyph.o: tex-glyph.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/absolute.h $(kpathsea_srcdir)/expand.h $(kpathsea_srcdir)/fontmap.h \ + $(kpathsea_srcdir)/hash.h $(kpathsea_srcdir)/pathsearch.h $(kpathsea_srcdir)/str-llist.h \ + $(kpathsea_srcdir)/tex-glyph.h $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/tex-make.h \ + $(kpathsea_srcdir)/variable.h + tex-make.o: tex-make.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-fopen.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/concatn.h \ + $(kpathsea_srcdir)/c-vararg.h $(kpathsea_srcdir)/db.h $(kpathsea_srcdir)/str-list.h \ + $(kpathsea_srcdir)/fn.h $(kpathsea_srcdir)/magstep.h $(kpathsea_srcdir)/readable.h \ + $(kpathsea_srcdir)/tex-make.h $(kpathsea_srcdir)/tex-file.h $(kpathsea_srcdir)/variable.h + tilde.o: tilde.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/tilde.h + truncate.o: truncate.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-namemx.h $(kpathsea_srcdir)/c-pathch.h $(kpathsea_srcdir)/c-pathmx.h \ + $(kpathsea_srcdir)/truncate.h + uppercasify.o: uppercasify.c $(kpathsea_srcdir)/config.h ./c-auto.h \ + $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-ctype.h + variable.o: variable.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/c-ctype.h $(kpathsea_srcdir)/cnf.h \ + $(kpathsea_srcdir)/fn.h $(kpathsea_srcdir)/variable.h + version.o: version.c + xcalloc.o: xcalloc.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h + xfopen.o: xfopen.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h + xmalloc.o: xmalloc.c + xopendir.o: xopendir.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/xopendir.h $(kpathsea_srcdir)/c-dir.h + xputenv.o: xputenv.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h + xrealloc.o: xrealloc.c + xstat.o: xstat.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h \ + $(kpathsea_srcdir)/xstat.h $(kpathsea_srcdir)/c-stat.h + xstrdup.o: xstrdup.c $(kpathsea_srcdir)/config.h ./c-auto.h $(kpathsea_srcdir)/c-std.h \ + $(kpathsea_srcdir)/c-unistd.h $(kpathsea_srcdir)/systypes.h \ + $(kpathsea_srcdir)/c-memstr.h \ + $(kpathsea_srcdir)/c-errno.h $(kpathsea_srcdir)/c-minmax.h \ + $(kpathsea_srcdir)/c-limits.h \ + $(kpathsea_srcdir)/c-proto.h \ + $(kpathsea_srcdir)/lib.h $(kpathsea_srcdir)/types.h $(kpathsea_srcdir)/debug.h diff -cNr octave-2.0.2/kpathsea/Makefile.in octave-2.0.3/kpathsea/Makefile.in *** octave-2.0.2/kpathsea/Makefile.in Fri Jan 24 23:24:58 1997 --- octave-2.0.3/kpathsea/Makefile.in Fri Feb 14 16:22:16 1997 *************** *** 45,53 **** default all: stamp-picdir kpsewhich MakeTeXPK kpathsea.info stamp-shared stamp-picdir: ! if [ -n "$(CPICFLAG)" ]; then \ ! if [ -d pic ]; then true; else mkdir pic ; fi ; \ ! else true; fi touch stamp-picdir libkpathsea.a: $(objects) --- 45,62 ---- default all: stamp-picdir kpsewhich MakeTeXPK kpathsea.info stamp-shared stamp-picdir: ! @if $(SHARED_LIBS); then \ ! if [ -n "$(CPICFLAG)" ]; then \ ! if [ -d pic ]; then \ ! true ; \ ! else \ ! echo "mkdir pic" ; \ ! mkdir pic ; \ ! fi ; \ ! else \ ! true ; \ ! fi ; \ ! fi touch stamp-picdir libkpathsea.a: $(objects) *************** *** 65,71 **** stamp-shared: $(PICOBJ) if $(SHARED_LIBS); then \ ! $(CC) -shared -o libkpathsea.$(SHLEXT) $(PICOBJ); \ fi touch stamp-shared --- 74,80 ---- stamp-shared: $(PICOBJ) if $(SHARED_LIBS); then \ ! $(SH_LD) $(SH_LDFLAGS) -o libkpathsea.$(SHLEXT) $(PICOBJ) ; \ fi touch stamp-shared *************** *** 130,146 **** # A few object files need extra definitions. The dependencies are below. tex-file.o: - [ -z "$(CPICFLAG)" ] ||\ - $(CC) $(CPPFLAGS) $(CPICFLAG) $(CFLAGS) \ - -DDEFAULT_FONT_SIZES='"$(default_texsizes)"'\ - -c $(srcdir)/tex-file.c -o pic/$@ $(CC) $(CPPFLAGS) $(CFLAGS) \ -DDEFAULT_FONT_SIZES='"$(default_texsizes)"' -c $(srcdir)/tex-file.c # Need the -DHAVE_CONFIG_H. gmalloc.o: $(CC) $(CPPFLAGS) @DEFS@ $(CFLAGS) -c $(srcdir)/gmalloc.c check: install: --- 139,160 ---- # A few object files need extra definitions. The dependencies are below. tex-file.o: $(CC) $(CPPFLAGS) $(CFLAGS) \ -DDEFAULT_FONT_SIZES='"$(default_texsizes)"' -c $(srcdir)/tex-file.c + pic/tex-file.o: + $(CC) $(CPPFLAGS) $(CPICFLAG) $(CFLAGS) \ + -DDEFAULT_FONT_SIZES='"$(default_texsizes)"'\ + -c $(srcdir)/tex-file.c -o pic/$@ + # Need the -DHAVE_CONFIG_H. gmalloc.o: $(CC) $(CPPFLAGS) @DEFS@ $(CFLAGS) -c $(srcdir)/gmalloc.c + pic/gmalloc.o: + $(CC) $(CPPFLAGS) $(CPICFLAG) @DEFS@ $(CFLAGS) \ + -c $(srcdir)/gmalloc.c -o pic/gmalloc.o + check: install: *************** *** 206,212 **** if [ -n "$(BINDISTFILES)" ]; then \ ln $(BINDISTFILES) ../`cat ../.fname`/kpathsea ; \ fi ! echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES .PHONY: bin-dist ac_include ../make/config.make --- 220,228 ---- if [ -n "$(BINDISTFILES)" ]; then \ ln $(BINDISTFILES) ../`cat ../.fname`/kpathsea ; \ fi ! if [ -n "$(BINDISTLIBS)" ]; then \ ! echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES ; \ ! fi .PHONY: bin-dist ac_include ../make/config.make diff -cNr octave-2.0.2/kpathsea/configure octave-2.0.3/kpathsea/configure *** octave-2.0.2/kpathsea/configure Mon Jan 27 15:54:26 1997 --- octave-2.0.3/kpathsea/configure Tue Feb 18 09:41:40 1997 *************** *** 586,611 **** ! if $SHARED_LIBS; then ! CPICFLAG=-fPIC ! SHLEXT=so ! case "$canonical_host_type" in ! alpha-dec-osf*) ! CPICFLAG= ! ;; ! rs6000-ibm-aix*) ! CPICFLAG= ! ;; ! hppa*-hp-hpux*) ! SHLEXT=sl ! ;; ! esac ! else ! CPICFLAG= ! SHLEXT= ! fi echo "$ac_t""defining CPICFLAG to be $CPICFLAG" 1>&6 echo "$ac_t""defining SHLEXT to be $SHLEXT" 1>&6 --- 586,617 ---- ! CPICFLAG=-fPIC ! SHLEXT=so ! SH_LD="$CC" ! SH_LDFLAGS=-shared ! case "$canonical_host_type" in ! *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) ! SH_LD=ld ! SH_LDFLAGS=-Bshareable ! ;; ! alpha-dec-osf*) ! CPICFLAG= ! SH_LDFLAGS="-Xlinker -exepct_unresolved -Xlinker '*'" ! ;; ! rs6000-ibm-aix* | powerpc-ibm-aix*) ! CPICFLAG= ! ;; ! hppa*-hp-hpux*) ! SHLEXT=sl ! ;; ! esac echo "$ac_t""defining CPICFLAG to be $CPICFLAG" 1>&6 echo "$ac_t""defining SHLEXT to be $SHLEXT" 1>&6 + echo "$ac_t""defining SH_LD to be $SH_LD" 1>&6 + echo "$ac_t""defining SH_LDFLAGS to be $SH_LDFLAGS" 1>&6 + + *************** *** 613,619 **** echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ! echo "configure:617: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 619,625 ---- echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ! echo "configure:623: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 643,649 **** # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:647: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 649,655 ---- # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:653: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 672,678 **** # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:676: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 678,684 ---- # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:682: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 720,726 **** fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:724: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. --- 726,732 ---- fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:730: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. *************** *** 730,740 **** cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then --- 736,746 ---- cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then *************** *** 754,765 **** { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:758: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:763: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 760,771 ---- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:764: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:769: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 768,774 **** yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:772: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no --- 774,780 ---- yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no *************** *** 783,789 **** ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:787: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 789,795 ---- ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:793: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 821,827 **** # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:825: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 827,833 ---- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:831: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 873,879 **** # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:877: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 879,885 ---- # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:883: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 901,907 **** echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 ! echo "configure:905: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then --- 907,913 ---- echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 ! echo "configure:911: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then *************** *** 927,938 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:931: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> --- 933,944 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:937: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> *************** *** 940,946 **** DIR *dirp = 0; ; return 0; } EOF ! if { (eval echo configure:944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else --- 946,952 ---- DIR *dirp = 0; ; return 0; } EOF ! if { (eval echo configure:950: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else *************** *** 965,971 **** # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:969: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 971,977 ---- # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:975: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 973,979 **** ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 990,996 ---- opendir() ; return 0; } EOF ! if { (eval echo configure:994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 1006,1012 **** else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:1010: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1012,1018 ---- else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:1016: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1014,1020 **** ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1031,1037 ---- opendir() ; return 0; } EOF ! if { (eval echo configure:1035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 1048,1054 **** fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1052: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= --- 1054,1060 ---- fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:1058: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= *************** *** 1063,1075 **** # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : --- 1069,1081 ---- # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : *************** *** 1080,1092 **** rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : --- 1086,1098 ---- rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1096: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : *************** *** 1109,1120 **** echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:1113: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 1115,1126 ---- echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:1119: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 1122,1128 **** #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* --- 1128,1134 ---- #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1132: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* *************** *** 1139,1145 **** if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF --- 1145,1151 ---- if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF *************** *** 1157,1163 **** if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF --- 1163,1169 ---- if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF *************** *** 1178,1184 **** : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') --- 1184,1190 ---- : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') *************** *** 1189,1195 **** exit (0); } EOF ! if { (eval echo configure:1193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else --- 1195,1201 ---- exit (0); } EOF ! if { (eval echo configure:1199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else *************** *** 1213,1219 **** fi echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6 ! echo "configure:1217: checking whether closedir returns void" >&5 if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1219,1225 ---- fi echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6 ! echo "configure:1223: checking whether closedir returns void" >&5 if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1221,1233 **** ac_cv_func_closedir_void=yes else cat > conftest.$ac_ext < #include <$ac_header_dirent> int closedir(); main() { exit(closedir(opendir(".")) != 0); } EOF ! if { (eval echo configure:1231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_closedir_void=no else --- 1227,1239 ---- ac_cv_func_closedir_void=yes else cat > conftest.$ac_ext < #include <$ac_header_dirent> int closedir(); main() { exit(closedir(opendir(".")) != 0); } EOF ! if { (eval echo configure:1237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_closedir_void=no else *************** *** 1254,1270 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1258: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* --- 1260,1276 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1264: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* *************** *** 1294,1305 **** for ac_func in basename bcopy memmove putenv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:1298: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1304: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 1328,1334 ---- ; return 0; } EOF ! if { (eval echo configure:1332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 1348,1359 **** echo $ac_n "checking for working const""... $ac_c" 1>&6 ! echo "configure:1352: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1358: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else --- 1408,1414 ---- ; return 0; } EOF ! if { (eval echo configure:1412: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else *************** *** 1426,1444 **** # This is a GNU libc invention. echo $ac_n "checking whether program_invocation_name is predefined""... $ac_c" 1>&6 ! echo "configure:1430: checking whether program_invocation_name is predefined" >&5 if eval "test \"`echo '$''{'kb_cv_var_program_inv_name'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* kb_cv_var_program_inv_name=yes else --- 1432,1450 ---- # This is a GNU libc invention. echo $ac_n "checking whether program_invocation_name is predefined""... $ac_c" 1>&6 ! echo "configure:1436: checking whether program_invocation_name is predefined" >&5 if eval "test \"`echo '$''{'kb_cv_var_program_inv_name'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* kb_cv_var_program_inv_name=yes else *************** *** 1463,1469 **** # We don't actually need to run this if we don't have putenv, but it # doesn't hurt. echo $ac_n "checking whether putenv uses malloc""... $ac_c" 1>&6 ! echo "configure:1467: checking whether putenv uses malloc" >&5 if eval "test \"`echo '$''{'kb_cv_func_putenv_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1469,1475 ---- # We don't actually need to run this if we don't have putenv, but it # doesn't hurt. echo $ac_n "checking whether putenv uses malloc""... $ac_c" 1>&6 ! echo "configure:1473: checking whether putenv uses malloc" >&5 if eval "test \"`echo '$''{'kb_cv_func_putenv_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1471,1477 **** kb_cv_func_putenv_malloc=no else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then kb_cv_func_putenv_malloc=yes else --- 1530,1536 ---- exit (rstr1 == rstr2 ? 0 : 1); } EOF ! if { (eval echo configure:1534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then kb_cv_func_putenv_malloc=yes else *************** *** 1685,1690 **** --- 1691,1698 ---- s%@SHARED_LIBS@%$SHARED_LIBS%g s%@CPICFLAG@%$CPICFLAG%g s%@SHLEXT@%$SHLEXT%g + s%@SH_LD@%$SH_LD%g + s%@SH_LDFLAGS@%$SH_LDFLAGS%g s%@SET_MAKE@%$SET_MAKE%g s%@CC@%$CC%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g diff -cNr octave-2.0.2/kpathsea/configure.in octave-2.0.3/kpathsea/configure.in *** octave-2.0.2/kpathsea/configure.in Thu Jul 18 20:53:43 1996 --- octave-2.0.3/kpathsea/configure.in Thu Feb 13 21:13:37 1997 *************** *** 17,44 **** SHARED_LIBS=false) AC_SUBST(SHARED_LIBS) ! if $SHARED_LIBS; then ! CPICFLAG=-fPIC ! SHLEXT=so ! case "$canonical_host_type" in ! alpha-dec-osf*) ! CPICFLAG= ! ;; ! rs6000-ibm-aix*) ! CPICFLAG= ! ;; ! hppa*-hp-hpux*) ! SHLEXT=sl ! ;; ! esac ! else ! CPICFLAG= ! SHLEXT= ! fi AC_MSG_RESULT([defining CPICFLAG to be $CPICFLAG]) AC_MSG_RESULT([defining SHLEXT to be $SHLEXT]) AC_SUBST(CPICFLAG) AC_SUBST(SHLEXT) sinclude(common.ac) --- 17,50 ---- SHARED_LIBS=false) AC_SUBST(SHARED_LIBS) ! CPICFLAG=-fPIC ! SHLEXT=so ! SH_LD="$CC" ! SH_LDFLAGS=-shared ! case "$canonical_host_type" in ! *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) ! SH_LD=ld ! SH_LDFLAGS=-Bshareable ! ;; ! alpha-dec-osf*) ! CPICFLAG= ! SH_LDFLAGS="-Xlinker -exepct_unresolved -Xlinker '*'" ! ;; ! rs6000-ibm-aix* | powerpc-ibm-aix*) ! CPICFLAG= ! ;; ! hppa*-hp-hpux*) ! SHLEXT=sl ! ;; ! esac AC_MSG_RESULT([defining CPICFLAG to be $CPICFLAG]) AC_MSG_RESULT([defining SHLEXT to be $SHLEXT]) + AC_MSG_RESULT([defining SH_LD to be $SH_LD]) + AC_MSG_RESULT([defining SH_LDFLAGS to be $SH_LDFLAGS]) AC_SUBST(CPICFLAG) AC_SUBST(SHLEXT) + AC_SUBST(SH_LD) + AC_SUBST(SH_LDFLAGS) sinclude(common.ac) diff -cNr octave-2.0.2/libcruft/ChangeLog octave-2.0.3/libcruft/ChangeLog *** octave-2.0.2/libcruft/ChangeLog Mon Jan 27 15:52:30 1997 --- octave-2.0.3/libcruft/ChangeLog Tue Feb 18 09:22:36 1997 *************** *** 1,3 **** --- 1,18 ---- + Tue Feb 18 09:22:04 1997 John W. Eaton + + * Version 2.0.3 released. + + Fri Feb 14 16:23:42 1997 John W. Eaton + + * Makefile.in (bin-dist): Don't write empty strings to LIBRARIES. + + Thu Feb 13 17:33:41 1997 John W. Eaton + + * Makefile.in (stamp-shared): Use $(SH_LD) $(SH_LDFLAGS) instead + of $(CXX) -shared. + + * Makerules.in (stamp-picdir): Silence noise about making pic. + Mon Jan 27 15:52:29 1997 John W. Eaton * Version 2.0.2 released. diff -cNr octave-2.0.2/libcruft/Makefile.in octave-2.0.3/libcruft/Makefile.in *** octave-2.0.2/libcruft/Makefile.in Fri Jan 24 23:25:42 1997 --- octave-2.0.3/libcruft/Makefile.in Fri Feb 14 16:22:06 1997 *************** *** 69,76 **** stamp-shared: $(CRUFT_PICOBJ) if $(SHARED_LIBS); then \ ! $(CC) -shared -o libcruft.$(SHLEXT) $(CRUFT_PICOBJ) \ ! $(SH_FLIBS) -lm ; \ else \ true ; \ fi --- 69,75 ---- stamp-shared: $(CRUFT_PICOBJ) if $(SHARED_LIBS); then \ ! $(SH_LD) $(SH_LDFLAGS) -o libcruft.$(SHLEXT) $(CRUFT_PICOBJ) ; \ else \ true ; \ fi *************** *** 127,131 **** if [ -n "$(BINDISTFILES)" ]; then \ ln $(BINDISTFILES) ../`cat ../.fname`/libcruft ; \ fi ! echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES .PHONY: bin-dist --- 126,132 ---- if [ -n "$(BINDISTFILES)" ]; then \ ln $(BINDISTFILES) ../`cat ../.fname`/libcruft ; \ fi ! if [ -n "$(BINDISTLIBS)" ]; then \ ! echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES ; \ ! fi .PHONY: bin-dist diff -cNr octave-2.0.2/libcruft/Makerules.in octave-2.0.3/libcruft/Makerules.in *** octave-2.0.2/libcruft/Makerules.in Thu Dec 12 02:18:48 1996 --- octave-2.0.3/libcruft/Makerules.in Thu Feb 13 17:36:36 1997 *************** *** 54,64 **** .PRECIOUS: $(LIBCRUFT_OBJS) stamp-picdir: ! if [ "$(SHARED_LIBS)" = true ]; then \ if [ -n "$(FPICFLAG)" ]; then \ if [ -d pic ]; then \ true ; \ else \ mkdir pic ; \ fi ; \ fi ; \ --- 54,65 ---- .PRECIOUS: $(LIBCRUFT_OBJS) stamp-picdir: ! @if $(SHARED_LIBS); then \ if [ -n "$(FPICFLAG)" ]; then \ if [ -d pic ]; then \ true ; \ else \ + echo "mkdir pic" ; \ mkdir pic ; \ fi ; \ fi ; \ diff -cNr octave-2.0.2/liboctave/Array2-idx.h octave-2.0.3/liboctave/Array2-idx.h *** octave-2.0.2/liboctave/Array2-idx.h Fri Dec 13 02:01:24 1996 --- octave-2.0.3/liboctave/Array2-idx.h Thu Feb 13 15:03:01 1997 *************** *** 163,183 **** if (idx_i && idx_j) { ! if (n == 0) { ! if (m == 0 || idx_j.is_colon_equiv (nc, 1)) retval.resize (0, 0); else ! (*current_liboctave_error_handler) ! ("invalid row index = 0"); } else if (m == 0) { ! if (n == 0 || idx_i.is_colon_equiv (nr, 1)) retval.resize (0, 0); else ! (*current_liboctave_error_handler) ! ("invalid column index = 0"); } else if (idx_i.is_colon_equiv (nr) && idx_j.is_colon_equiv (nc)) { --- 163,189 ---- if (idx_i && idx_j) { ! if (idx_i.orig_empty () || idx_j.orig_empty ()) { ! retval.resize (n, m); ! } ! else if (n == 0) ! { ! if (m == 0) retval.resize (0, 0); + else if (idx_j.is_colon_equiv (nc, 1)) + retval.resize (0, nc); else ! (*current_liboctave_error_handler) ("invalid row index = 0"); } else if (m == 0) { ! if (n == 0) retval.resize (0, 0); + else if (idx_i.is_colon_equiv (nr, 1)) + retval.resize (nr, 0); else ! (*current_liboctave_error_handler) ("invalid column index = 0"); } else if (idx_i.is_colon_equiv (nr) && idx_j.is_colon_equiv (nc)) { diff -cNr octave-2.0.2/liboctave/CColVector.cc octave-2.0.3/liboctave/CColVector.cc *** octave-2.0.2/liboctave/CColVector.cc Sat Oct 12 13:31:36 1996 --- octave-2.0.3/liboctave/CColVector.cc Thu Feb 13 13:53:20 1997 *************** *** 726,743 **** // other operations ComplexColumnVector ! map (c_c_Mapper f, const ComplexColumnVector& a) { ! ComplexColumnVector b (a); ! b.map (f); ! return b; } ! void ! ComplexColumnVector::map (c_c_Mapper f) { for (int i = 0; i < length (); i++) ! elem (i) = f (elem (i)); } Complex --- 726,763 ---- // other operations ComplexColumnVector ! ComplexColumnVector::map (c_c_Mapper f) const { ! ComplexColumnVector b (*this); ! return b.apply (f); } ! ColumnVector ! ComplexColumnVector::map (d_c_Mapper f) const { + const Complex *d = data (); + + int len = length (); + + ColumnVector retval (len); + + double *r = retval.fortran_vec (); + + for (int i = 0; i < len; i++) + r[i] = f (d[i]); + + return retval; + } + + ComplexColumnVector& + ComplexColumnVector::apply (c_c_Mapper f) + { + Complex *d = fortran_vec (); // Ensures only one reference to my privates! + for (int i = 0; i < length (); i++) ! d[i] = f (d[i]); ! ! return *this; } Complex diff -cNr octave-2.0.2/liboctave/CColVector.h octave-2.0.3/liboctave/CColVector.h *** octave-2.0.2/liboctave/CColVector.h Sat Oct 12 13:31:36 1996 --- octave-2.0.3/liboctave/CColVector.h Thu Feb 13 13:26:14 1997 *************** *** 172,179 **** // other operations ! friend ComplexColumnVector map (c_c_Mapper f, const ComplexColumnVector& a); ! void map (c_c_Mapper f); Complex min (void) const; Complex max (void) const; --- 172,181 ---- // other operations ! ComplexColumnVector map (c_c_Mapper f) const; ! ColumnVector map (d_c_Mapper f) const; ! ! ComplexColumnVector& apply (c_c_Mapper f); Complex min (void) const; Complex max (void) const; diff -cNr octave-2.0.2/liboctave/CMatrix.cc octave-2.0.3/liboctave/CMatrix.cc *** octave-2.0.2/liboctave/CMatrix.cc Sun Jan 19 16:33:47 1997 --- octave-2.0.3/liboctave/CMatrix.cc Thu Feb 13 13:55:36 1997 *************** *** 2929,2947 **** // other operations ComplexMatrix ! map (c_c_Mapper f, const ComplexMatrix& a) { ! ComplexMatrix b (a); ! b.map (f); ! return b; } ! void ! ComplexMatrix::map (c_c_Mapper f) { ! for (int j = 0; j < cols (); j++) ! for (int i = 0; i < rows (); i++) ! elem (i, j) = f (elem (i, j)); } bool --- 2929,2964 ---- // other operations ComplexMatrix ! ComplexMatrix::map (c_c_Mapper f) const { ! ComplexMatrix b (*this); ! return b.apply (f); } ! Matrix ! ComplexMatrix::map (d_c_Mapper f) const { ! const Complex *d = data (); ! ! Matrix retval (rows (), columns ()); ! ! double *r = retval.fortran_vec (); ! ! for (int i = 0; i < length (); i++) ! r[i] = f (d[i]); ! ! return retval; ! } ! ! ComplexMatrix& ! ComplexMatrix::apply (c_c_Mapper f) ! { ! Complex *d = fortran_vec (); // Ensures only one reference to my privates! ! ! for (int i = 0; i < length (); i++) ! d[i] = f (d[i]); ! ! return *this; } bool diff -cNr octave-2.0.2/liboctave/CMatrix.h octave-2.0.3/liboctave/CMatrix.h *** octave-2.0.2/liboctave/CMatrix.h Mon Oct 14 15:16:38 1996 --- octave-2.0.3/liboctave/CMatrix.h Thu Feb 13 13:27:08 1997 *************** *** 317,324 **** // other operations ! friend ComplexMatrix map (c_c_Mapper f, const ComplexMatrix& a); ! void map (c_c_Mapper f); bool any_element_is_inf_or_nan (void) const; bool all_elements_are_real (void) const; --- 317,326 ---- // other operations ! ComplexMatrix map (c_c_Mapper f) const; ! Matrix map (d_c_Mapper f) const; ! ! ComplexMatrix& apply (c_c_Mapper f); bool any_element_is_inf_or_nan (void) const; bool all_elements_are_real (void) const; diff -cNr octave-2.0.2/liboctave/CRowVector.cc octave-2.0.3/liboctave/CRowVector.cc *** octave-2.0.2/liboctave/CRowVector.cc Sat Oct 12 13:31:35 1996 --- octave-2.0.3/liboctave/CRowVector.cc Thu Feb 13 13:59:18 1997 *************** *** 636,653 **** // other operations ComplexRowVector ! map (c_c_Mapper f, const ComplexRowVector& a) { ! ComplexRowVector b (a); ! b.map (f); ! return b; } ! void ! ComplexRowVector::map (c_c_Mapper f) { for (int i = 0; i < length (); i++) ! elem (i) = f (elem (i)); } Complex --- 636,673 ---- // other operations ComplexRowVector ! ComplexRowVector::map (c_c_Mapper f) const { ! ComplexRowVector b (*this); ! return b.apply (f); } ! RowVector ! ComplexRowVector::map (d_c_Mapper f) const { + const Complex *d = data (); + + int len = length (); + + RowVector retval (len); + + double *r = retval.fortran_vec (); + + for (int i = 0; i < len; i++) + r[i] = f (d[i]); + + return retval; + } + + ComplexRowVector& + ComplexRowVector::apply (c_c_Mapper f) + { + Complex *d = fortran_vec (); // Ensures only one reference to my privates! + for (int i = 0; i < length (); i++) ! d[i] = f (d[i]); ! ! return *this; } Complex diff -cNr octave-2.0.2/liboctave/CRowVector.h octave-2.0.3/liboctave/CRowVector.h *** octave-2.0.2/liboctave/CRowVector.h Sat Oct 12 13:31:35 1996 --- octave-2.0.3/liboctave/CRowVector.h Thu Feb 13 14:14:02 1997 *************** *** 139,146 **** // other operations ! friend ComplexRowVector map (c_c_Mapper f, const ComplexRowVector& a); ! void map (c_c_Mapper f); Complex min (void) const; Complex max (void) const; --- 139,148 ---- // other operations ! ComplexRowVector map (c_c_Mapper f) const; ! RowVector map (d_c_Mapper f) const; ! ! ComplexRowVector& apply (c_c_Mapper f); Complex min (void) const; Complex max (void) const; diff -cNr octave-2.0.2/liboctave/ChangeLog octave-2.0.3/liboctave/ChangeLog *** octave-2.0.2/liboctave/ChangeLog Mon Jan 27 15:52:28 1997 --- octave-2.0.3/liboctave/ChangeLog Tue Feb 18 09:22:33 1997 *************** *** 1,3 **** --- 1,79 ---- + Tue Feb 18 09:22:04 1997 John W. Eaton + + * Version 2.0.3 released. + + Fri Feb 14 16:23:47 1997 John W. Eaton + + * Makefile.in (bin-dist): Don't write empty strings to LIBRARIES. + + Thu Feb 13 14:35:19 1997 John W. Eaton + + * Makefile.in (stamp-prereq): Depend on stamp-picdir. + (all): Don't depend on stamp-prereq or stamp-picdir. + (liboctave.a, stamp-shared): Do depend on stamp-prereq. + (stamp-picdir): Silence noise about making pic. + (stamp-shared): Use $(SH_LD) $(SH_LDFLAGS) instead of $(CXX) -shared. + + * Array2-idx.h (Array2::index (idx_vector&, idx_vector&)): + Fix typo in last change. + + * CColVector.cc (ComplexColumnVector::map (d_c_mapper)): + Convert from friend (moved from dColVector.cc). + * CMatrix.cc (ComplexMatrix::map (d_c_mapper)): + Likewise (moved from dMatrix.cc). + * CRowVector.cc (ComplexRowVector::map (d_c_mapper)): + Likewise (moved from dRowVector.cc). + + * dColVector.cc (ColumnVector::map (d_d_mapper)): Convert from friend. + * dMatrix.cc (Matrix::map (d_d_mapper)): Likewise. + * dRowVector.cc (RowVector::map (d_d_mapper)): Likewise. + * CColVector.cc (ComplexColumnVector::map (c_c_mapper)): Likewise. + * CMatrix.cc (ComplexMatrix::map (c_c_mapper)): Likewise. + * CRowVector.cc (ComplexRowVector::map (c_c_mapper)): Likewise. + + * dColVector.cc (ColumnVector::apply): Rename from map, return *this. + * dMatrix.cc (Matrix::apply): Likewise. + * dRowVector.cc (RowVector::apply): Likewise. + * CColVector.cc (ComplexColumnVector::apply): Likewise. + * CMatrix.cc (ComplexMatrix::apply): Likewise. + * CRowVector.cc (ComplexRowVector::apply): Likewise. + + Tue Feb 11 19:44:28 1997 John W. Eaton + + * lo-ieee.cc: Declare quiet_nan() and infinity(). + + Mon Feb 10 01:17:45 1997 John W. Eaton + + * file-ops.cc (oct_unlink (const string&, string&)): + New two-arg version. + (oct_rmdir (const string&, string&)): New two-arg version. + (oct_mkdir (const string&, mode_t, string&)): New three-arg version. + (oct_mkfifo (const string&, mode_t, string&)): New three-arg version. + (oct_rename (const string&, const string&, string&)): + New three-arg version. + + Fri Feb 7 13:15:55 1997 John W. Eaton + + * idx-vector.h (idx_vector::orig_empty): New function. + + * Array2-idx.h (Array2::index (idx_vector&, idx_vector&)): + Don't always resize to [](0x0) if one of the indices is empty or + zero. + + Sun Feb 2 22:33:44 1997 John W. Eaton + + * cmd-hist.cc (command_history::read): New arg, must_exist. + Set line_in_file here too. + (command_history::read_range): New arg, must_exist. + + Fri Jan 31 09:21:57 1997 John W. Eaton + + * f2c-main.c: Change C++-style comments to C-style comments. + + Tue Jan 28 10:46:02 1997 John W. Eaton + + * Makefile.in (install-inc): Create a relative symbolic link. + Mon Jan 27 15:52:27 1997 John W. Eaton * Version 2.0.2 released. diff -cNr octave-2.0.2/liboctave/Makefile.in octave-2.0.3/liboctave/Makefile.in *** octave-2.0.2/liboctave/Makefile.in Fri Jan 24 23:25:34 1997 --- octave-2.0.3/liboctave/Makefile.in Fri Feb 14 16:21:58 1997 *************** *** 98,115 **** LIBOCTAVE_DEPEND := $(patsubst %, liboctave.a(%), $(OBJECTS)) ! all: stamp-prereq stamp-picdir liboctave.a stamp-shared .PHONY: all ! stamp-prereq: safe-stat.h safe-lstat.h touch stamp-prereq stamp-picdir: ! if $(SHARED_LIBS); then \ if [ -n "$(CPICFLAG)" ] || [ -n "$(CXXPICFLAG)" ]; then \ if [ -d pic ]; then \ true ; \ else \ mkdir pic ; \ fi ; \ fi ; \ --- 98,116 ---- LIBOCTAVE_DEPEND := $(patsubst %, liboctave.a(%), $(OBJECTS)) ! all: liboctave.a stamp-shared .PHONY: all ! stamp-prereq: stamp-picdir safe-stat.h safe-lstat.h touch stamp-prereq stamp-picdir: ! @if $(SHARED_LIBS); then \ if [ -n "$(CPICFLAG)" ] || [ -n "$(CXXPICFLAG)" ]; then \ if [ -d pic ]; then \ true ; \ else \ + echo "mkdir pic" ; \ mkdir pic ; \ fi ; \ fi ; \ *************** *** 118,131 **** fi touch stamp-picdir ! liboctave.a: $(OBJECTS) $(AR) $(ARFLAGS) liboctave.a $(OBJECTS) $(RANLIB) liboctave.a ! stamp-shared: $(PICOBJ) if $(SHARED_LIBS); then \ ! $(CXX) -shared -o liboctave.$(SHLEXT) $(PICOBJ) \ ! $(LIBOCTAVE_LFLAGS) $(LIBOCTAVE_LIBS) ; \ else \ true ; \ fi --- 119,131 ---- fi touch stamp-picdir ! liboctave.a: stamp-prereq $(OBJECTS) $(AR) $(ARFLAGS) liboctave.a $(OBJECTS) $(RANLIB) liboctave.a ! stamp-shared: stamp-prereq $(PICOBJ) if $(SHARED_LIBS); then \ ! $(SH_LD) $(SH_LDFLAGS) -o liboctave.$(SHLEXT) $(PICOBJ) ; \ else \ true ; \ fi *************** *** 181,195 **** rm -f $(octincludedir)/$$f ; \ $(INSTALL_DATA) $(srcdir)/$$f $(octincludedir)/$$f ; \ done ! linkdir=`echo $(octincludedir) | sed 's/-$(version)$$//'` ; \ ! if [ "$$linkdir" = $(octincludedir) ] ; then \ true ; \ else \ ! if [ -d $$linkdir ] ; then \ true ; \ else \ ! rm -f $$linkdir ; \ ! $(LN_S) $(octincludedir) $$linkdir ; \ fi ; \ fi .PHONY: install-inc --- 181,197 ---- rm -f $(octincludedir)/$$f ; \ $(INSTALL_DATA) $(srcdir)/$$f $(octincludedir)/$$f ; \ done ! tmp=`echo $(octincludedir) | sed 's|/*$$||'` ; \ ! dir=`echo $$tmp | sed 's|[^/]*$$||'` ; \ ! src=`echo $$tmp | sed 's|^.*/||'` ; \ ! dest=`echo $$src | sed 's|-$(version)$$||'` ; \ ! if [ "$$src" = "$$dest" ] ; then \ true ; \ else \ ! if [ -d $$dir/$$dest ] ; then \ true ; \ else \ ! cd $$dir ; rm -f $$dest && $(LN_S) $$src $$dest ; \ fi ; \ fi .PHONY: install-inc *************** *** 231,237 **** if [ -n "$(BINDISTFILES)" ]; then \ ln $(BINDISTFILES) ../`cat ../.fname`/liboctave ; \ fi ! echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES .PHONY: bin-dist # If missing, GNU make attempts to create them in the reverse of the --- 233,241 ---- if [ -n "$(BINDISTFILES)" ]; then \ ln $(BINDISTFILES) ../`cat ../.fname`/liboctave ; \ fi ! if [ -n "$(BINDISTLIBS)" ]; then \ ! echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES ; \ ! fi .PHONY: bin-dist # If missing, GNU make attempts to create them in the reverse of the diff -cNr octave-2.0.2/liboctave/chMatrix.h octave-2.0.3/liboctave/chMatrix.h *** octave-2.0.2/liboctave/chMatrix.h Sun Nov 10 18:58:28 1996 --- octave-2.0.3/liboctave/chMatrix.h Thu Feb 13 13:21:44 1997 *************** *** 201,206 **** --- 201,207 ---- friend Matrix map (d_d_Mapper f, const Matrix& a); friend Matrix map (d_c_Mapper f, const ComplexMatrix& a); + void map (d_d_Mapper f); Matrix all (void) const; diff -cNr octave-2.0.2/liboctave/cmd-hist.cc octave-2.0.3/liboctave/cmd-hist.cc *** octave-2.0.2/liboctave/cmd-hist.cc Wed Nov 13 21:29:39 1996 --- octave-2.0.3/liboctave/cmd-hist.cc Sun Feb 2 22:59:24 1997 *************** *** 179,225 **** } void ! command_history::read (const string& f_arg) { ! string f = f_arg; ! ! if (f.empty ()) ! f = xfile; if (! f.empty ()) { int status = ::read_history (f.c_str ()); ! if (status != 0) error (status); else ! ::using_history (); } else error ("command_history::read: missing file name"); } void ! command_history::read_range (const string& f_arg, int from, int to) { if (from < 0) from = lines_in_file; - string f = f_arg; - - if (f.empty ()) - f = xfile; - if (! f.empty ()) { int status = ::read_history_range (f.c_str (), from, to); ! if (status != 0) error (status); else { - ::using_history (); lines_in_file = where (); } } else --- 179,233 ---- } void ! command_history::read (bool must_exist) { ! read (xfile, must_exist); ! } + void + command_history::read (const string& f, bool must_exist) + { if (! f.empty ()) { int status = ::read_history (f.c_str ()); ! if (status != 0 && must_exist) error (status); else ! { ! lines_in_file = where (); ! ! ::using_history (); ! } } else error ("command_history::read: missing file name"); } void ! command_history::read_range (int from, int to, bool must_exist) ! { ! read_range (xfile, from, to, must_exist); ! } ! ! void ! command_history::read_range (const string& f, int from, int to, ! bool must_exist) { if (from < 0) from = lines_in_file; if (! f.empty ()) { int status = ::read_history_range (f.c_str (), from, to); ! if (status != 0 && must_exist) error (status); else { lines_in_file = where (); + + ::using_history (); } } else diff -cNr octave-2.0.2/liboctave/cmd-hist.h octave-2.0.3/liboctave/cmd-hist.h *** octave-2.0.2/liboctave/cmd-hist.h Sat Mar 2 19:16:15 1996 --- octave-2.0.3/liboctave/cmd-hist.h Sun Feb 2 22:58:45 1997 *************** *** 64,72 **** int is_stifled (void); ! void read (const string& = string ()); ! void read_range (const string& = string (), int = -1, int = -1); void write (const string& = string ()); --- 64,77 ---- int is_stifled (void); ! void read (bool = true); ! void read (const string&, bool = true); ! ! void read_range (int = -1, int = -1, bool = true); ! ! void read_range (const string&, int = -1, int = -1, ! bool = true); void write (const string& = string ()); diff -cNr octave-2.0.2/liboctave/dColVector.cc octave-2.0.3/liboctave/dColVector.cc *** octave-2.0.2/liboctave/dColVector.cc Sat Oct 12 13:31:35 1996 --- octave-2.0.3/liboctave/dColVector.cc Thu Feb 13 13:35:01 1997 *************** *** 282,309 **** // other operations ColumnVector ! map (d_d_Mapper f, const ColumnVector& a) { ! ColumnVector b (a); ! b.map (f); ! return b; } ! ColumnVector ! map (d_c_Mapper f, const ComplexColumnVector& a) { ! int a_len = a.length (); ! ColumnVector b (a_len); ! for (int i = 0; i < a_len; i++) ! b.elem (i) = f (a.elem (i)); ! return b; ! } - void - ColumnVector::map (d_d_Mapper f) - { for (int i = 0; i < length (); i++) ! elem (i) = f (elem (i)); } double --- 282,302 ---- // other operations ColumnVector ! ColumnVector::map (d_d_Mapper f) const { ! ColumnVector b (*this); ! return b.apply (f); } ! ColumnVector& ! ColumnVector::apply (d_d_Mapper f) { ! double *d = fortran_vec (); // Ensures only one reference to my privates! for (int i = 0; i < length (); i++) ! d[i] = f (d[i]); ! ! return *this; } double diff -cNr octave-2.0.2/liboctave/dColVector.h octave-2.0.3/liboctave/dColVector.h *** octave-2.0.2/liboctave/dColVector.h Sat Oct 12 13:31:35 1996 --- octave-2.0.3/liboctave/dColVector.h Thu Feb 13 13:26:29 1997 *************** *** 86,94 **** // other operations ! friend ColumnVector map (d_d_Mapper f, const ColumnVector& a); ! friend ColumnVector map (d_c_Mapper f, const ComplexColumnVector& a); ! void map (d_d_Mapper f); double min (void) const; double max (void) const; --- 86,94 ---- // other operations ! ColumnVector map (d_d_Mapper f) const; ! ! ColumnVector& apply (d_d_Mapper f); double min (void) const; double max (void) const; diff -cNr octave-2.0.2/liboctave/dMatrix.cc octave-2.0.3/liboctave/dMatrix.cc *** octave-2.0.2/liboctave/dMatrix.cc Sun Jan 5 12:02:52 1997 --- octave-2.0.3/liboctave/dMatrix.cc Thu Feb 13 13:29:09 1997 *************** *** 1841,1872 **** // other operations. Matrix ! map (d_d_Mapper f, const Matrix& a) { ! Matrix b (a); ! b.map (f); ! return b; } ! Matrix ! map (d_c_Mapper f, const ComplexMatrix& a) ! { ! int a_nc = a.cols (); ! int a_nr = a.rows (); ! Matrix b (a_nr, a_nc); ! for (int j = 0; j < a_nc; j++) ! for (int i = 0; i < a_nr; i++) ! b.elem (i, j) = f (a.elem (i, j)); ! return b; ! } ! ! void ! Matrix::map (d_d_Mapper f) { double *d = fortran_vec (); // Ensures only one reference to my privates! for (int i = 0; i < length (); i++) d[i] = f (d[i]); } bool --- 1841,1861 ---- // other operations. Matrix ! Matrix::map (d_d_Mapper f) const { ! Matrix b (*this); ! return b.apply (f); } ! Matrix& ! Matrix::apply (d_d_Mapper f) { double *d = fortran_vec (); // Ensures only one reference to my privates! for (int i = 0; i < length (); i++) d[i] = f (d[i]); + + return *this; } bool diff -cNr octave-2.0.2/liboctave/dMatrix.h octave-2.0.3/liboctave/dMatrix.h *** octave-2.0.2/liboctave/dMatrix.h Sat Oct 12 13:23:01 1996 --- octave-2.0.3/liboctave/dMatrix.h Thu Feb 13 13:26:44 1997 *************** *** 203,211 **** // other operations ! friend Matrix map (d_d_Mapper f, const Matrix& a); ! friend Matrix map (d_c_Mapper f, const ComplexMatrix& a); ! void map (d_d_Mapper f); bool any_element_is_negative (void) const; bool any_element_is_inf_or_nan (void) const; --- 203,211 ---- // other operations ! Matrix map (d_d_Mapper f) const; ! ! Matrix& apply (d_d_Mapper f); bool any_element_is_negative (void) const; bool any_element_is_inf_or_nan (void) const; diff -cNr octave-2.0.2/liboctave/dRowVector.cc octave-2.0.3/liboctave/dRowVector.cc *** octave-2.0.2/liboctave/dRowVector.cc Sat Oct 12 13:31:35 1996 --- octave-2.0.3/liboctave/dRowVector.cc Thu Feb 13 13:36:53 1997 *************** *** 255,282 **** // other operations RowVector ! map (d_d_Mapper f, const RowVector& a) { ! RowVector b (a); ! b.map (f); ! return b; } ! RowVector ! map (d_c_Mapper f, const ComplexRowVector& a) { ! int a_len = a.length (); ! RowVector b (a_len); ! for (int i = 0; i < a_len; i++) ! b.elem (i) = f (a.elem (i)); ! return b; ! } - void - RowVector::map (d_d_Mapper f) - { for (int i = 0; i < length (); i++) ! elem (i) = f (elem (i)); } double --- 255,275 ---- // other operations RowVector ! RowVector::map (d_d_Mapper f) const { ! RowVector b (*this); ! return b.apply (f); } ! RowVector& ! RowVector::apply (d_d_Mapper f) { ! double *d = fortran_vec (); // Ensures only one reference to my privates! for (int i = 0; i < length (); i++) ! d[i] = f (d[i]); ! ! return *this; } double diff -cNr octave-2.0.2/liboctave/dRowVector.h octave-2.0.3/liboctave/dRowVector.h *** octave-2.0.2/liboctave/dRowVector.h Sat Oct 12 13:31:34 1996 --- octave-2.0.3/liboctave/dRowVector.h Thu Feb 13 14:22:00 1997 *************** *** 81,89 **** // other operations ! friend RowVector map (d_d_Mapper f, const RowVector& a); ! friend RowVector map (d_c_Mapper f, const ComplexRowVector& a); ! void map (d_d_Mapper f); double min (void) const; double max (void) const; --- 81,89 ---- // other operations ! RowVector map (d_d_Mapper f) const; ! ! RowVector& apply (d_d_Mapper f); double min (void) const; double max (void) const; diff -cNr octave-2.0.2/liboctave/f2c-main.c octave-2.0.3/liboctave/f2c-main.c *** octave-2.0.2/liboctave/f2c-main.c Thu Dec 5 18:48:54 1996 --- octave-2.0.3/liboctave/f2c-main.c Fri Jan 31 09:21:52 1997 *************** *** 22,30 **** #include ! // I think that this is really only needed if linking to Fortran ! // compiled libraries on a Sun. It also seems to be needed on ! // some Linux/ELF systems with g77. It should never be called. #if defined (sun) int --- 22,30 ---- #include ! /* I think that this is really only needed if linking to Fortran ! compiled libraries on a Sun. It also seems to be needed on ! some Linux/ELF systems with g77. It should never be called. */ #if defined (sun) int diff -cNr octave-2.0.2/liboctave/file-ops.cc octave-2.0.3/liboctave/file-ops.cc *** octave-2.0.2/liboctave/file-ops.cc Fri Nov 8 18:10:05 1996 --- octave-2.0.3/liboctave/file-ops.cc Mon Feb 10 02:00:36 1997 *************** *** 238,243 **** --- 238,256 ---- return mkdir (name.c_str (), mode); } + int + oct_mkdir (const string& name, mode_t mode, string& msg) + { + msg = string (); + + int status = mkdir (name.c_str (), mode); + + if (status < 0) + msg = strerror (errno); + + return status; + } + // I don't know how to emulate this on systems that don't provide it. int *************** *** 251,256 **** --- 264,287 ---- #endif } + int + oct_mkfifo (const string& name, mode_t mode, string& msg) + { + msg = string (); + + #if defined (HAVE_MKFIFO) + int status = mkfifo (name.c_str (), mode); + + if (status < 0) + msg = strerror (errno); + + return status; + #else + ::error ("mkfifo: not implemented on this system"); + return -1; + #endif + } + // We provide a replacement for rename(). int *************** *** 259,264 **** --- 290,308 ---- return rename (from.c_str (), to.c_str ()); } + int + oct_rename (const string& from, const string& to, string& msg) + { + msg = string (); + + int status = rename (from.c_str (), to.c_str ()); + + if (status < 0) + msg = strerror (errno); + + return status; + } + // We provide a replacement for rmdir(). int *************** *** 267,272 **** --- 311,329 ---- return rmdir (name.c_str ()); } + int + oct_rmdir (const string& name, string& msg) + { + msg = string (); + + int status = rmdir (name.c_str ()); + + if (status < 0) + msg = strerror (errno); + + return status; + } + // We provide a replacement for tempnam(). string *************** *** 303,308 **** --- 360,378 ---- oct_unlink (const string& name) { return unlink (name.c_str ()); + } + + int + oct_unlink (const string& name, string& errmsg) + { + errmsg = string (); + + int status = unlink (name.c_str ()); + + if (status < 0) + errmsg = strerror (errno); + + return status; } /* diff -cNr octave-2.0.2/liboctave/file-ops.h octave-2.0.3/liboctave/file-ops.h *** octave-2.0.2/liboctave/file-ops.h Mon May 27 12:41:38 1996 --- octave-2.0.3/liboctave/file-ops.h Mon Feb 10 01:57:38 1997 *************** *** 192,203 **** --- 192,214 ---- extern int is_newer (const string&, time_t); extern int oct_mkdir (const string&, mode_t); + extern int oct_mkdir (const string&, mode_t, string&); + extern int oct_mkfifo (const string&, mode_t); + extern int oct_mkfifo (const string&, mode_t, string&); + extern int oct_rename (const string&, const string&); + extern int oct_rename (const string&, const string&, string&); + extern int oct_rmdir (const string&); + extern int oct_rmdir (const string&, string&); + extern string oct_tempnam (void); + extern int oct_umask (mode_t); + extern int oct_unlink (const string&); + extern int oct_unlink (const string&, string&); #endif diff -cNr octave-2.0.2/liboctave/idx-vector.h octave-2.0.3/liboctave/idx-vector.h *** octave-2.0.2/liboctave/idx-vector.h Sat Oct 12 13:31:34 1996 --- octave-2.0.3/liboctave/idx-vector.h Fri Feb 7 14:47:56 1997 *************** *** 217,222 **** --- 217,228 ---- int orig_rows (void) const { return rep->orig_rows (); } int orig_columns (void) const { return rep->orig_columns (); } + int orig_empty (void) const + { + return (! is_colon () + && (orig_rows () == 0 || orig_columns () == 0)); + } + // Unsafe. Avoid at all cost. void shorten (int n) { rep->shorten (n); } diff -cNr octave-2.0.2/liboctave/lo-ieee.cc octave-2.0.3/liboctave/lo-ieee.cc *** octave-2.0.2/liboctave/lo-ieee.cc Wed Dec 18 16:18:57 1996 --- octave-2.0.3/liboctave/lo-ieee.cc Tue Feb 11 19:43:01 1997 *************** *** 41,46 **** --- 41,54 ---- #endif #endif + #if defined (HAVE_INFINITY) + #extern "C" double infinity (); + #endif + + #if defined (HAVE_QUIET_NAN) + #extern "C" double quiet_nan (long); + #endif + #include "lo-ieee.h" // Octave's idea of infinity. *************** *** 58,64 **** // trying to make Inf and NaN. #if defined (HAVE_INFINITY) ! octave_Inf = (double) infinity (); #elif defined (linux) octave_Inf = HUGE_VAL; #elif defined (__alpha__) --- 66,72 ---- // trying to make Inf and NaN. #if defined (HAVE_INFINITY) ! octave_Inf = infinity (); #elif defined (linux) octave_Inf = HUGE_VAL; #elif defined (__alpha__) *************** *** 84,90 **** #if defined (HAVE_ISNAN) #if defined (HAVE_QUIET_NAN) ! octave_NaN = (double) quiet_nan (); #elif defined (linux) octave_NaN = NAN; #elif defined (__alpha__) --- 92,98 ---- #if defined (HAVE_ISNAN) #if defined (HAVE_QUIET_NAN) ! octave_NaN = quiet_nan (0L); #elif defined (linux) octave_NaN = NAN; #elif defined (__alpha__) diff -cNr octave-2.0.2/make/CVS/Entries octave-2.0.3/make/CVS/Entries *** octave-2.0.2/make/CVS/Entries Sat Oct 12 17:05:51 1996 --- octave-2.0.3/make/CVS/Entries Thu Feb 13 21:27:42 1997 *************** *** 1,6 **** - /ChangeLog/1.1/Fri Jul 19 01:40:08 1996// /README/1.1/Fri Jul 19 01:53:11 1996// - /common.make/1.4/Sat Mar 23 10:50:59 1996// /config.make/1.1/Thu Apr 27 22:05:53 1995// /dist.make/1.1/Thu Apr 27 22:05:53 1995// /library.make/1.1/Thu Apr 27 22:05:53 1995// --- 1,4 ---- *************** *** 11,13 **** --- 9,13 ---- /rdepend.make/1.1/Thu Apr 27 22:05:53 1995// /texi.make/1.2/Fri Sep 15 01:32:19 1995// /tkpathsea.make/1.1/Thu Apr 27 22:05:53 1995// + /ChangeLog/1.2/Fri Feb 14 03:26:16 1997// + /common.make/1.5/Fri Feb 14 03:25:58 1997// diff -cNr octave-2.0.2/make/ChangeLog octave-2.0.3/make/ChangeLog *** octave-2.0.2/make/ChangeLog Thu Jul 18 20:40:08 1996 --- octave-2.0.3/make/ChangeLog Thu Feb 13 21:26:16 1997 *************** *** 1,3 **** --- 1,7 ---- + Thu Feb 13 21:26:03 1997 John W. Eaton + + * common.make (SH_LD, SH_LDFLAGS): Substitute here. + Tue May 14 22:35:12 1996 John W. Eaton * misc.make (clean): Also remove pic/*.o. diff -cNr octave-2.0.2/make/common.make octave-2.0.3/make/common.make *** octave-2.0.2/make/common.make Sat Mar 23 04:50:59 1996 --- octave-2.0.3/make/common.make Thu Feb 13 21:25:58 1997 *************** *** 9,14 **** --- 9,17 ---- SHLEXT = @SHLEXT@ + SH_LD = @SH_LD@ + SH_LDFLAGS = @SH_LDFLAGS@ + SHARED_LIBS = @SHARED_LIBS@ CC = @CC@ diff -cNr octave-2.0.2/mkoctfile.in octave-2.0.3/mkoctfile.in *** octave-2.0.2/mkoctfile.in Sat Jan 25 22:50:37 1997 --- octave-2.0.3/mkoctfile.in Thu Feb 13 16:26:41 1997 *************** *** 29,34 **** --- 29,35 ---- LDFLAGS=%LDFLAGS% LIBFLAGS=%LIBFLAGS% + RLD_FLAG=%RLD_FLAG% FLIBS=%FLIBS% LIBS=%LIBS% LEXLIB=%LEXLIB% *************** *** 52,55 **** echo "making $octfile from $objfile" ! $CXX -shared -o $octfile $objfile $LIBFLAGS $OCTAVE_LIBS $FLIBS $LEXLIB $TERMLIBS $LIBS --- 53,56 ---- echo "making $octfile from $objfile" ! $CXX -shared -o $octfile $objfile $LIBFLAGS $RLD_FLAG $OCTAVE_LIBS $FLIBS $LEXLIB $TERMLIBS $LIBS diff -cNr octave-2.0.2/octMakefile.in octave-2.0.3/octMakefile.in *** octave-2.0.2/octMakefile.in Mon Jan 27 16:19:21 1997 --- octave-2.0.3/octMakefile.in Tue Feb 18 03:12:35 1997 *************** *** 16,24 **** INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ ! CONF_DISTFILES = Makefile.in octMakefile.in Makeconf.in configure \ configure.in config.guess config.sub aclocal.m4 config.h.in \ acconfig.h config.h.bot install-sh --- 16,25 ---- INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_DATA = @INSTALL_DATA@ ! CONF_DISTFILES = Makefile Makefile.in octMakefile.in Makeconf.in configure \ configure.in config.guess config.sub aclocal.m4 config.h.in \ acconfig.h config.h.bot install-sh *************** *** 49,55 **** ChangeLog ChangeLog.[0-9] BINDISTFILES = $(addprefix $(srcdir)/, $(XBINDISTFILES)) \ ! octave-bug VERSION ARCH # Subdirectories in which to run `make bin-dist'. BINDISTSUBDIRS = libcruft liboctave src kpathsea readline info \ --- 50,56 ---- ChangeLog ChangeLog.[0-9] BINDISTFILES = $(addprefix $(srcdir)/, $(XBINDISTFILES)) \ ! octave-bug config.status config.h VERSION ARCH # Subdirectories in which to run `make bin-dist'. BINDISTSUBDIRS = libcruft liboctave src kpathsea readline info \ *************** *** 101,108 **** install:: $(top_srcdir)/mkinstalldirs $(DIRS_TO_MAKE) ! $(INSTALL_PROGRAM) octave-bug $(bindir)/octave-bug ! $(INSTALL_PROGRAM) mkoctfile $(bindir)/mkoctfile $(INSTALL_DATA) config.h $(octincludedir)/config.h maintainer-clean:: --- 102,109 ---- install:: $(top_srcdir)/mkinstalldirs $(DIRS_TO_MAKE) ! $(INSTALL_SCRIPT) octave-bug $(bindir)/octave-bug ! $(INSTALL_SCRIPT) mkoctfile $(bindir)/mkoctfile $(INSTALL_DATA) config.h $(octincludedir)/config.h maintainer-clean:: *************** *** 124,130 **** .PHONY: clean mostlyclean distclean maintainer-clean maintainer-clean distclean:: ! rm -f octMakefile octave-bug Makefile Makeconf config.cache rm -f config.h config.log config.status Makerules.f77 rm -f mk-oct-links mkoctfile --- 125,131 ---- .PHONY: clean mostlyclean distclean maintainer-clean maintainer-clean distclean:: ! rm -f octMakefile octave-bug Makeconf config.cache rm -f config.h config.log config.status Makerules.f77 rm -f mk-oct-links mkoctfile *************** *** 151,158 **** find `cat .fname` \( \( -name RCS -a -type d \) \ -o \( -name OLD -a -type d \) -o -name "=*" \ -o -name '*~' -o -name '#*#' -o -name config.log \ ! -o -name config.status -o -name Makefile \ ! -o -name c-auto.h \) -print | xargs rm -rf rm -f `cat .fname`/test/octave.test/*.m rm -rf `cat .fname`/test/octave.test/npsol rm -rf `cat .fname`/test/octave.test/qpsol --- 152,158 ---- find `cat .fname` \( \( -name RCS -a -type d \) \ -o \( -name OLD -a -type d \) -o -name "=*" \ -o -name '*~' -o -name '#*#' -o -name config.log \ ! -o -name config.status -o -name c-auto.h \) -print | xargs rm -rf rm -f `cat .fname`/test/octave.test/*.m rm -rf `cat .fname`/test/octave.test/npsol rm -rf `cat .fname`/test/octave.test/qpsol *************** *** 200,216 **** # Rules for making a binary distribution. - bin-dist-type: - @if [ -z "$(DIST_TYPE)" ]; then \ - echo "***" ; \ - echo "*** Must specify a value for DIST_TYPE (static or dynamic)" ; \ - echo "***" ; \ - exit 1 ; \ - else \ - exit 0 ; \ - fi - .PHONY: bin-dist-type - VERSION: echo $(version) > VERSION .PHONY: VERSION --- 200,205 ---- *************** *** 219,226 **** echo $(target_host_type) > ARCH .PHONY: ARCH ! binary-dist: bin-dist-type VERSION ARCH octave-bug dist-info-files ! echo octave-$(version)-$(target_host_type)-$(DIST_TYPE) > .fname rm -rf `cat .fname` mkdir `cat .fname` ln $(BINDISTFILES) `cat .fname` --- 208,215 ---- echo $(target_host_type) > ARCH .PHONY: ARCH ! binary-dist: VERSION ARCH octave-bug dist-info-files ! echo octave-$(version)-$(target_host_type) > .fname rm -rf `cat .fname` mkdir `cat .fname` ln $(BINDISTFILES) `cat .fname` *************** *** 235,247 **** tar xf `cat .fname`.tar find `cat .fname` \( \( -name RCS -a -type d \) \ -o \( -name OLD -a -type d \) -o -name "=*" \ ! -o -name '*~' -o -name '#*#' -o -name config.log \ ! -o -name config.status -o -name Makefile \ -o -name c-auto.h \) -print | xargs rm -rf rm -f `cat .fname`/test/octave.test/*.m rm -rf `cat .fname`/test/octave.test/npsol rm -rf `cat .fname`/test/octave.test/qpsol ! chmod -R a+rwX `cat .fname` tar cf `cat .fname`.tar `cat .fname` rm -rf `cat .fname` gzip --best `cat .fname`.tar --- 224,239 ---- tar xf `cat .fname`.tar find `cat .fname` \( \( -name RCS -a -type d \) \ -o \( -name OLD -a -type d \) -o -name "=*" \ ! -o -name '*~' -o -name '#*#' -o -name Makefile \ -o -name c-auto.h \) -print | xargs rm -rf rm -f `cat .fname`/test/octave.test/*.m rm -rf `cat .fname`/test/octave.test/npsol rm -rf `cat .fname`/test/octave.test/qpsol ! chmod -R a+rw `cat .fname` ! find `cat .fname` \( -perm 766 -o -perm 676 -o -perm 667 \ ! -o -perm 776 -o -perm 677 -o -perm 767 \) -print | \ ! xargs chmod a+x scripts ! strip src/octave info/info tar cf `cat .fname`.tar `cat .fname` rm -rf `cat .fname` gzip --best `cat .fname`.tar diff -cNr octave-2.0.2/octave-bug.in octave-2.0.3/octave-bug.in *** octave-2.0.2/octave-bug.in Sat Jan 25 22:48:32 1997 --- octave-2.0.3/octave-bug.in Tue Feb 18 03:40:25 1997 *************** *** 34,39 **** --- 34,40 ---- CXXPICFLAG=%CXXPICFLAG% LDFLAGS=%LDFLAGS% LIBFLAGS=%LIBFLAGS% + RLD_FLAG=%RLD_FLAG% CXXLIBS=%CXXLIBS% TERMLIBS=%TERMLIBS% LIBS=%LIBS% *************** *** 95,101 **** if test -n "$ss_p"; then BUGADDR="octave-maintainers@bevo.che.wisc.edu" else ! pretest_p=`echo $VERSION | sed 's,.*\.\([0-9]*\).*,\1,' | grep -v '\.'` if test -n "$pretest_p" && test "$pretest_p" -ge 90; then BUGADDR="octave-maintainers@bevo.che.wisc.edu" --- 96,105 ---- if test -n "$ss_p"; then BUGADDR="octave-maintainers@bevo.che.wisc.edu" else ! pretest_p=`echo $VERSION \ ! | sed 's,.*\.\([0-9]*\).*,\1,' \ ! | grep -v '\.' \ ! | grep '[0-9]'` if test -n "$pretest_p" && test "$pretest_p" -ge 90; then BUGADDR="octave-maintainers@bevo.che.wisc.edu" *************** *** 167,172 **** --- 171,177 ---- CXXPICFLAG: $CXXPICFLAG LDFLAGS: $LDFLAGS LIBFLAGS: $LIBFLAGS + RLD_FLAG: $RLD_FLAG CXXLIBS: $CXXLIBS TERMLIBS: $TERMLIBS LIBS: $LIBS diff -cNr octave-2.0.2/readline/Makefile.in octave-2.0.3/readline/Makefile.in *** octave-2.0.2/readline/Makefile.in Fri Jan 24 23:23:24 1997 --- octave-2.0.3/readline/Makefile.in Fri Feb 14 16:21:26 1997 *************** *** 18,27 **** SHLEXT = @SHLEXT@ SHARED_LIBS = @SHARED_LIBS@ TERMLIBS = @TERMLIBS@ - SH_TERMLIBS = @SH_TERMLIBS@ LIBS_TO_INSTALL = libreadline.a libhistory.a --- 18,29 ---- SHLEXT = @SHLEXT@ + SH_LD = @SH_LD@ + SH_LDFLAGS = @SH_LDFLAGS@ + SHARED_LIBS = @SHARED_LIBS@ TERMLIBS = @TERMLIBS@ LIBS_TO_INSTALL = libreadline.a libhistory.a *************** *** 136,144 **** all: stamp-picdir libreadline.a libhistory.a stamp-readline stamp-history stamp-picdir: ! if [ -n "$(CPICFLAG)" ]; then \ ! if [ -d pic ]; then true; else mkdir pic ; fi ; \ ! else true; fi touch stamp-picdir libreadline.a: $(OBJECTS) --- 138,155 ---- all: stamp-picdir libreadline.a libhistory.a stamp-readline stamp-history stamp-picdir: ! @if $(SHARED_LIBS); then \ ! if [ -n "$(CPICFLAG)" ]; then \ ! if [ -d pic ]; then \ ! true ; \ ! else \ ! echo "mkdir pic" ; \ ! mkdir pic ; \ ! fi ; \ ! else \ ! true ; \ ! fi ; \ ! fi touch stamp-picdir libreadline.a: $(OBJECTS) *************** *** 153,165 **** stamp-readline: $(PICOBJ) if $(SHARED_LIBS); then \ ! $(CC) -shared -o libreadline.$(SHLEXT) $(PICOBJ) $(SH_TERMLIBS); \ fi touch stamp-readline stamp-history: $(HIST_PICOBJ) if $(SHARED_LIBS); then \ ! $(CC) -shared -o libhistory.$(SHLEXT) $(HIST_PICOBJ); \ fi touch stamp-history --- 164,176 ---- stamp-readline: $(PICOBJ) if $(SHARED_LIBS); then \ ! $(SH_LD) $(SH_LDFLAGS) -o libreadline.$(SHLEXT) $(PICOBJ) ; \ fi touch stamp-readline stamp-history: $(HIST_PICOBJ) if $(SHARED_LIBS); then \ ! $(SH_LD) $(SH_LDFLAGS) -o libhistory.$(SHLEXT) $(HIST_PICOBJ); \ fi touch stamp-history *************** *** 233,239 **** if [ -n "$(BINDISTFILES)" ]; then \ ln $(BINDISTFILES) ../`cat ../.fname`/readline ; \ fi ! echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES .PHONY: bin-dist # Dependencies --- 244,252 ---- if [ -n "$(BINDISTFILES)" ]; then \ ln $(BINDISTFILES) ../`cat ../.fname`/readline ; \ fi ! if [ -n "$(BINDISTLIBS)" ]; then \ ! echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES ; \ ! fi .PHONY: bin-dist # Dependencies diff -cNr octave-2.0.2/readline/configure octave-2.0.3/readline/configure *** octave-2.0.2/readline/configure Mon Jan 27 15:54:31 1997 --- octave-2.0.3/readline/configure Tue Feb 18 09:41:44 1997 *************** *** 599,624 **** ! if $SHARED_LIBS; then ! CPICFLAG=-fPIC ! SHLEXT=so ! case "$canonical_host_type" in ! alpha-dec-osf*) ! CPICFLAG= ! ;; ! rs6000-ibm-aix*) ! CPICFLAG= ! ;; ! hppa*-hp-hpux*) ! SHLEXT=sl ! ;; ! esac ! else ! CPICFLAG= ! SHLEXT= ! fi echo "$ac_t""defining CPICFLAG to be $CPICFLAG" 1>&6 echo "$ac_t""defining SHLEXT to be $SHLEXT" 1>&6 --- 599,630 ---- ! CPICFLAG=-fPIC ! SHLEXT=so ! SH_LD="$CC" ! SH_LDFLAGS=-shared ! case "$canonical_host_type" in ! *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) ! SH_LD=ld ! SH_LDFLAGS=-Bshareable ! ;; ! alpha-dec-osf*) ! CPICFLAG= ! SH_LDFLAGS="-Xlinker -exepct_unresolved -Xlinker '*'" ! ;; ! rs6000-ibm-aix* | powerpc-ibm-aix*) ! CPICFLAG= ! ;; ! hppa*-hp-hpux*) ! SHLEXT=sl ! ;; ! esac echo "$ac_t""defining CPICFLAG to be $CPICFLAG" 1>&6 echo "$ac_t""defining SHLEXT to be $SHLEXT" 1>&6 + echo "$ac_t""defining SH_LD to be $SH_LD" 1>&6 + echo "$ac_t""defining SH_LDFLAGS to be $SH_LDFLAGS" 1>&6 + + *************** *** 627,633 **** # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:631: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 633,639 ---- # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:637: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 656,662 **** # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:660: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 662,668 ---- # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:666: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 704,710 **** fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:708: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. --- 710,716 ---- fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:714: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. *************** *** 714,724 **** cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then --- 720,730 ---- cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then *************** *** 738,749 **** { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:742: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:747: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 744,755 ---- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:748: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ! echo "configure:753: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 752,758 **** yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no --- 758,764 ---- yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no *************** *** 767,773 **** ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:771: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 773,779 ---- ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ! echo "configure:777: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 795,801 **** fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:799: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= --- 801,807 ---- fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:805: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= *************** *** 810,822 **** # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : --- 816,828 ---- # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : *************** *** 827,839 **** rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : --- 833,845 ---- rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:843: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : *************** *** 857,869 **** if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 ! echo "configure:861: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP --- 863,875 ---- if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 ! echo "configure:867: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP *************** *** 881,887 **** if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA --- 887,893 ---- if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA *************** *** 913,919 **** # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:917: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 919,925 ---- # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:923: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 965,971 **** # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:969: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 971,977 ---- # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ! echo "configure:975: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 993,1001 **** TERMLIBS="" ! for termlib in termcap terminfo ncurses curses termlib; do echo $ac_n "checking for tputs in -l${termlib}""... $ac_c" 1>&6 ! echo "configure:999: checking for tputs in -l${termlib}" >&5 ac_lib_var=`echo ${termlib}'_'tputs | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 999,1007 ---- TERMLIBS="" ! for termlib in ncurses curses termcap terminfo termlib; do echo $ac_n "checking for tputs in -l${termlib}""... $ac_c" 1>&6 ! echo "configure:1005: checking for tputs in -l${termlib}" >&5 ac_lib_var=`echo ${termlib}'_'tputs | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1003,1009 **** ac_save_LIBS="$LIBS" LIBS="-l${termlib} $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1020,1026 ---- tputs() ; return 0; } EOF ! if { (eval echo configure:1024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 1043,1057 **** done - SH_TERMLIBS="$TERMLIBS" - case "$canonical_host_type" in - *-*-sunos4*) - SH_TERMLIBS= - ;; - esac - echo "$ac_t""defining SH_TERMLIBS to be $SH_TERMLIBS" 1>&6 - - case "$canonical_host_type" in *-*-sco*) cat >> confdefs.h <<\EOF --- 1049,1054 ---- *************** *** 1067,1078 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:1071: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> --- 1064,1075 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 ! echo "configure:1068: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> *************** *** 1080,1086 **** DIR *dirp = 0; ; return 0; } EOF ! if { (eval echo configure:1084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else --- 1077,1083 ---- DIR *dirp = 0; ; return 0; } EOF ! if { (eval echo configure:1081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else *************** *** 1105,1111 **** # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:1109: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1102,1108 ---- # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 ! echo "configure:1106: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1113,1119 **** ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1121,1127 ---- opendir() ; return 0; } EOF ! if { (eval echo configure:1125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 1146,1152 **** else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:1150: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1143,1149 ---- else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 ! echo "configure:1147: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1154,1160 **** ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1162,1168 ---- opendir() ; return 0; } EOF ! if { (eval echo configure:1166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else *************** *** 1188,1199 **** fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:1192: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 1185,1196 ---- fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:1189: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 1201,1207 **** #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* --- 1198,1204 ---- #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* *************** *** 1218,1224 **** if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF --- 1215,1221 ---- if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF *************** *** 1236,1242 **** if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF --- 1233,1239 ---- if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF *************** *** 1257,1263 **** : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') --- 1254,1260 ---- : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') *************** *** 1268,1274 **** exit (0); } EOF ! if { (eval echo configure:1272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else --- 1265,1271 ---- exit (0); } EOF ! if { (eval echo configure:1269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else *************** *** 1292,1303 **** fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 ! echo "configure:1296: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 1289,1300 ---- fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 ! echo "configure:1293: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 1306,1312 **** struct tm *tp; ; return 0; } EOF ! if { (eval echo configure:1310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else --- 1303,1309 ---- struct tm *tp; ; return 0; } EOF ! if { (eval echo configure:1307: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else *************** *** 1330,1346 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1334: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* --- 1327,1343 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1331: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* *************** *** 1370,1386 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1374: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* --- 1367,1383 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1371: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1381: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* *************** *** 1410,1426 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1414: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1424: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* --- 1407,1423 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1411: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* *************** *** 1450,1468 **** # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ! echo "configure:1454: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF ! if { (eval echo configure:1466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else --- 1447,1465 ---- # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 ! echo "configure:1451: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF ! if { (eval echo configure:1463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else *************** *** 1483,1494 **** fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 ! echo "configure:1487: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1484: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else --- 1508,1514 ---- char *p = (char *) alloca(1); ; return 0; } EOF ! if { (eval echo configure:1512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_func_alloca_works=yes else *************** *** 1543,1554 **** echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 ! echo "configure:1547: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1544: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1577: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1574: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 1598,1604 ---- ; return 0; } EOF ! if { (eval echo configure:1602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 1628,1634 **** fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:1632: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else --- 1625,1631 ---- fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 ! echo "configure:1629: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else *************** *** 1636,1642 **** ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else --- 1652,1658 ---- exit (find_stack_direction() < 0); } EOF ! if { (eval echo configure:1656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else *************** *** 1677,1688 **** fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:1681: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include --- 1674,1685 ---- fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:1678: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include *************** *** 1699,1705 **** int i; ; return 0; } EOF ! if { (eval echo configure:1703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else --- 1696,1702 ---- int i; ; return 0; } EOF ! if { (eval echo configure:1700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else *************** *** 1718,1729 **** echo $ac_n "checking for vprintf""... $ac_c" 1>&6 ! echo "configure:1722: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1719: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else --- 1743,1749 ---- ; return 0; } EOF ! if { (eval echo configure:1747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else *************** *** 1770,1781 **** if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 ! echo "configure:1774: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1771: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else --- 1795,1801 ---- ; return 0; } EOF ! if { (eval echo configure:1799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else *************** *** 1825,1836 **** for ac_func in getwd select strerror strcasecmp strncasecmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:1829: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1826: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 1850,1856 ---- ; return 0; } EOF ! if { (eval echo configure:1854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else *************** *** 2017,2029 **** s%@SHARED_LIBS@%$SHARED_LIBS%g s%@CPICFLAG@%$CPICFLAG%g s%@SHLEXT@%$SHLEXT%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@RANLIB@%$RANLIB%g s%@TERMLIBS@%$TERMLIBS%g - s%@SH_TERMLIBS@%$SH_TERMLIBS%g s%@ALLOCA@%$ALLOCA%g CEOF --- 2014,2027 ---- s%@SHARED_LIBS@%$SHARED_LIBS%g s%@CPICFLAG@%$CPICFLAG%g s%@SHLEXT@%$SHLEXT%g + s%@SH_LD@%$SH_LD%g + s%@SH_LDFLAGS@%$SH_LDFLAGS%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@RANLIB@%$RANLIB%g s%@TERMLIBS@%$TERMLIBS%g s%@ALLOCA@%$ALLOCA%g CEOF diff -cNr octave-2.0.2/readline/configure.in octave-2.0.3/readline/configure.in *** octave-2.0.2/readline/configure.in Wed Nov 13 00:02:47 1996 --- octave-2.0.3/readline/configure.in Thu Feb 13 21:11:50 1997 *************** *** 29,56 **** SHARED_LIBS=false) AC_SUBST(SHARED_LIBS) ! if $SHARED_LIBS; then ! CPICFLAG=-fPIC ! SHLEXT=so ! case "$canonical_host_type" in ! alpha-dec-osf*) ! CPICFLAG= ! ;; ! rs6000-ibm-aix*) ! CPICFLAG= ! ;; ! hppa*-hp-hpux*) ! SHLEXT=sl ! ;; ! esac ! else ! CPICFLAG= ! SHLEXT= ! fi AC_MSG_RESULT([defining CPICFLAG to be $CPICFLAG]) AC_MSG_RESULT([defining SHLEXT to be $SHLEXT]) AC_SUBST(CPICFLAG) AC_SUBST(SHLEXT) AC_CONFIG_HEADER(config.h) --- 29,62 ---- SHARED_LIBS=false) AC_SUBST(SHARED_LIBS) ! CPICFLAG=-fPIC ! SHLEXT=so ! SH_LD="$CC" ! SH_LDFLAGS=-shared ! case "$canonical_host_type" in ! *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) ! SH_LD=ld ! SH_LDFLAGS=-Bshareable ! ;; ! alpha-dec-osf*) ! CPICFLAG= ! SH_LDFLAGS="-Xlinker -exepct_unresolved -Xlinker '*'" ! ;; ! rs6000-ibm-aix* | powerpc-ibm-aix*) ! CPICFLAG= ! ;; ! hppa*-hp-hpux*) ! SHLEXT=sl ! ;; ! esac AC_MSG_RESULT([defining CPICFLAG to be $CPICFLAG]) AC_MSG_RESULT([defining SHLEXT to be $SHLEXT]) + AC_MSG_RESULT([defining SH_LD to be $SH_LD]) + AC_MSG_RESULT([defining SH_LDFLAGS to be $SH_LDFLAGS]) AC_SUBST(CPICFLAG) AC_SUBST(SHLEXT) + AC_SUBST(SH_LD) + AC_SUBST(SH_LDFLAGS) AC_CONFIG_HEADER(config.h) *************** *** 61,67 **** AC_PROG_RANLIB TERMLIBS="" ! for termlib in termcap terminfo ncurses curses termlib; do AC_CHECK_LIB(${termlib}, tputs, [TERMLIBS="${TERMLIBS} -l${termlib}"]) case "${TERMLIBS}" in *-l${termlib}*) --- 67,73 ---- AC_PROG_RANLIB TERMLIBS="" ! for termlib in ncurses curses termcap terminfo termlib; do AC_CHECK_LIB(${termlib}, tputs, [TERMLIBS="${TERMLIBS} -l${termlib}"]) case "${TERMLIBS}" in *-l${termlib}*) *************** *** 71,85 **** esac done AC_SUBST(TERMLIBS) - - SH_TERMLIBS="$TERMLIBS" - case "$canonical_host_type" in - *-*-sunos4*) - SH_TERMLIBS= - ;; - esac - AC_MSG_RESULT([defining SH_TERMLIBS to be $SH_TERMLIBS]) - AC_SUBST(SH_TERMLIBS) case "$canonical_host_type" in *-*-sco*) --- 77,82 ---- diff -cNr octave-2.0.2/scripts/ChangeLog octave-2.0.3/scripts/ChangeLog *** octave-2.0.2/scripts/ChangeLog Mon Jan 27 15:52:26 1997 --- octave-2.0.3/scripts/ChangeLog Tue Feb 18 09:22:27 1997 *************** *** 1,3 **** --- 1,39 ---- + Tue Feb 18 09:22:04 1997 John W. Eaton + + * Version 2.0.3 released. + + Thu Feb 13 19:06:42 1997 John W. Eaton + + * image/saveimage.m: Only clip image data that is actually out of + range. + + Sun Feb 9 19:52:08 1997 John W. Eaton + + * general/is_matrix.m: Scalars, vectors, and empty matrices may + also be considered to be matrices. + + * general/is_vector.m: Scalars may also be considered to be vectors. + + * general/isempty.m: Use size(), not rows() and columns(). + + * plot/contour.m: Convert set to gset. + Set view to 0, 0, 1, 1, not 0, 0, 1.9, 1. + + Fri Feb 7 12:55:55 1997 John W. Eaton + + * specfun/erfinv.m: Fix typo in last change. + + Fri Jan 31 09:30:16 1997 John W. Eaton + + * image/loadimage.m: Make it possible to load files with image + data named X or img. + + * image/default.img: Change name of image from X to img to match + what saveimage does now. + + * image/loadimage.m: Rename X to be img, to match what saveimage + does now. + Mon Jan 27 13:48:31 1997 John W. Eaton * Version 2.0.2 released. diff -cNr octave-2.0.2/scripts/general/is_matrix.m octave-2.0.3/scripts/general/is_matrix.m *** octave-2.0.2/scripts/general/is_matrix.m Thu Jul 11 22:58:02 1996 --- octave-2.0.3/scripts/general/is_matrix.m Sun Feb 9 22:05:45 1997 *************** *** 19,26 **** ## usage: is_matrix (x) ## ! ## Return 1 if the number of rows and columns of x are both greater ! ## than 1. ## ## See also: size, rows, columns, length, is_scalar, is_vector --- 19,25 ---- ## usage: is_matrix (x) ## ! ## Return 1 if X is a matrix. Otherwise, return 0. ## ## See also: size, rows, columns, length, is_scalar, is_vector *************** *** 30,36 **** if (nargin == 1) [nr, nc] = size (x); ! retval = (nr > 1 && nc > 1); else usage ("is_matrix (x)"); endif --- 29,35 ---- if (nargin == 1) [nr, nc] = size (x); ! retval = (nr >= 0 && nc >= 0); else usage ("is_matrix (x)"); endif diff -cNr octave-2.0.2/scripts/general/is_vector.m octave-2.0.3/scripts/general/is_vector.m *** octave-2.0.2/scripts/general/is_vector.m Mon Jul 15 17:20:21 1996 --- octave-2.0.3/scripts/general/is_vector.m Sun Feb 9 22:05:26 1997 *************** *** 19,26 **** ## usage: is_vector (x) ## ! ## Return 1 if the either the number of rows (columns) of x is 1 and ! ## the number of columns (rows) is greater than one. Otherwise, return 0. ## ## See also: size, rows, columns, length, is_scalar, is_matrix --- 19,25 ---- ## usage: is_vector (x) ## ! ## Return 1 if X is a vector. Otherwise, return 0. ## ## See also: size, rows, columns, length, is_scalar, is_matrix *************** *** 30,36 **** if (nargin == 1) [nr, nc] = size (x); ! retval = ((nr == 1 && nc > 1) || (nc == 1 && nr > 1)); else usage ("is_vector (x)"); endif --- 29,35 ---- if (nargin == 1) [nr, nc] = size (x); ! retval = ((nr == 1 && nc >= 1) || (nc == 1 && nr >= 1)); else usage ("is_vector (x)"); endif diff -cNr octave-2.0.2/scripts/general/isempty.m octave-2.0.3/scripts/general/isempty.m *** octave-2.0.2/scripts/general/isempty.m Thu Jul 11 22:58:02 1996 --- octave-2.0.3/scripts/general/isempty.m Sun Feb 9 21:59:28 1997 *************** *** 29,34 **** usage ("isempty (var)"); endif ! retval = (rows (var) == 0 || columns (var) == 0); endfunction --- 29,36 ---- usage ("isempty (var)"); endif ! [nr, nc] = size (var); ! ! retval = (nr == 0 || nc == 0); endfunction diff -cNr octave-2.0.2/scripts/general/linspace.m octave-2.0.3/scripts/general/linspace.m *** octave-2.0.2/scripts/general/linspace.m Mon Feb 13 10:46:08 1995 --- octave-2.0.3/scripts/general/linspace.m Tue Feb 18 11:43:41 1997 *************** *** 1,33 **** ! # Copyright (C) 1993, 1994, 1995 John W. Eaton ! # ! # This file is part of Octave. ! # ! # Octave is free software; you can redistribute it and/or modify it ! # under the terms of the GNU General Public License as published by the ! # Free Software Foundation; either version 2, or (at your option) any ! # later version. ! # ! # Octave is distributed in the hope that it will be useful, but WITHOUT ! # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ! # for more details. ! # ! # You should have received a copy of the GNU General Public License ! # along with Octave; see the file COPYING. If not, write to the Free ! # Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ! function retval = linspace (x1, x2, n) ! # usage: linspace (x1, x2, n) ! # ! # Return a vector of n equally spaced points between x1 and x2 ! # inclusive. ! # ! # If the final argument is omitted, n = 100 is assumed. ! # ! # All three arguments must be scalars. ! # ! # See also: logspace if (nargin == 2) npoints = 100; --- 1,35 ---- ! ## Copyright (C) 1993, 1994, 1995 John W. Eaton ! ## ! ## This file is part of Octave. ! ## ! ## Octave is free software; you can redistribute it and/or modify it ! ## under the terms of the GNU General Public License as published by the ! ## Free Software Foundation; either version 2, or (at your option) any ! ## later version. ! ## ! ## Octave is distributed in the hope that it will be useful, but WITHOUT ! ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ! ## for more details. ! ## ! ## You should have received a copy of the GNU General Public License ! ## along with Octave; see the file COPYING. If not, write to the Free ! ## Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ! ## usage: linspace (x1, x2, n) ! ## ! ## Return a vector of n equally spaced points between x1 and x2 ! ## inclusive. ! ## ! ## If the final argument is omitted, n = 100 is assumed. ! ## ! ## All three arguments must be scalars. ! ## ! ## See also: logspace ! ! ## Author: jwe ! function retval = linspace (x1, x2, n) if (nargin == 2) npoints = 100; *************** *** 45,52 **** error ("linspace: npoints must be greater than 2"); endif ! # In some cases x1 + delta * (npoints - 1) will not be equal to x2, so ! # we cheat and force the last value to be x2. if (length (x1) == 1 && length (x2) == 1) delta = (x2 - x1) / (npoints - 1); --- 47,54 ---- error ("linspace: npoints must be greater than 2"); endif ! ## In some cases x1 + delta * (npoints - 1) will not be equal to x2, ! ## so we cheat and force the last value to be x2. if (length (x1) == 1 && length (x2) == 1) delta = (x2 - x1) / (npoints - 1); diff -cNr octave-2.0.2/scripts/image/loadimage.m octave-2.0.3/scripts/image/loadimage.m *** octave-2.0.2/scripts/image/loadimage.m Mon Jul 15 17:20:21 1996 --- octave-2.0.3/scripts/image/loadimage.m Fri Jan 31 10:12:37 1997 *************** *** 19,25 **** ## Load an image file. ## ! ## [X, map] = loadimage (img_file) loads an image and it's associated ## color map from file img_file. The image must be in stored in ## octave's image format. ## --- 19,25 ---- ## Load an image file. ## ! ## [img, map] = loadimage (img_file) loads an image and it's associated ## color map from file img_file. The image must be in stored in ## octave's image format. ## *************** *** 29,38 **** ## Created: July 1994 ## Adapted-By: jwe ! function [X, map] = loadimage (filename) if (nargin != 1) ! usage ("loadimage (filename)"); elseif (! isstr (filename)) error ("loadimage: expecting filename as a string"); endif --- 29,38 ---- ## Created: July 1994 ## Adapted-By: jwe ! function [img_retval, map_retval] = loadimage (filename) if (nargin != 1) ! usage ("[img, map] = loadimage (filename)"); elseif (! isstr (filename)) error ("loadimage: expecting filename as a string"); endif *************** *** 43,50 **** error ("loadimage: unable to find image file"); endif ! ## XXX FIXME XXX -- file is assumed to have variables X and map. eval (['load ', file]); endfunction --- 43,64 ---- error ("loadimage: unable to find image file"); endif ! ## The file is assumed to have variables img and map, or X and map. eval (['load ', file]); + + if (exist ("img")) + img_retval = img; + elseif (exist ("X")) + img_retval = X; + else + error ("loadimage: invalid image file found"); + endif + + if (exist ("map")) + map_retval = map; + else + error ("loadimage: invalid image file found"); + endif endfunction diff -cNr octave-2.0.2/scripts/image/saveimage.m octave-2.0.3/scripts/image/saveimage.m *** octave-2.0.2/scripts/image/saveimage.m Thu Nov 7 21:12:20 1996 --- octave-2.0.3/scripts/image/saveimage.m Thu Feb 13 19:05:41 1997 *************** *** 141,147 **** img_sz = img_nr * img_nc; img = reshape (img, img_sz, 1); ! idx = find (img >= map_nr - 1); img (idx) = ones (size (idx)) * map_nr; idx = find (img <= 0); --- 141,147 ---- img_sz = img_nr * img_nc; img = reshape (img, img_sz, 1); ! idx = find (img > map_nr); img (idx) = ones (size (idx)) * map_nr; idx = find (img <= 0); *************** *** 163,169 **** if (n_long == 0) n_long = 8; else ! n_long = 1 + nlong; endif idx = 1:8:img_sz; --- 163,169 ---- if (n_long == 0) n_long = 8; else ! n_long++; endif idx = 1:8:img_sz; diff -cNr octave-2.0.2/scripts/linear-algebra/pinv.m octave-2.0.3/scripts/linear-algebra/pinv.m *** octave-2.0.2/scripts/linear-algebra/pinv.m Sun Jan 16 20:54:02 1994 --- octave-2.0.3/scripts/linear-algebra/pinv.m Tue Feb 18 11:48:40 1997 *************** *** 1,36 **** ! # Copyright (C) 1994 John W. Eaton ! # ! # This file is part of Octave. ! # ! # Octave is free software; you can redistribute it and/or modify it ! # under the terms of the GNU General Public License as published by the ! # Free Software Foundation; either version 2, or (at your option) any ! # later version. ! # ! # Octave is distributed in the hope that it will be useful, but WITHOUT ! # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ! # for more details. ! # ! # You should have received a copy of the GNU General Public License ! # along with Octave; see the file COPYING. If not, write to the Free ! # Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ! function retval = pinv (X, tol) ! # usage: pinv (X, tol) ! # ! # Returns the pseudoinverse of X; singular values less than tol are ! # ignored. ! # ! # If the second argument is omitted, it is assumed that ! # ! # tol = max (size (X)) * sigma_max (X) * eps, ! # ! # where sigma_max(X) is the maximal singular value of X. ! # Written by Kurt Hornik (hornik@neuro.tuwien.ac.at) March 1993. ! # Dept of Probability Theory and Statistics TU Wien, Austria. if (nargin < 1 || nargin > 2) error ("usage: pinv (X [, tol])"); --- 1,37 ---- ! ## Copyright (C) 1994 John W. Eaton ! ## ! ## This file is part of Octave. ! ## ! ## Octave is free software; you can redistribute it and/or modify it ! ## under the terms of the GNU General Public License as published by the ! ## Free Software Foundation; either version 2, or (at your option) any ! ## later version. ! ## ! ## Octave is distributed in the hope that it will be useful, but WITHOUT ! ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ! ## for more details. ! ## ! ## You should have received a copy of the GNU General Public License ! ## along with Octave; see the file COPYING. If not, write to the Free ! ## Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ! ## usage: pinv (X, tol) ! ## ! ## Returns the pseudoinverse of X; singular values less than tol are ! ## ignored. ! ## ! ## If the second argument is omitted, it is assumed that ! ## ! ## tol = max (size (X)) * sigma_max (X) * eps, ! ## ! ## where sigma_max(X) is the maximal singular value of X. ! ## Author: Kurt Hornik (hornik@neuro.tuwien.ac.at> ! ## Created: March 1993. ! ## Adapted-By: jwe ! function retval = pinv (X, tol) if (nargin < 1 || nargin > 2) error ("usage: pinv (X [, tol])"); diff -cNr octave-2.0.2/scripts/miscellaneous/dump_1_pref.m octave-2.0.3/scripts/miscellaneous/dump_1_pref.m *** octave-2.0.2/scripts/miscellaneous/dump_1_pref.m Thu Jul 11 22:58:02 1996 --- octave-2.0.3/scripts/miscellaneous/dump_1_pref.m Tue Feb 18 11:49:25 1997 *************** *** 17,22 **** --- 17,24 ---- ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. + ## This is an internal function used by dump_prefs(). + ## Author: jwe function dump_1_pref (file, var) diff -cNr octave-2.0.2/scripts/plot/__pltopt__.m octave-2.0.3/scripts/plot/__pltopt__.m *** octave-2.0.2/scripts/plot/__pltopt__.m Fri Jul 12 12:22:12 1996 --- octave-2.0.3/scripts/plot/__pltopt__.m Tue Feb 18 11:47:47 1997 *************** *** 17,24 **** ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. - ## Originally written by Rick Niles . - ## usage: fmt = __pltopt__ (caller, opt) ## ## Decode plot option strings. --- 17,22 ---- *************** *** 39,45 **** ## "~" for errorbars plot style. ## "#~" for boxerrorbars plot style. ## "n" with n in 1-6 (wraps at 8), plot color ! ## "nm" with m in 1-6 (wraps at 6), point style (only valid with "@" or "-@") ## "c" where c is one of ["r", "g", "b", "m", "c", "w"] colors. ## ## Special points formats: --- 37,43 ---- ## "~" for errorbars plot style. ## "#~" for boxerrorbars plot style. ## "n" with n in 1-6 (wraps at 8), plot color ! ## "nm" with m in 1-6 (wraps at 6), point style (only valid for "@" or "-@") ## "c" where c is one of ["r", "g", "b", "m", "c", "w"] colors. ## ## Special points formats: *************** *** 60,66 **** ## 5 cyan house ## 6 brown there exists ! ## Author: jwe function fmt = __pltopt__ (caller, opt) --- 58,66 ---- ## 5 cyan house ## 6 brown there exists ! ## Author: Rick Niles ! ## Adapted-By: jwe ! ## Maintainer: jwe function fmt = __pltopt__ (caller, opt) diff -cNr octave-2.0.2/scripts/plot/contour.m octave-2.0.3/scripts/plot/contour.m *** octave-2.0.2/scripts/plot/contour.m Thu Nov 14 22:51:34 1996 --- octave-2.0.3/scripts/plot/contour.m Sun Feb 9 20:15:03 1997 *************** *** 39,45 **** command = sprintf ("gset cntrparam levels %d", n); eval (command); gset noparametric; ! gset view 0, 0, 1.9, 1; gsplot z w l 1; else error ("mesh: argument must be a matrix"); --- 39,45 ---- command = sprintf ("gset cntrparam levels %d", n); eval (command); gset noparametric; ! gset view 0, 0, 1, 1; gsplot z w l 1; else error ("mesh: argument must be a matrix"); *************** *** 64,73 **** gset nosurface; gset contour; gset cntrparam bspline; ! command = sprintf ("set cntrparam levels %d", n); eval (command); gset parametric; ! gset view 0, 0, 1.9, 1; gsplot zz w l 1; else msg = "mesh: rows (z) must be the same as length (x) and"; --- 64,73 ---- gset nosurface; gset contour; gset cntrparam bspline; ! command = sprintf ("gset cntrparam levels %d", n); eval (command); gset parametric; ! gset view 0, 0, 1, 1; gsplot zz w l 1; else msg = "mesh: rows (z) must be the same as length (x) and"; diff -cNr octave-2.0.2/scripts/specfun/erfinv.m octave-2.0.3/scripts/specfun/erfinv.m *** octave-2.0.2/scripts/specfun/erfinv.m Wed Jan 22 11:28:30 1997 --- octave-2.0.3/scripts/specfun/erfinv.m Fri Feb 7 12:55:52 1997 *************** *** 38,44 **** endif t = find (x == -1); ! y (tmp) = (-Inf) * ones (size (t)); t = find (x == 1); y (t) = Inf * ones (size (t)); --- 38,44 ---- endif t = find (x == -1); ! y (t) = (-Inf) * ones (size (t)); t = find (x == 1); y (t) = Inf * ones (size (t)); diff -cNr octave-2.0.2/scripts/strings/strcat.m octave-2.0.3/scripts/strings/strcat.m *** octave-2.0.2/scripts/strings/strcat.m Thu Jul 11 22:58:02 1996 --- octave-2.0.3/scripts/strings/strcat.m Tue Feb 18 11:45:57 1997 *************** *** 17,22 **** --- 17,26 ---- ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. + ## usage: strcat (s, t, ...) + ## + ## Concatenate strings. + ## Author: jwe function st = strcat (s, t, ...) diff -cNr octave-2.0.2/src/ChangeLog octave-2.0.3/src/ChangeLog *** octave-2.0.2/src/ChangeLog Mon Jan 27 15:52:23 1997 --- octave-2.0.3/src/ChangeLog Tue Feb 18 09:22:22 1997 *************** *** 1,3 **** --- 1,102 ---- + Tue Feb 18 09:22:04 1997 John W. Eaton + + * Version 2.0.3 released. + + Tue Feb 18 00:27:49 1997 John W. Eaton + + * toplev.cc (run_command_and_return_output): + Block SIGCHLD while running subprocess. + (cleanup_iprocstream): Unblock it here. + + * sighandlers.h (BLOCK_SIGNAL, BLOCK_CHILD, UNBLOCK_CHILD): Move here. + * sighandlers.cc: From here. + + * toplev.cc (system): Shift then mask exit status. + + * help.cc (try_info): Shift first, then mask exit status. + + * toplev.cc (octave_config_info): Handle option argument. + + Fri Feb 14 16:23:30 1997 John W. Eaton + + * oct-stream.cc (octave_base_stream::do_scanf): Don't forget to + check to see if the result matrix needs resizing! + + * Makefile.in (bin-dist): Don't write empty strings to LIBRARIES. + + Thu Feb 13 03:02:08 1997 John W. Eaton + + * Makefile.in (stamp-prereq): Depend on stamp-picdir. + (all): Don't depend on stamp-prereq or stamp-picdir. + (stamp-tinst, stamp-interp, libtinst.a, liboctinterp.a): + Do depend on stamp-prereq. + (stamp-picdir): Silence noise about making pic. + (stamp-tinst, stamp-interp): Use $(SH_LD) $(SH_LDFLAGS) instead of + $(CXX) -shared. + + * oct-conf.h.in: Reinstate RLD_FLAG. + * toplev.cc (octave_config_info): Likewise. + + * data.cc (map_d_m, map_m_d, map_m_m): Rename from map. + (Fatan2): Use new function names. + + * pt-fvc.cc (apply_mapper_fcn): Use member function map() instead + of friend function. + + * gripes.cc (gripe_wrong_type_arg (const char*, const string&)): + New function. + + Wed Feb 12 17:27:53 1997 John W. Eaton + + * syscalls.cc (symbols_of_syscalls): Add O_ASYNC and O_SYNC. + + Mon Feb 10 01:22:27 1997 John W. Eaton + + * dirfns.cc (Freaddir, Fmkdir, Frmdir, Frename): + Also return status and error message. + + * syscalls.cc (Fdup2, Fexec, Ffork, Ffcntl, Funlink, Fmkfifo, + Fpipe, Fwaitpid): Also return error message. + + Sat Feb 8 17:16:09 1997 John W. Eaton + + * pt-exp.cc (tree_simple_assignment_expression::eval): Return + value of RHS, but (if printing) print complete value of LHS. + + * pr-output.cc (octave_print_internal): Print a new line for empty + string matrices. + + Wed Feb 5 14:30:44 1997 John W. Eaton + + * oct-stream.cc (scanf_format_list::process_conversion): Accept + but don't actually use h, l, and L modifiers. Always insert l + modifier for floating point conversions. + + Fri Jan 31 13:55:10 1997 John W. Eaton + + * pager.cc (do_sync): Always flush the cout stream after writing. + + Wed Jan 29 08:25:29 1997 John W. Eaton + + * defaults.cc (exec_path): Don't include bin_dir in std_path. + + * pager.cc (do_sync): Flush the cout stream after writing if + running in interactive or forced_interactive mode. + + * mk-oct-links: Rename from mk-oct-links.in. + Don't use symbolic links. + * Makefile.in: Distribute mk-oct-links, not mk-oct-links.in + (mk-oct-links): Delete target. + (install-oct, bin-dist): Don't depend on mk-oct-links. + Run $(srcdir)/mk-oct-links, not ./mk-oct-links. + + * qr.cc (qr): Doc fix. + + Tue Jan 28 10:48:28 1997 John W. Eaton + + * Makefile.in (install-inc): Create a relative symbolic link. + (install-bin): Create a relative symbolic link. + Mon Jan 27 12:12:03 1997 John W. Eaton * Version 2.0.2 released. diff -cNr octave-2.0.2/src/Makefile.in octave-2.0.3/src/Makefile.in *** octave-2.0.2/src/Makefile.in Mon Jan 27 14:51:42 1997 --- octave-2.0.3/src/Makefile.in Fri Feb 14 16:21:50 1997 *************** *** 32,47 **** ifeq ($(OCTAVE_LITE), true) ifdef CXXPICFLAG %.oct : pic/%.o ! $(CXX) -shared -o $@ $< \ ! $(OCTAVE_LFLAGS) \ ! $(OCTAVE_LIBS) \ ! $(FLIBS) $(LEXLIB) $(TERMLIBS) $(LIBS) else %.oct : %.o ! $(CXX) -shared -o $@ $< \ ! $(OCTAVE_LFLAGS) \ ! $(OCTAVE_LIBS) \ ! $(FLIBS) $(LEXLIB) $(TERMLIBS) $(LIBS) endif endif --- 32,41 ---- ifeq ($(OCTAVE_LITE), true) ifdef CXXPICFLAG %.oct : pic/%.o ! $(CXX) -shared -o $@ $< else %.oct : %.o ! $(CXX) -shared -o $@ $< endif endif *************** *** 165,171 **** LIBS = @LIBS@ ! DISTFILES = Makefile.in ChangeLog mkdefs mkbuiltins mk-oct-links.in \ defaults.h.in oct-conf.h.in octave.gperf oct-gperf.h \ octave.cc parse.cc lex.cc y.tab.h \ $(INCLUDES) $(DLD_SRC) $(SOURCES) $(TI_SRC) --- 159,165 ---- LIBS = @LIBS@ ! DISTFILES = Makefile.in ChangeLog mkdefs mkbuiltins mk-oct-links \ defaults.h.in oct-conf.h.in octave.gperf oct-gperf.h \ octave.cc parse.cc lex.cc y.tab.h \ $(INCLUDES) $(DLD_SRC) $(SOURCES) $(TI_SRC) *************** *** 177,186 **** BINDISTFILES = octave $(OCT_FILES) endif ! all: stamp-prereq stamp-picdir libraries $(OCT_FILES) octave .PHONY: all ! stamp-prereq: defaults.h oct-conf.h touch stamp-prereq octave: octave.o builtins.o $(DLD_STATIC_OBJ) libraries --- 171,180 ---- BINDISTFILES = octave $(OCT_FILES) endif ! all: libraries $(OCT_FILES) octave .PHONY: all ! stamp-prereq: stamp-picdir defaults.h oct-conf.h touch stamp-prereq octave: octave.o builtins.o $(DLD_STATIC_OBJ) libraries *************** *** 191,201 **** $(FLIBS) $(LEXLIB) $(TERMLIBS) $(LIBS) stamp-picdir: ! if [ "$(SHARED_LIBS)" = true ] || [ "$(OCTAVE_LITE)" = true ]; then \ if [ -n "$(CPICFLAG)" ] || [ -n "$(CXXPICFLAG)" ]; then \ if [ -d pic ]; then \ true ; \ else \ mkdir pic ; \ fi ; \ fi ; \ --- 185,196 ---- $(FLIBS) $(LEXLIB) $(TERMLIBS) $(LIBS) stamp-picdir: ! @if $(SHARED_LIBS) || [ "$(OCTAVE_LITE)" = true ]; then \ if [ -n "$(CPICFLAG)" ] || [ -n "$(CXXPICFLAG)" ]; then \ if [ -d pic ]; then \ true ; \ else \ + echo "mkdir pic" ; \ mkdir pic ; \ fi ; \ fi ; \ *************** *** 206,236 **** libraries: liboctinterp.a libtinst.a stamp-interp stamp-tinst ! liboctinterp.a: $(OBJECTS) $(AR) $(ARFLAGS) liboctinterp.a $(OBJECTS) $(RANLIB) liboctinterp.a ! libtinst.a: $(TI_OBJ) $(AR) $(ARFLAGS) libtinst.a $(TI_OBJ) $(RANLIB) libtinst.a ! stamp-interp: $(PICOBJ) if $(SHARED_LIBS); then \ ! $(CXX) -shared -o liboctinterp.$(SHLEXT) $(PICOBJ) \ ! $(OCTAVE_LFLAGS) \ ! -loctave -lcruft -ltinst -lreadline -lkpathsea \ ! $(SH_TERMLIBS) $(SH_LIBS) ; \ else \ true ; \ fi touch stamp-interp ! stamp-tinst: $(TI_PICOBJ) if $(SHARED_LIBS); then \ ! $(CXX) -shared -o libtinst.$(SHLEXT) $(TI_PICOBJ) \ ! $(OCTAVE_LFLAGS) \ ! -loctinterp -loctave -lcruft -lreadline -lkpathsea \ ! $(SH_TERMLIBS) $(SH_LIBS) ; \ else \ true ; \ fi --- 201,225 ---- libraries: liboctinterp.a libtinst.a stamp-interp stamp-tinst ! liboctinterp.a: stamp-prereq $(OBJECTS) $(AR) $(ARFLAGS) liboctinterp.a $(OBJECTS) $(RANLIB) liboctinterp.a ! libtinst.a: stamp-prereq $(TI_OBJ) $(AR) $(ARFLAGS) libtinst.a $(TI_OBJ) $(RANLIB) libtinst.a ! stamp-interp: stamp-prereq $(PICOBJ) if $(SHARED_LIBS); then \ ! $(SH_LD) $(SH_LDFLAGS) -o liboctinterp.$(SHLEXT) $(PICOBJ) ; \ else \ true ; \ fi touch stamp-interp ! stamp-tinst: stamp-prereq $(TI_PICOBJ) if $(SHARED_LIBS); then \ ! $(SH_LD) $(SH_LDFLAGS) -o libtinst.$(SHLEXT) $(TI_PICOBJ) ; \ else \ true ; \ fi *************** *** 253,279 **** install: install-bin install-oct install-lib install-inc .PHONY: install - mk-oct-links: mk-oct-links.in - sed < $< > $@.tmp \ - -e "s;%LN_S%;${LN_S};" - $(top_srcdir)/move-if-change $@.tmp $@ - chmod a+rx mk-oct-links - install-bin: $(top_srcdir)/mkinstalldirs $(bindir) ! rm -f $(bindir)/octave $(INSTALL_PROGRAM) octave$(EXE) $(bindir)/octave-$(version)$(EXE) ! $(LN_S) $(bindir)/octave-$(version)$(EXE) $(bindir)/octave$(EXE) .PHONY: install-bin ! install-oct: mk-oct-links if [ -n "$(OCT_FILES)" ]; then \ $(top_srcdir)/mkinstalldirs $(octfiledir) ; \ xfiles="$(OCT_FILES)" ; \ for f in $$xfiles ; do \ $(INSTALL_PROGRAM) $$f $(octfiledir)/$$f; \ done ; \ ! ./mk-oct-links $(octfiledir) $(addprefix $(srcdir)/, $(DLD_SRC)) ; \ fi .PHONY: install-oct --- 242,263 ---- install: install-bin install-oct install-lib install-inc .PHONY: install install-bin: $(top_srcdir)/mkinstalldirs $(bindir) ! rm -f $(bindir)/octave$(EXE) $(INSTALL_PROGRAM) octave$(EXE) $(bindir)/octave-$(version)$(EXE) ! cd $(bindir) ; $(LN_S) octave-$(version)$(EXE) octave$(EXE) .PHONY: install-bin ! install-oct: if [ -n "$(OCT_FILES)" ]; then \ $(top_srcdir)/mkinstalldirs $(octfiledir) ; \ xfiles="$(OCT_FILES)" ; \ for f in $$xfiles ; do \ $(INSTALL_PROGRAM) $$f $(octfiledir)/$$f; \ done ; \ ! $(srcdir)/mk-oct-links \ ! $(octfiledir) $(addprefix $(srcdir)/, $(DLD_SRC)) ; \ fi .PHONY: install-oct *************** *** 297,309 **** rm -f $(octincludedir)/$$f ; \ $(INSTALL_DATA) $$f $(octincludedir)/$$f ; \ done ! linkdir=`echo $(octincludedir) | sed 's/-$(version)$$//'` ; \ ! if [ "$$linkdir" = $(octincludedir) ] ; then \ true ; \ else \ ! rm -f $$linkdir && $(LN_S) $(octincludedir) $$linkdir ; \ fi ! .PHONY: install-lib uninstall: rm -f $(bindir)/octave$(EXE) --- 281,300 ---- rm -f $(octincludedir)/$$f ; \ $(INSTALL_DATA) $$f $(octincludedir)/$$f ; \ done ! tmp=`echo $(octincludedir) | sed 's|/*$$||'` ; \ ! dir=`echo $$tmp | sed 's|[^/]*$$||'` ; \ ! src=`echo $$tmp | sed 's|^.*/||'` ; \ ! dest=`echo $$src | sed 's|-$(version)$$||'` ; \ ! if [ "$$src" = "$$dest" ] ; then \ true ; \ else \ ! if [ -d $$dir/$$dest ] ; then \ ! true ; \ ! else \ ! cd $$dir ; rm -f $$dest && $(LN_S) $$src $$dest ; \ ! fi ; \ fi ! .PHONY: install-inc uninstall: rm -f $(bindir)/octave$(EXE) *************** *** 330,336 **** .PHONY: mostlyclean distclean: clean ! rm -f Makefile octave .fname so_locations mk-oct-links rm -f stamp-picdir stamp-tinst stamp-interp stamp-prereq -rmdir pic .PHONY: distclean --- 321,327 ---- .PHONY: mostlyclean distclean: clean ! rm -f Makefile octave .fname so_locations rm -f stamp-picdir stamp-tinst stamp-interp stamp-prereq -rmdir pic .PHONY: distclean *************** *** 351,366 **** ln octave.cc Makefile.in ../`cat ../.fname`/src .PHONY: conf-dist ! bin-dist: mk-oct-links if [ -n "$(BINDISTFILES)" ]; then \ ln $(BINDISTFILES) ../`cat ../.fname`/src ; \ fi if [ -n "$(OCT_FILES)" ]; then \ ! ./mk-oct-links -p $(octfiledir) \ $(addprefix $(srcdir)/, $(DLD_SRC)) \ > ../`cat ../.fname`/src/links-to-make ; \ fi ! echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES .PHONY: bin-dist # Special rules -- these files need special things to be defined. --- 342,359 ---- ln octave.cc Makefile.in ../`cat ../.fname`/src .PHONY: conf-dist ! bin-dist: if [ -n "$(BINDISTFILES)" ]; then \ ln $(BINDISTFILES) ../`cat ../.fname`/src ; \ fi if [ -n "$(OCT_FILES)" ]; then \ ! $(srcdir)/mk-oct-links -p $(octfiledir) \ $(addprefix $(srcdir)/, $(DLD_SRC)) \ > ../`cat ../.fname`/src/links-to-make ; \ fi ! if [ -n "$(BINDISTLIBS)" ]; then \ ! echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES ; \ ! fi .PHONY: bin-dist # Special rules -- these files need special things to be defined. diff -cNr octave-2.0.2/src/Stack.h octave-2.0.3/src/Stack.h *** octave-2.0.2/src/Stack.h Mon Dec 9 23:27:21 1996 --- octave-2.0.3/src/Stack.h Sun Feb 2 17:38:43 1997 *************** *** 45,52 **** Stack { public: ! inline Stack (void) { } ! inline virtual ~Stack (void) { } virtual void push (const T& item) = 0; --- 45,54 ---- Stack { public: ! ! Stack (void) { } ! ! virtual ~Stack (void) { } virtual void push (const T& item) = 0; diff -cNr octave-2.0.2/src/data.cc octave-2.0.3/src/data.cc *** octave-2.0.2/src/data.cc Wed Oct 16 13:40:38 1996 --- octave-2.0.3/src/data.cc Thu Feb 13 14:33:28 1997 *************** *** 99,105 **** typedef double (*d_dd_fcn) (double, double); static Matrix ! map (d_dd_fcn f, double x, const Matrix& y) { int nr = y.rows (); int nc = y.columns (); --- 99,105 ---- typedef double (*d_dd_fcn) (double, double); static Matrix ! map_d_m (d_dd_fcn f, double x, const Matrix& y) { int nr = y.rows (); int nc = y.columns (); *************** *** 114,120 **** } static Matrix ! map (d_dd_fcn f, const Matrix& x, double y) { int nr = x.rows (); int nc = x.columns (); --- 114,120 ---- } static Matrix ! map_m_d (d_dd_fcn f, const Matrix& x, double y) { int nr = x.rows (); int nc = x.columns (); *************** *** 129,135 **** } static Matrix ! map (d_dd_fcn f, const Matrix& x, const Matrix& y) { int x_nr = x.rows (); int x_nc = x.columns (); --- 129,135 ---- } static Matrix ! map_m_m (d_dd_fcn f, const Matrix& x, const Matrix& y) { int x_nr = x.rows (); int x_nc = x.columns (); *************** *** 198,204 **** Matrix x = arg_x.matrix_value (); if (! error_state) ! retval = map (atan2, y, x); } } else if (x_is_scalar) --- 198,204 ---- Matrix x = arg_x.matrix_value (); if (! error_state) ! retval = map_d_m (atan2, y, x); } } else if (x_is_scalar) *************** *** 210,216 **** double x = arg_x.double_value (); if (! error_state) ! retval = map (atan2, y, x); } } else if (y_nr == x_nr && y_nc == x_nc) --- 210,216 ---- double x = arg_x.double_value (); if (! error_state) ! retval = map_m_d (atan2, y, x); } } else if (y_nr == x_nr && y_nc == x_nc) *************** *** 222,228 **** Matrix x = arg_x.matrix_value (); if (! error_state) ! retval = map (atan2, y, x); } } else --- 222,228 ---- Matrix x = arg_x.matrix_value (); if (! error_state) ! retval = map_m_m (atan2, y, x); } } else diff -cNr octave-2.0.2/src/defaults.cc octave-2.0.3/src/defaults.cc *** octave-2.0.2/src/defaults.cc Fri Nov 15 14:00:13 1996 --- octave-2.0.3/src/defaults.cc Wed Jan 29 14:37:58 1997 *************** *** 325,332 **** string std_path = Vlocal_arch_lib_dir; std_path.append (SEPCHAR_STR); std_path.append (Varch_lib_dir); - std_path.append (SEPCHAR_STR); - std_path.append (Vbin_dir); int std_len = std_path.length (); --- 325,330 ---- diff -cNr octave-2.0.2/src/dirfns.cc octave-2.0.3/src/dirfns.cc *** octave-2.0.2/src/dirfns.cc Wed Nov 13 22:20:53 1996 --- octave-2.0.3/src/dirfns.cc Mon Feb 10 02:21:18 1997 *************** *** 441,454 **** } DEFUN (readdir, args, , ! "readdir (NAME)\n\ \n\ Return an array of strings containing the list of all files in the ! named directory. If sucessful, returns 0; otherwise an error message ! is printed.") { octave_value_list retval; if (args.length () == 1) { string dirname = args(0).string_value (); --- 441,460 ---- } DEFUN (readdir, args, , ! "[FILES, STATUS, MSG] = readdir (NAME)\n\ \n\ Return an array of strings containing the list of all files in the ! named directory in FILES, or an empty matrix if an error occurs\n\ ! \n\ ! If successful, STATUS is 0 and MSG is an empty string. Otherwise,\n\ ! STATUS is nonzero and MSG contains a system-dependent error message.") { octave_value_list retval; + retval(2) = string (); + retval(1) = -1.0; + retval(0) = Matrix (); + if (args.length () == 1) { string dirname = args(0).string_value (); *************** *** 463,473 **** { string_vector dirlist = dir.read (); retval(0) = dirlist.qsort (); } else { ! string msg = dir.error (); ! error ("%s", msg.c_str ()); } } } --- 469,479 ---- { string_vector dirlist = dir.read (); retval(0) = dirlist.qsort (); + retval(1) = 0.0; } else { ! retval(2) = dir.error (); } } } *************** *** 481,494 **** // mode. DEFUN (mkdir, args, , ! "mkdir (NAME)\n\ \n\ ! Create the directory named by NAME. If successful, returns 0;\n\ ! otherwise prints an error message.") { octave_value_list retval; ! int status = 0; if (args.length () == 1) { --- 487,503 ---- // mode. DEFUN (mkdir, args, , ! "[STATUS, MSG] = mkdir (NAME)\n\ ! \n\ ! Create the directory named by NAME.\n\ \n\ ! If successful, STATUS is 0 and MSG is an empty string. Otherwise,\n\ ! STATUS is nonzero and MSG contains a system-dependent error message.") { octave_value_list retval; ! retval(1) = string (); ! retval(0) = -1.0; if (args.length () == 1) { *************** *** 498,530 **** gripe_wrong_type_arg ("mkdir", args(0)); else { ! int mkdir_retval = oct_mkdir (oct_tilde_expand (dirname), 0777); ! if (mkdir_retval < 0) ! { ! status = -1; ! error ("%s", strerror (errno)); ! } } } else print_usage ("mkdir"); - if (status == 0) - retval (0) = (double) status; - return retval; } DEFUN (rmdir, args, , ! "rmdir (NAME)\n\ \n\ ! Remove the directory named by NAME. If successful, returns 0;\n\ ! otherwise prints an error message.") { octave_value_list retval; ! int status = 0; if (args.length () == 1) { --- 507,541 ---- gripe_wrong_type_arg ("mkdir", args(0)); else { ! string msg; ! int status = oct_mkdir (oct_tilde_expand (dirname), ! 0777, msg); ! ! retval(0) = (double) status; ! ! if (status < 0) ! retval(1) = msg; } } else print_usage ("mkdir"); return retval; } DEFUN (rmdir, args, , ! "[STATUS, MSG] = rmdir (NAME)\n\ \n\ ! Remove the directory named by NAME.\n\ ! \n\ ! If successful, STATUS is 0 and MSG is an empty string. Otherwise,\n\ ! STATUS is nonzero and MSG contains a system-dependent error message.") { octave_value_list retval; ! retval(1) = string (); ! retval(0) = -1.0; if (args.length () == 1) { *************** *** 534,566 **** gripe_wrong_type_arg ("rmdir", args(0)); else { ! int rmdir_retval = oct_rmdir (oct_tilde_expand (dirname)); ! if (rmdir_retval < 0) ! { ! status = -1; ! error ("%s", strerror (errno)); ! } } } else print_usage ("rmdir"); - if (status == 0) - retval (0) = (double) status; - return retval; } DEFUN (rename, args, , ! "rename (FROM, TO)\n\ \n\ ! Rename a file. If successful, returns 0;\n\ ! otherwise prints an error message and returns -1.") { octave_value_list retval; ! int status = 0; if (args.length () == 2) { --- 545,578 ---- gripe_wrong_type_arg ("rmdir", args(0)); else { ! string msg; ! int status = oct_rmdir (oct_tilde_expand (dirname), msg); ! ! retval(0) = (double) status; ! ! if (status < 0) ! retval(1) = msg; } } else print_usage ("rmdir"); return retval; } DEFUN (rename, args, , ! "[STATUS, MSG] = rename (FROM, TO)\n\ ! \n\ ! Rename a file.\n\ \n\ ! If successful, STATUS is 0 and MSG is an empty string. Otherwise,\n\ ! STATUS is nonzero and MSG contains a system-dependent error message.") { octave_value_list retval; ! retval(1) = string (); ! retval(0) = -1.0; if (args.length () == 2) { *************** *** 574,591 **** if (error_state) gripe_wrong_type_arg ("rename", args(1)); ! else if (oct_rename (from, to) < 0) { ! status = -1; ! error ("%s", strerror (errno)); } } } else print_usage ("rename"); - - if (status == 0) - retval (0) = (double) status; return retval; } --- 586,606 ---- if (error_state) gripe_wrong_type_arg ("rename", args(1)); ! else { ! string msg; ! ! int status = oct_rename (from, to, msg); ! ! retval(0) = (double) status; ! ! if (status < 0) ! retval(1) = msg; } } } else print_usage ("rename"); return retval; } diff -cNr octave-2.0.2/src/gripes.cc octave-2.0.3/src/gripes.cc *** octave-2.0.2/src/gripes.cc Fri Oct 11 19:27:01 1996 --- octave-2.0.3/src/gripes.cc Thu Feb 13 14:42:22 1997 *************** *** 123,128 **** --- 123,134 ---- } void + gripe_wrong_type_arg (const char *name, const string& s) + { + error ("%s: wrong type argument `%s'", name, s.c_str ()); + } + + void gripe_wrong_type_arg (const char *name, const octave_value& tc) { string type = tc.type_name (); diff -cNr octave-2.0.2/src/gripes.h octave-2.0.3/src/gripes.h *** octave-2.0.2/src/gripes.h Sun Nov 3 15:38:07 1996 --- octave-2.0.3/src/gripes.h Thu Feb 13 03:01:37 1997 *************** *** 42,47 **** --- 42,48 ---- extern void gripe_unrecognized_float_fmt (void); extern void gripe_unrecognized_data_fmt (const char *warn_for); extern void gripe_data_conversion (const char *from, const char *to); + extern void gripe_wrong_type_arg (const char *name, const string& s); extern void gripe_wrong_type_arg (const char *name, const octave_value& tc); extern void gripe_wrong_type_arg_for_unary_op (const octave_value& op); extern void gripe_wrong_type_arg_for_binary_op (const octave_value& op); diff -cNr octave-2.0.2/src/help.cc octave-2.0.3/src/help.cc *** octave-2.0.2/src/help.cc Wed Nov 20 18:26:40 1996 --- octave-2.0.3/src/help.cc Tue Feb 18 09:29:30 1997 *************** *** 59,64 **** --- 59,65 ---- #include "pt-pr-code.h" #include "sighandlers.h" #include "symtab.h" + #include "syswait.h" #include "toplev.h" #include "unwind-prot.h" #include "utils.h" *************** *** 559,566 **** octave_set_interrupt_handler (old_interrupt_handler); ! if ((status & 0xff) == 0) ! status = (signed char) ((status & 0xff00) >> 8); else status = 127; --- 560,567 ---- octave_set_interrupt_handler (old_interrupt_handler); ! if (WIFEXITED (status)) ! status = WEXITSTATUS (status); else status = 127; diff -cNr octave-2.0.2/src/mk-oct-links octave-2.0.3/src/mk-oct-links *** octave-2.0.2/src/mk-oct-links Wed Dec 31 18:00:00 1969 --- octave-2.0.3/src/mk-oct-links Wed Jan 29 11:26:12 1997 *************** *** 0 **** --- 1,42 ---- + #! /bin/sh -e + + # Create additional links to .oct files that define more than one + # function. + + # If the first arg is -p, only print the links we need to make. + + # The first non-option arg is taken as the directory where the .oct + # files are installed. The remaining arguments should be the list of + # source files that were used to create the .oct files. + + print_only=false + if [ $1 = "-p" ]; then + print_only=true + shift + fi + + links_dir=$1 + shift + + for f in "$@"; do + base=`basename $f | sed 's/\.cc$//'` + fcns=`grep -h '^ *DEFUN_DLD' $f |\ + sed -e 's/DEFUN_DLD *( *//' -e 's/ *,.*$//' |\ + sort -u` + if [ -n "$fcns" ]; then + for n in $fcns; do + if [ "$n" = "$base" ]; then + true + else + if $print_only; then + echo $base.oct $n.oct + else + echo "creating link $n.oct -> $base.oct" + ( cd $links_dir; rm -f $n.oct; ln $base.oct $n.oct ) + fi + fi + done + fi + done + + exit $? diff -cNr octave-2.0.2/src/oct-conf.h.in octave-2.0.3/src/oct-conf.h.in *** octave-2.0.2/src/oct-conf.h.in Mon Jan 27 12:12:14 1997 --- octave-2.0.3/src/oct-conf.h.in Thu Feb 13 16:33:20 1997 *************** *** 104,109 **** --- 104,113 ---- #define LIBFLAGS %LIBFLAGS% #endif + #ifndef RLD_FLAG + #define RLD_FLAG %RLD_FLAG% + #endif + #ifndef CXXLIBS #define CXXLIBS %CXXLIBS% #endif diff -cNr octave-2.0.2/src/oct-stream.cc octave-2.0.3/src/oct-stream.cc *** octave-2.0.2/src/oct-stream.cc Mon Jan 20 20:38:19 1997 --- octave-2.0.3/src/oct-stream.cc Fri Feb 14 17:23:55 1997 *************** *** 294,306 **** break; case 'h': case 'l': case 'L': if (modifier != '\0') nconv = -1; else ! { ! modifier = s[i]; ! *buf << s[i++]; ! } break; case 'd': case 'i': case 'o': case 'u': case 'x': --- 294,304 ---- break; case 'h': case 'l': case 'L': + // We accept these but we don't actually use them. if (modifier != '\0') nconv = -1; else ! modifier = s[i++]; break; case 'd': case 'i': case 'o': case 'u': case 'x': *************** *** 317,322 **** --- 315,324 ---- nconv = -1; break; } + + // No float or long double conversions, thanks. + *buf << 'l'; + goto fini; case 'c': case 's': case 'p': case '%': case '[': *************** *** 959,970 **** { if (elt) { ! if (nr > 0 && nc > 0 && count == max_size) { ! final_nr = nr; ! final_nc = nc; ! ! break; } const char *fmt = elt->text; --- 961,990 ---- { if (elt) { ! if (count == max_size) { ! if (nr > 0) ! { ! if (nc > 0) ! { ! final_nr = nr; ! final_nc = nc; ! ! break; ! } ! else ! { ! max_size *= 2; ! mval.resize (nr, max_size / nr, 0.0); ! data = mval.fortran_vec (); ! } ! } ! else ! { ! max_size *=2; ! mval.resize (max_size, 1, 0.0); ! data = mval.fortran_vec (); ! } } const char *fmt = elt->text; diff -cNr octave-2.0.2/src/octave.cc octave-2.0.3/src/octave.cc *** octave-2.0.2/src/octave.cc Thu Dec 5 18:39:23 1996 --- octave-2.0.3/src/octave.cc Sun Feb 2 22:48:39 1997 *************** *** 533,539 **** execute_startup_files (); ! octave_command_history.read (); if (! inhibit_startup_message && reading_startup_message_printed) cout << endl; --- 533,539 ---- execute_startup_files (); ! octave_command_history.read (false); if (! inhibit_startup_message && reading_startup_message_printed) cout << endl; diff -cNr octave-2.0.2/src/ov-str-mat.cc octave-2.0.3/src/ov-str-mat.cc *** octave-2.0.2/src/ov-str-mat.cc Fri Dec 6 14:24:47 1996 --- octave-2.0.3/src/ov-str-mat.cc Thu Feb 13 03:03:08 1997 *************** *** 38,46 **** #include "gripes.h" #include "pr-output.h" ! int octave_char_matrix_str::t_id = -1; ! const string octave_char_matrix_str::t_name ("string"); static octave_value * default_numeric_conversion_function (const octave_value& a) --- 38,48 ---- #include "gripes.h" #include "pr-output.h" ! int ! octave_char_matrix_str::t_id (-1); ! const string ! octave_char_matrix_str::t_name ("string"); static octave_value * default_numeric_conversion_function (const octave_value& a) diff -cNr octave-2.0.2/src/pager.cc octave-2.0.3/src/pager.cc *** octave-2.0.2/src/pager.cc Fri Jan 17 18:15:53 1997 --- octave-2.0.3/src/pager.cc Fri Jan 31 13:55:09 1997 *************** *** 127,133 **** if (msg && *msg) { if (bypass_pager) ! cout << msg; else { if (! external_pager) --- 127,136 ---- if (msg && *msg) { if (bypass_pager) ! { ! cout << msg; ! cout.flush (); ! } else { if (! external_pager) *************** *** 167,173 **** } } else ! cout << msg; } } } --- 170,179 ---- } } else ! { ! cout << msg; ! cout.flush (); ! } } } } diff -cNr octave-2.0.2/src/pr-output.cc octave-2.0.3/src/pr-output.cc *** octave-2.0.2/src/pr-output.cc Thu Jan 2 12:34:59 1997 --- octave-2.0.3/src/pr-output.cc Sat Feb 8 17:16:06 1997 *************** *** 1489,1507 **** if (pr_as_read_syntax && nstr > 1) os << "[ "; ! for (int i = 0; i < nstr; i++) { ! string row = chm.row_as_string (i); ! ! if (pr_as_read_syntax) { ! os << "\"" << undo_string_escapes (row) << "\""; ! if (i < nstr - 1) ! os << "; "; } - else - os << row << "\n"; } if (pr_as_read_syntax && nstr > 1) --- 1489,1512 ---- if (pr_as_read_syntax && nstr > 1) os << "[ "; ! if (nstr == 0) ! os << "\n"; ! else { ! for (int i = 0; i < nstr; i++) { ! string row = chm.row_as_string (i); ! ! if (pr_as_read_syntax) ! { ! os << "\"" << undo_string_escapes (row) << "\""; ! if (i < nstr - 1) ! os << "; "; ! } ! else ! os << row << "\n"; } } if (pr_as_read_syntax && nstr > 1) diff -cNr octave-2.0.2/src/pt-exp.cc octave-2.0.3/src/pt-exp.cc *** octave-2.0.2/src/pt-exp.cc Mon Nov 18 22:33:00 1996 --- octave-2.0.3/src/pt-exp.cc Sat Feb 8 17:39:09 1997 *************** *** 691,698 **** return lhs->ident (); } - // ??? FIXME ??? -- should this return the value of the RHS instead? - // ??? FIXME ??? -- should octave_variable_reference::assign return // the right thing for us to return? --- 691,696 ---- *************** *** 703,714 **** --- 701,715 ---- octave_value retval; + octave_value lhs_val; + if (error_state) return retval; if (rhs) { octave_value rhs_val = rhs->eval (false); + if (error_state) { eval_error (); *************** *** 745,751 **** if (error_state) eval_error (); else ! retval = ult.value (); } else error ("??? invalid index list ???"); --- 746,756 ---- if (error_state) eval_error (); else ! { ! lhs_val = ult.value (); ! ! retval = rhs_val; ! } } else error ("??? invalid index list ???"); *************** *** 754,767 **** else { ult.assign (rhs_val); ! retval = ult.value (); } } } } ! if (! error_state && print && retval.is_defined ()) ! retval.print_with_name (lhs->name ()); return retval; } --- 759,779 ---- else { ult.assign (rhs_val); ! ! lhs_val = ult.value (); ! ! retval = rhs_val; } } } } ! // Return value is RHS value, but the value we print is the complete ! // LHS value so that expressions like x(2) = 2 (for x previously ! // undefined) print b = [ 0; 2 ], which is more Matlab-like. ! ! if (! error_state && print && lhs_val.is_defined ()) ! lhs_val.print_with_name (lhs->name ()); return retval; } diff -cNr octave-2.0.2/src/pt-fvc.cc octave-2.0.3/src/pt-fvc.cc *** octave-2.0.2/src/pt-fvc.cc Thu Nov 7 11:15:26 1996 --- octave-2.0.3/src/pt-fvc.cc Thu Feb 13 14:30:57 1997 *************** *** 708,720 **** || any_element_greater_than (m, m_fcn.upper_limit))) { if (m_fcn.c_c_mapper) ! retval = map (m_fcn.c_c_mapper, ComplexMatrix (m)); else error ("%s: unable to handle real arguments", m_fcn.name.c_str ()); } else if (m_fcn.d_d_mapper) ! retval = map (m_fcn.d_d_mapper, m); else error ("%s: unable to handle real arguments", m_fcn.name.c_str ()); --- 708,723 ---- || any_element_greater_than (m, m_fcn.upper_limit))) { if (m_fcn.c_c_mapper) ! { ! ComplexMatrix cm (m); ! retval = cm.map (m_fcn.c_c_mapper); ! } else error ("%s: unable to handle real arguments", m_fcn.name.c_str ()); } else if (m_fcn.d_d_mapper) ! retval = m.map (m_fcn.d_d_mapper); else error ("%s: unable to handle real arguments", m_fcn.name.c_str ()); *************** *** 742,750 **** return retval; if (m_fcn.d_c_mapper) ! retval = map (m_fcn.d_c_mapper, cm); else if (m_fcn.c_c_mapper) ! retval = map (m_fcn.c_c_mapper, cm); else error ("%s: unable to handle complex arguments", m_fcn.name.c_str ()); --- 745,753 ---- return retval; if (m_fcn.d_c_mapper) ! retval = cm.map (m_fcn.d_c_mapper); else if (m_fcn.c_c_mapper) ! retval = cm.map (m_fcn.c_c_mapper); else error ("%s: unable to handle complex arguments", m_fcn.name.c_str ()); diff -cNr octave-2.0.2/src/qr.cc octave-2.0.3/src/qr.cc *** octave-2.0.2/src/qr.cc Sun Nov 3 02:22:47 1996 --- octave-2.0.3/src/qr.cc Wed Jan 29 08:25:05 1997 *************** *** 41,48 **** that Q * R = X\n\ \n\ [Q, R] = qr (X, 0): form the economy decomposition such that if X is\n\ ! if X is m by n then only the first n columns of Q\n\ ! are computed.\n\ \n\ [Q, R, P] = qr (X): form QRP factorization of X where\n\ P is a permutation matrix such that\n\ --- 41,48 ---- that Q * R = X\n\ \n\ [Q, R] = qr (X, 0): form the economy decomposition such that if X is\n\ ! m by n then only the first n columns of Q are\n\ ! computed.\n\ \n\ [Q, R, P] = qr (X): form QRP factorization of X where\n\ P is a permutation matrix such that\n\ diff -cNr octave-2.0.2/src/sighandlers.cc octave-2.0.3/src/sighandlers.cc *** octave-2.0.2/src/sighandlers.cc Sat Jan 25 23:27:17 1997 --- octave-2.0.3/src/sighandlers.cc Tue Feb 18 08:58:27 1997 *************** *** 87,112 **** do { } while (0) #endif - // The following signal blocking stuff is stolen from bash: - - #define BLOCK_SIGNAL(sig, nvar, ovar) \ - do \ - { \ - sigemptyset (&nvar); \ - sigaddset (&nvar, sig); \ - sigemptyset (&ovar); \ - sigprocmask (SIG_BLOCK, &nvar, &ovar); \ - } \ - while (0) - - #if defined (HAVE_POSIX_SIGNALS) - #define BLOCK_CHILD(nvar, ovar) BLOCK_SIGNAL (SIGCHLD, nvar, ovar) - #define UNBLOCK_CHILD(ovar) sigprocmask (SIG_SETMASK, &ovar, 0) - #else - #define BLOCK_CHILD(nvar, ovar) ovar = sigblock (sigmask (SIGCHLD)) - #define UNBLOCK_CHILD(ovar) sigsetmask (ovar) - #endif - void octave_save_signal_mask (void) { --- 87,92 ---- diff -cNr octave-2.0.2/src/sighandlers.h octave-2.0.3/src/sighandlers.h *** octave-2.0.2/src/sighandlers.h Wed Nov 20 18:30:20 1996 --- octave-2.0.3/src/sighandlers.h Tue Feb 18 08:58:39 1997 *************** *** 37,42 **** --- 37,62 ---- #define BADSIG (RETSIGTYPE (*)(int))-1 #endif + // The following signal blocking stuff is stolen from bash: + + #define BLOCK_SIGNAL(sig, nvar, ovar) \ + do \ + { \ + sigemptyset (&nvar); \ + sigaddset (&nvar, sig); \ + sigemptyset (&ovar); \ + sigprocmask (SIG_BLOCK, &nvar, &ovar); \ + } \ + while (0) + + #if defined (HAVE_POSIX_SIGNALS) + #define BLOCK_CHILD(nvar, ovar) BLOCK_SIGNAL (SIGCHLD, nvar, ovar) + #define UNBLOCK_CHILD(ovar) sigprocmask (SIG_SETMASK, &ovar, 0) + #else + #define BLOCK_CHILD(nvar, ovar) ovar = sigblock (sigmask (SIGCHLD)) + #define UNBLOCK_CHILD(ovar) sigsetmask (ovar) + #endif + typedef RETSIGTYPE sig_handler (int); // All we need to do is declare pointers to this, so we don't need to diff -cNr octave-2.0.2/src/syscalls.cc octave-2.0.3/src/syscalls.cc *** octave-2.0.2/src/syscalls.cc Wed Nov 6 16:14:35 1996 --- octave-2.0.3/src/syscalls.cc Thu Feb 13 02:24:44 1997 *************** *** 29,35 **** --- 29,37 ---- #include #endif + #include #include + #include #ifdef HAVE_UNISTD_H #ifdef HAVE_SYS_TYPES_H *************** *** 86,94 **** } DEFUN (dup2, args, , ! "fid = dup2 (old, new): duplicate a file descriptor") { ! double retval = -1.0; int nargin = args.length (); --- 88,104 ---- } DEFUN (dup2, args, , ! "[FID, MSG] = dup2 (OLD, NEW)\n\ ! \n\ ! Duplicate a file descriptor.\n\ ! \n\ ! If successful, FID is greater than zero and contains the new file ID.\n\ ! Otherwise, FID is negative and MSG contains a system-dependent error message.") { ! octave_value_list retval; ! ! retval(1) = string (); ! retval(0) = -1.0; int nargin = args.length (); *************** *** 107,113 **** // XXX FIXME XXX -- are these checks sufficient? if (i_old >= 0 && i_new >= 0) ! retval = (double) dup2 (i_old, i_new); else error ("dup2: invalid file id"); } --- 117,130 ---- // XXX FIXME XXX -- are these checks sufficient? if (i_old >= 0 && i_new >= 0) ! { ! int status = dup2 (i_old, i_new); ! ! retval(0) = (double) status; ! ! if (status < 0) ! retval(1) = strerror (errno); ! } else error ("dup2: invalid file id"); } *************** *** 125,133 **** } DEFUN (exec, args, , ! "exec (file, args): replace current process with a new process") { ! double retval = -1.0; int nargin = args.length (); --- 142,158 ---- } DEFUN (exec, args, , ! "[STATUS, MSG] = exec (FILE, ARGS)\n\ ! \n\ ! Replace current process with a new process.\n\ ! \n\ ! If successful, exec does not return. If exec does return, status will ! be nonzero, and MSG will contain a system-dependent error message.") { ! octave_value_list retval; ! ! retval(1) = string (); ! retval(0) = -1.0; int nargin = args.length (); *************** *** 178,184 **** } if (! error_state) ! execvp (exec_file.c_str (), exec_args); } else error ("exec: first argument must be a string"); --- 203,216 ---- } if (! error_state) ! { ! int status = execvp (exec_file.c_str (), exec_args); ! ! retval(0) = (double) status; ! ! if (status < 0) ! retval(1) = strerror (errno); ! } } else error ("exec: first argument must be a string"); *************** *** 193,201 **** } DEFUN (fcntl, args, , ! "fcntl (fid, request, argument): control open file descriptors") { ! double retval = -1.0; int nargin = args.length (); --- 225,241 ---- } DEFUN (fcntl, args, , ! "[STATUS, MSG] = fcntl (FID, REQUEST, ARGUMENT)\n\ ! \n\ ! Control open file descriptors.\n\ ! \n\ ! If successful, STATUS is 0 and MSG is an empty string. Otherwise,\n\ ! STATUS is nonzero and MSG contains a system-dependent error message.") { ! octave_value_list retval; ! ! retval(1) = string (); ! retval(0) = -1.0; int nargin = args.length (); *************** *** 219,225 **** if (fid < 0) error ("fcntl: invalid file id"); else ! retval = fcntl (fid, req, arg); } else error ("fcntl: file id must be an integer"); --- 259,272 ---- if (fid < 0) error ("fcntl: invalid file id"); else ! { ! int status = fcntl (fid, req, arg); ! ! retval(0) = (double) status; ! ! if (status < 0) ! retval(1) = strerror (errno); ! } } else error ("fcntl: file id must be an integer"); *************** *** 234,249 **** } DEFUN (fork, args, , ! "fork (): create a copy of the current process") { ! double retval = -1.0; int nargin = args.length (); if (nargin == 0) { #if defined (HAVE_FORK) ! retval = fork (); #else gripe_not_supported ("fork"); #endif --- 281,310 ---- } DEFUN (fork, args, , ! "[PID, MSG] = fork ()\n\ ! \n\ ! Create a copy of the current process.\n\ ! \n\ ! If successful, PID is either the process ID and you are in the parent,\n\ ! or 0, and you are in the child. If PID is less than zero, an error\n\ ! has occured, and MSG contains a system-dependent error message.") { ! octave_value_list retval; ! ! retval(1) = string (); ! retval(0) = -1.0; int nargin = args.length (); if (nargin == 0) { #if defined (HAVE_FORK) ! pid_t pid = fork (); ! ! retval(0) = (double) pid; ! ! if (pid < 0) ! retval(1) = strerror (errno); #else gripe_not_supported ("fork"); #endif *************** *** 439,454 **** } DEFUN (mkfifo, args, , ! "STATUS = mkfifo (NAME, MODE)\n\ \n\ ! Create a FIFO special file named NAME with file mode MODE\n\ \n\ ! STATUS is:\n\ ! \n\ ! != 0 : if mkfifo failed\n\ ! 0 : if the FIFO special file could be created") { ! double retval = -1.0; int nargin = args.length (); --- 500,516 ---- } DEFUN (mkfifo, args, , ! "[STATUS, MSG] = mkfifo (NAME, MODE)\n\ \n\ ! Create a FIFO special file named NAME with file mode MODE\n\ \n\ ! If successful, STATUS is 0 and MSG is an empty string. Otherwise,\n\ ! STATUS is nonzero and MSG contains a system-dependent error message.") { ! octave_value_list retval; ! ! retval(1) = string (); ! retval(0) = -1.0; int nargin = args.length (); *************** *** 462,468 **** { long mode = (long) args(1).double_value (); ! retval = oct_mkfifo (name, mode); } else error ("mkfifo: MODE must be an integer"); --- 524,537 ---- { long mode = (long) args(1).double_value (); ! string msg; ! ! int status = oct_mkfifo (name, mode, msg); ! ! retval(0) = (double) status; ! ! if (status < 0) ! retval(1) = msg; } else error ("mkfifo: MODE must be an integer"); *************** *** 478,486 **** } DEFUN (pipe, args, , ! "[file_ids, status] = pipe (): create an interprocess channel") { ! octave_value_list retval (2, octave_value (-1.0)); int nargin = args.length (); --- 547,565 ---- } DEFUN (pipe, args, , ! "[FILE_IDS, STATUS, MSG] = pipe (): create an interprocess channel.\n\ ! \n\ ! Return the FILE_IDS corresponding to the reading and writing ends of\n\ ! the pipe, as a vector.\n\ ! \n\ ! If successful, STATUS is 0 and MSG is an empty string. Otherwise,\n\ ! STATUS is nonzero and MSG contains a system-dependent error message.") { ! octave_value_list retval; ! ! retval(2) = string (); ! retval(1) = -1.0; ! retval(0) = Matrix (); int nargin = args.length (); *************** *** 489,495 **** #if defined (HAVE_PIPE) int fid[2]; ! if (pipe (fid) >= 0) { FILE *in_file = fdopen (fid[0], "r"); FILE *out_file = fdopen (fid[1], "w"); --- 568,580 ---- #if defined (HAVE_PIPE) int fid[2]; ! int status = pipe (fid); ! ! if (status < 0) ! { ! retval(2) = strerror (errno); ! } ! else { FILE *in_file = fdopen (fid[0], "r"); FILE *out_file = fdopen (fid[1], "w"); *************** *** 506,513 **** file_ids (0, 1) = octave_stream_list::insert (os); retval(0) = file_ids; ! retval(1) = 0.0; ! } #else gripe_not_supported ("pipe"); #endif --- 591,598 ---- file_ids (0, 1) = octave_stream_list::insert (os); retval(0) = file_ids; ! retval(1) = (double) status; ! } #else gripe_not_supported ("pipe"); #endif *************** *** 575,590 **** } DEFUN (unlink, args, , ! "STATUS = unlink (NAME)\n\ \n\ ! Delete the file NAME\n\ \n\ ! STATUS is:\n\ ! \n\ ! != 0 : if unlink failed\n\ ! 0 : if the file could be successfully deleted") { ! double retval = -1.0; int nargin = args.length (); --- 660,676 ---- } DEFUN (unlink, args, , ! "[STATUS, MSG] = unlink (NAME)\n\ \n\ ! Delete the file NAME\n\ \n\ ! If successful, STATUS is 0 and MSG is an empty string. Otherwise,\n\ ! STATUS is nonzero and MSG contains a system-dependent error message.") { ! octave_value_list retval; ! ! retval(1) = string (); ! retval(0) = -1.0; int nargin = args.length (); *************** *** 594,600 **** { string name = args(0).string_value (); ! retval = oct_unlink (name); } else error ("unlink: file name must be a string"); --- 680,693 ---- { string name = args(0).string_value (); ! string msg; ! ! int status = oct_unlink (name, msg); ! ! retval(0) = (double) status; ! ! if (status < 0) ! retval(1) = msg; } else error ("unlink: file name must be a string"); *************** *** 606,614 **** } DEFUN (waitpid, args, , ! "STATUS = waitpid (PID, OPTIONS)\n\ \n\ ! wait for process PID to terminate\n\ \n\ PID can be:\n\ \n\ --- 699,707 ---- } DEFUN (waitpid, args, , ! "[PID, MSG] = waitpid (PID, OPTIONS)\n\ \n\ ! Wait for process PID to terminate\n\ \n\ PID can be:\n\ \n\ *************** *** 627,638 **** since they stopped\n\ 3 : implies both 1 and 2\n\ \n\ ! STATUS is:\n\ ! \n\ ! -1 : if an error occured\n\ ! > 0 : the process ID of the child process that exited") { ! double retval = -1.0; int nargin = args.length (); --- 720,734 ---- since they stopped\n\ 3 : implies both 1 and 2\n\ \n\ ! If successful, PID is greater than 0 and contains the process ID of\n\ ! the child process that exited and MSG is an empty string.\n\ ! Otherwise, PID is less than zero and MSG contains a system-dependent\n\ ! error message.") { ! octave_value_list retval; ! ! retval(1) = string (); ! retval(0) = -1.0; int nargin = args.length (); *************** *** 669,675 **** } if (! error_state) ! retval = waitpid (pid, 0, options); } } #else --- 765,778 ---- } if (! error_state) ! { ! pid_t status = waitpid (pid, 0, options); ! ! retval(0) = (double) status; ! ! if (status < 0) ! retval(1) = strerror (errno); ! } } } #else *************** *** 719,724 **** --- 822,832 ---- ""); #endif + #if defined (O_ASYNC) + DEFCONST (O_ASYNC, (double) O_ASYNC, 0, 0, + ""); + #endif + #if defined (O_CREAT) DEFCONST (O_CREAT, (double) O_CREAT, 0, 0, ""); *************** *** 741,746 **** --- 849,859 ---- #if defined (O_RDWR) DEFCONST (O_RDWR, (double) O_RDWR, 0, 0, + ""); + #endif + + #if defined (O_SYNC) + DEFCONST (O_SYNC, (double) O_SYNC, 0, 0, ""); #endif diff -cNr octave-2.0.2/src/toplev.cc octave-2.0.3/src/toplev.cc *** octave-2.0.2/src/toplev.cc Mon Jan 27 12:12:41 1997 --- octave-2.0.3/src/toplev.cc Tue Feb 18 11:00:03 1997 *************** *** 70,75 **** --- 70,76 ---- #include "pt-plot.h" #include "sighandlers.h" #include "sysdep.h" + #include "syswait.h" #include "toplev.h" #include "unwind-prot.h" #include "utils.h" *************** *** 649,657 **** --- 650,662 ---- // Execute a shell command. + static sigset_t signal_set, old_signal_set; + static void cleanup_iprocstream (void *p) { + UNBLOCK_CHILD (old_signal_set); + delete (iprocstream *) p; } *************** *** 660,665 **** --- 665,672 ---- { octave_value_list retval; + BLOCK_CHILD (signal_set, old_signal_set); + iprocstream *cmd = new iprocstream (cmd_str.c_str ()); add_unwind_protect (cleanup_iprocstream, cmd); *************** *** 680,687 **** // process exited normally, extract the actual exit status of // the command. Otherwise, return 127 as a failure code. ! if ((status & 0xff) == 0) ! status = (status & 0xff00) >> 8; output_buf << ends; --- 687,694 ---- // process exited normally, extract the actual exit status of // the command. Otherwise, return 127 as a failure code. ! if (WIFEXITED (status)) ! status = WEXITSTATUS (status); output_buf << ends; *************** *** 787,794 **** // status of the command. Otherwise, return 127 as a // failure code. ! if ((status & 0xff) == 0) ! status = (status & 0xff00) >> 8; retval = (double) status; } --- 794,801 ---- // status of the command. Otherwise, return 127 as a // failure code. ! if (WIFEXITED (status)) ! status = WEXITSTATUS (status); retval = (double) status; } *************** *** 846,860 **** return retval; } ! DEFUN (octave_config_info, , , ! "return a structure containing configuration information") { Octave_map m; m ["default_pager"] = DEFAULT_PAGER; m ["prefix"] = OCTAVE_PREFIX; m ["exec_prefix"] = OCTAVE_EXEC_PREFIX; m ["datadir"] = OCTAVE_DATADIR; m ["libdir"] = OCTAVE_LIBDIR; m ["bindir"] = OCTAVE_BINDIR; m ["infodir"] = OCTAVE_INFODIR; --- 853,882 ---- return retval; } ! DEFUN (octave_config_info, args, , ! "octave_config_info (OPTION)\n\ ! \n\ ! If OPTION is a string, return the configuration information for the\n\ ! specified option.\n\ ! \n\ ! With no arguments, return a structure containing configuration\n\ ! information.") { + octave_value retval; + + #if defined (WITH_DYNAMIC_LINKING) && (defined (WITH_DL) || defined (WITH_SHL)) + bool octave_supports_dynamic_linking = true; + #else + bool octave_supports_dynamic_linking = false; + #endif + Octave_map m; m ["default_pager"] = DEFAULT_PAGER; m ["prefix"] = OCTAVE_PREFIX; m ["exec_prefix"] = OCTAVE_EXEC_PREFIX; m ["datadir"] = OCTAVE_DATADIR; + m ["dld"] = (double) octave_supports_dynamic_linking; m ["libdir"] = OCTAVE_LIBDIR; m ["bindir"] = OCTAVE_BINDIR; m ["infodir"] = OCTAVE_INFODIR; *************** *** 887,892 **** --- 909,915 ---- m ["CXXPICFLAG"] = CXXPICFLAG; m ["LDFLAGS"] = LDFLAGS; m ["LIBFLAGS"] = LIBFLAGS; + m ["RLD_FLAG"] = RLD_FLAG; m ["CXXLIBS"] = CXXLIBS; m ["TERMLIBS"] = TERMLIBS; m ["LIBS"] = LIBS; *************** *** 895,901 **** m ["LIBDLFCN"] = LIBDLFCN; m ["DEFS"] = DEFS; ! return octave_value (m); } #if defined (__GNUG__) && defined (DEBUG_NEW_DELETE) --- 918,938 ---- m ["LIBDLFCN"] = LIBDLFCN; m ["DEFS"] = DEFS; ! int nargin = args.length (); ! ! if (nargin == 1) ! { ! string arg = args(0).string_value (); ! ! if (! error_state) ! retval = octave_value (m [arg.c_str ()]); ! } ! else if (nargin == 0) ! retval = octave_value (m); ! else ! print_usage ("octave_config_info"); ! ! return retval; } #if defined (__GNUG__) && defined (DEBUG_NEW_DELETE) diff -cNr octave-2.0.2/src/version.h octave-2.0.3/src/version.h *** octave-2.0.2/src/version.h Mon Jan 27 00:12:19 1997 --- octave-2.0.3/src/version.h Fri Feb 14 14:34:54 1997 *************** *** 20,26 **** */ ! #define OCTAVE_VERSION "2.0.2" #define OCTAVE_COPYRIGHT \ "Copyright (C) 1996 John W. Eaton." --- 20,26 ---- */ ! #define OCTAVE_VERSION "2.0.3" #define OCTAVE_COPYRIGHT \ "Copyright (C) 1996 John W. Eaton." diff -cNr octave-2.0.2/test/ChangeLog octave-2.0.3/test/ChangeLog *** octave-2.0.2/test/ChangeLog Mon Jan 27 15:52:08 1997 --- octave-2.0.3/test/ChangeLog Tue Feb 18 09:22:10 1997 *************** *** 1,3 **** --- 1,7 ---- + Tue Feb 18 09:22:04 1997 John W. Eaton + + * Version 2.0.3 released. + Mon Jan 27 15:51:58 1997 John W. Eaton * Version 2.0.2 released. PATCH_EOF