changeset 3225:7aae2c3636a7

[project @ 1998-12-04 23:20:12 by jwe]
author jwe
date Fri, 04 Dec 1998 23:20:26 +0000
parents 1e7532b9173b
children 997eba21ca23
files ChangeLog configure.in doc/interpreter/emacs.texi doc/interpreter/func.texi doc/interpreter/var.texi emacs/octave-mod.el liboctave/Array2.cc liboctave/Array2.h liboctave/CMatrix.cc liboctave/CMatrix.h liboctave/ChangeLog liboctave/MArray2.h liboctave/boolMatrix.cc liboctave/boolMatrix.h liboctave/chMatrix.cc liboctave/chMatrix.h liboctave/cmd-edit.cc liboctave/dMatrix.cc liboctave/dMatrix.h liboctave/lo-specfun.cc liboctave/statdefs.h scripts/ChangeLog scripts/Makefile.in scripts/general/logical.m scripts/image/imagesc.m scripts/image/saveimage.m scripts/linear-algebra/krylov.m src/ChangeLog src/lex.h src/mkbuiltins src/mkops src/ov-bool-mat.h src/strftime.c src/utils.cc src/version.h
diffstat 35 files changed, 274 insertions(+), 141 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Fri Dec  4 18:05:51 1998  Kurt Hornik  <Kurt.Hornik@ci.tuwien.ac.at>
+
+	* emacs/octave-mod.el (octave-abbrev-start): Use the correct name
+	of the abbrev table, and provide support for XEmacs.
+	(octave-xemacs-p): New variable.
+
+Tue Nov 24 23:31:50 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* configure.in: Check for strftime too.
+	Avoid checking for termios.h on NeXT systems.
+
 Thu Nov 19 16:07:57 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* aclocal.m4 (OCTAVE_CXX_PREPENDS_UNDERSCORE): New macro.
--- a/configure.in
+++ b/configure.in
@@ -21,7 +21,7 @@
 ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 ### 02111-1307, USA. 
 
-AC_REVISION($Revision: 1.312 $)
+AC_REVISION($Revision: 1.313 $)
 AC_PREREQ(2.9)
 AC_INIT(src/octave.cc)
 AC_CONFIG_HEADER(config.h)
@@ -689,11 +689,20 @@
 AC_HEADER_TIME
 AC_HEADER_SYS_WAIT
 
+### I'm told that termios.h is broken on NeXT systems.
+
+TERMIOS_H=termios.h
+case "$canonical_host_type" in
+  *-*-nextstep*)
+    TERMIOS_H=
+  ;;
+esac
+
 AC_CHECK_HEADERS(assert.h curses.h dlfcn.h fcntl.h float.h floatingpoint.h \
   fnmatch.h glob.h grp.h ieeefp.h limits.h memory.h nan.h ncurses.h \
   pwd.h sgtty.h stdlib.h string.h sys/param.h sys/resource.h \
   sys/select.h sys/stat.h sys/time.h sys/times.h sys/types.h \
-  sys/utsname.h termcap.h termio.h termios.h unistd.h varargs.h)
+  sys/utsname.h termcap.h termio.h $TERMIOS_H unistd.h varargs.h)
 
 if test "$ac_cv_header_termios_h" = yes \
     || test "$ac_cv_header_termio_h" = yes \
@@ -751,7 +760,7 @@
   gettimeofday getuid getwd lstat memmove mkdir mkfifo on_exit pipe \
   putenv rename rindex rmdir setgrent setpwent setvbuf sigaction \
   sigpending sigprocmask sigsuspend stat strcasecmp strdup strerror \
-  stricmp strncasecmp strnicmp tempnam umask unlink usleep \
+  strftime stricmp strncasecmp strnicmp tempnam umask unlink usleep \
   vfprintf vsprintf waitpid)
 
 OCTAVE_SMART_PUTENV
--- a/doc/interpreter/emacs.texi
+++ b/doc/interpreter/emacs.texi
@@ -337,6 +337,13 @@
 There is also rudimentary support for Imenu (currently, function names
 can be indexed).
 
+@cindex TAGS
+@cindex Emacs TAGS files
+@cindex @code{otags}
+You can generate TAGS files for Emacs from Octave @file{.m} files using
+the shell script @code{otags} that is installed alongside your copy of
+Octave.
+
 Customization of Octave mode can be performed by modification of the
 variable @code{octave-mode-hook}.  It the value of this variable is
 non-@code{nil}, turning on Octave mode calls its value.
--- a/doc/interpreter/func.texi
+++ b/doc/interpreter/func.texi
@@ -630,15 +630,23 @@
 
 @c XXX FIXME XXX -- note about time stamps on files in NFS environments?
 
+@defvr {Built-in Variable} DEFAULT_LOADPATH
+A colon separated list of directories in which to search for function
+files by default.  The value of this variable is also automatically
+substituted for leading, trailing, or doubled colons that appear in the
+built-in variable @code{LOADPATH}.
+@end defvr
+
 @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}
 overrides the environment variable @code{OCTAVE_PATH}.  @xref{Installation}.
 
 @code{LOADPATH} is now handled in the same way as @TeX{} handles
-@code{TEXINPUTS}.  If the path starts with @samp{:}, the standard path
-is prepended to the value of @code{LOADPATH}.  If it ends with @samp{:}
-the standard path is appended to the value of @code{LOADPATH}.
+@code{TEXINPUTS}.  Leading, trailing, or doubled colons that appear in
+@code{LOADPATH} are replaced by the value of @code{DEFAULT_LOADPATH}.
+The default value of @code{LOADPATH} is @code{":"}, which tells Octave
+to search in the directories specified by @code{DEFAULT_LOADPATH}.
 
 In addition, if any path element ends in @samp{//}, that directory and
 all subdirectories it contains are searched recursively for function
--- a/doc/interpreter/var.texi
+++ b/doc/interpreter/var.texi
@@ -307,6 +307,11 @@
 Octave was compiled (for example, @code{@value{TARGETHOSTTYPE}}).
 
 @vtable @code
+@item DEFAULT_LOADPATH
+@xref{Function Files}.
+
+Default value: @code{".:@var{octave-home}/lib/@var{version}"}.
+
 @item EDITOR
 @xref{Commands For History}.
 
@@ -330,7 +335,8 @@
 @item LOADPATH
 @xref{Function Files}.
 
-Default value: @code{".:@var{octave-home}/lib/@var{version}"}.
+Default value: @code{":"}, which tells Octave to use the directories
+specified by the built-in variable @code{DEFAULT_LOADPATH}.
 
 @item OCTAVE_HOME
 
--- a/emacs/octave-mod.el
+++ b/emacs/octave-mod.el
@@ -599,6 +599,9 @@
     (delete-horizontal-space)
     (insert (concat " " octave-continuation-string))))
 
+(defvar octave-xemacs-p
+  (string-match "XEmacs\\|Lucid" emacs-version))
+
 ;;; Comments
 (defun octave-comment-region (beg end &optional arg)
   "Comment or uncomment each line in the region as Octave code.
@@ -1310,9 +1313,12 @@
       (self-insert-command 1)
     (let (c)
       (insert last-command-char)
-      (if (or (eq (setq c (read-event)) ??)
-	      (eq c help-char))
-	  (let ((abbrev-table-name-list '(octave-mode-abbrev-table)))
+      (if (if octave-xemacs-p
+	      (or (eq (event-to-character (setq c (next-event))) ??)
+		  (eq (event-to-character c) help-char))
+	    (or (eq (setq c (read-event)) ??)
+		(eq c help-char)))
+	  (let ((abbrev-table-name-list '(octave-abbrev-table)))
 	    (list-abbrevs))
 	(setq unread-command-events (list c))))))
 
--- a/liboctave/Array2.cc
+++ b/liboctave/Array2.cc
@@ -188,6 +188,20 @@
   return false;
 }
 
+template <class T>
+Array2<T>
+Array2<T>::transpose (void) const
+{
+  Array2<T> result (d2, d1);
+
+  if (d1 > 0 && d2 > 0)
+    for (int j = 0; j < d2; j++)
+      for (int i = 0; i < d1; i++)
+	result.elem (j, i) = elem (i, j);
+
+  return result;
+}
+
 /*
 ;;; Local Variables: ***
 ;;; mode: C++ ***
--- a/liboctave/Array2.h
+++ b/liboctave/Array2.h
@@ -177,6 +177,8 @@
 
   bool is_symmetric (void) const;
 
+  Array2<T> transpose (void) const;
+
 #ifdef HEAVYWEIGHT_INDEXING
   void maybe_delete_elements (idx_vector& i, idx_vector& j);
 
--- a/liboctave/CMatrix.cc
+++ b/liboctave/CMatrix.cc
@@ -728,21 +728,6 @@
 }
 
 ComplexMatrix
-ComplexMatrix::transpose (void) const
-{
-  int nr = rows ();
-  int nc = cols ();
-  ComplexMatrix result (nc, nr);
-  if (length () > 0)
-    {
-      for (int j = 0; j < nc; j++)
-	for (int i = 0; i < nr; i++)
-	  result.elem (j, i) = elem (i, j);
-    }
-  return result;
-}
-
-ComplexMatrix
 conj (const ComplexMatrix& a)
 {
   int a_len = a.length ();
--- a/liboctave/CMatrix.h
+++ b/liboctave/CMatrix.h
@@ -114,7 +114,8 @@
   ComplexMatrix stack (const ComplexDiagMatrix& a) const;
 
   ComplexMatrix hermitian (void) const;  // complex conjugate transpose
-  ComplexMatrix transpose (void) const;
+  ComplexMatrix transpose (void) const
+    { return MArray2<Complex>::transpose (); }
 
   friend ComplexMatrix conj (const ComplexMatrix& a);
 
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -1,3 +1,17 @@
+Tue Nov 24 23:38:19 1998  Eric Norum <eric@skatter.USask.Ca>
+
+	* statdefs.h: Only define mode_t if not already defined.
+
+Tue Nov 24 17:24:52 1998  john <john@arrows.demon.co.uk>
+
+	* lo-specfun.cc (airy, biry): Set imaginary part of result to zero
+	when appropriate.
+
+Mon Nov 23 09:57:05 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* cmd-edit.cc (gnu_readline::gnu_readline): Set terminal name
+	before calling rl_initialize.
+
 Tue Nov 17 23:47:24 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* lo-specfun.cc (besselh, airy, biry): New functions.
--- a/liboctave/MArray2.h
+++ b/liboctave/MArray2.h
@@ -120,6 +120,14 @@
       return *this;
     }
 
+  MArray2<T>& insert (const Array2<T>& a, int r, int c)
+  {
+    Array2<T>::insert (a, r, c);
+    return *this;
+  }
+
+  MArray2<T> transpose (void) const { return Array2<T>::transpose (); }
+
   // element by element MArray2 by scalar ops
 
   friend MArray2<T>& operator += LTGT (MArray2<T>& a, const T& s);
--- a/liboctave/boolMatrix.cc
+++ b/liboctave/boolMatrix.cc
@@ -60,21 +60,6 @@
   return *this;
 }
 
-boolMatrix
-boolMatrix::transpose (void) const
-{
-  int nr = rows ();
-  int nc = cols ();
-  boolMatrix result (nc, nr);
-  if (length () > 0)
-    {
-      for (int j = 0; j < nc; j++)
-	for (int i = 0; i < nr; i++)
-	  result.elem (j, i) = elem (i, j);
-    }
-  return result;
-}
-
 // unary operations
 
 boolMatrix
--- a/liboctave/boolMatrix.h
+++ b/liboctave/boolMatrix.h
@@ -51,12 +51,12 @@
   bool operator == (const boolMatrix& a) const;
   bool operator != (const boolMatrix& a) const;
 
+  boolMatrix transpose (void) const { return Array2<bool>::transpose (); }
+
   // destructive insert/delete/reorder operations
 
   boolMatrix& insert (const boolMatrix& a, int r, int c);
 
-  boolMatrix transpose (void) const;
-
   // unary operations
 
   boolMatrix operator ! (void) const;
--- a/liboctave/chMatrix.cc
+++ b/liboctave/chMatrix.cc
@@ -173,21 +173,6 @@
 }
 
 charMatrix
-charMatrix::transpose (void) const
-{
-  int nr = rows ();
-  int nc = cols ();
-  charMatrix result (nc, nr);
-  if (length () > 0)
-    {
-      for (int j = 0; j < nc; j++)
-	for (int i = 0; i < nr; i++)
-	  result.elem (j, i) = elem (i, j);
-    }
-  return result;
-}
-
-charMatrix
 charMatrix::extract (int r1, int c1, int r2, int c2) const
 {
   if (r1 > r2) { int tmp = r1; r1 = r2; r2 = tmp; }
--- a/liboctave/chMatrix.h
+++ b/liboctave/chMatrix.h
@@ -67,8 +67,6 @@
 
   string row_as_string (int r, bool strip_trailing_whitespace = false) const;
 
-  charMatrix transpose (void) const;
-
   // resize is the destructive equivalent for this one
 
   charMatrix extract (int r1, int c1, int r2, int c2) const;
--- a/liboctave/cmd-edit.cc
+++ b/liboctave/cmd-edit.cc
@@ -24,6 +24,7 @@
 #include <config.h>
 #endif
 
+#include <cstdlib>
 #include <cstring>
 #include <ctime>
 
@@ -139,6 +140,8 @@
   : command_editor (), previous_startup_hook (0),
     previous_event_hook (0), completion_function (0)
 {
+  rl_terminal_name = ::getenv ("TERM");
+
   rl_initialize ();
 
   do_blink_matching_paren (true);
--- a/liboctave/dMatrix.cc
+++ b/liboctave/dMatrix.cc
@@ -401,21 +401,6 @@
 }
 
 Matrix
-Matrix::transpose (void) const
-{
-  int nr = rows ();
-  int nc = cols ();
-  Matrix result (nc, nr);
-  if (length () > 0)
-    {
-      for (int j = 0; j < nc; j++)
-	for (int i = 0; i < nr; i++)
-	  result.elem (j, i) = elem (i, j);
-    }
-  return result;
-}
-
-Matrix
 real (const ComplexMatrix& a)
 {
   int a_len = a.length ();
--- a/liboctave/dMatrix.h
+++ b/liboctave/dMatrix.h
@@ -93,11 +93,11 @@
   Matrix stack (const ColumnVector& a) const;
   Matrix stack (const DiagMatrix& a) const;
 
-  Matrix transpose (void) const;
-
   friend Matrix real (const ComplexMatrix& a);
   friend Matrix imag (const ComplexMatrix& a);
 
+  Matrix transpose (void) const { return MArray2<double>::transpose (); }
+
   // resize is the destructive equivalent for this one
 
   Matrix extract (int r1, int c1, int r2, int c2) const;
--- a/liboctave/lo-specfun.cc
+++ b/liboctave/lo-specfun.cc
@@ -612,6 +612,9 @@
 
   F77_FCN (zairy, ZAIRY) (zr, zi, id, kode, ar, ai, nz, ierr);
 
+  if (zi == 0.0 && (! scaled || zr > 0.0))
+    ai = 0.0;
+
   return bessel_return_value (Complex (ar, ai), ierr);
 }
 
@@ -630,6 +633,9 @@
 
   F77_FCN (zbiry, ZBIRY) (zr, zi, id, kode, ar, ai, ierr);
 
+  if (zi == 0.0 && (! scaled || zr > 0.0))
+    ai = 0.0;
+
   return bessel_return_value (Complex (ar, ai), ierr);
 }
 
--- a/liboctave/statdefs.h
+++ b/liboctave/statdefs.h
@@ -32,8 +32,10 @@
 #endif
 
 #ifndef S_ISREG			/* Doesn't have POSIX.1 stat stuff. */
+#ifndef mode_t
 #define mode_t unsigned short
 #endif
+#endif
 #if !defined(S_ISBLK) && defined(S_IFBLK)
 #define	S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
 #endif
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,30 @@
+Fri Dec  4 16:08:42 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* quaternion: New directory of functions from A. S. Hodel,
+	<a.s.hodel@eng.auburn.edu>.
+	* Makefile.in (SUBDIRS): Add it to the list.
+
+Tue Nov 24 21:41:31 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* image/saveimage.m: Make it work again for black and white colormaps.
+
+	* image/imagesc.m: Use rows (colormap), not length (colormap),
+	since there can be fewer rows than columns.  Round values to
+	nearest position in colormap instead of truncating. Correct usage
+	message.
+
+Tue Nov 24 14:50:52 1998  A Scott Hodel <hodel@edalf1.msfc.nasa.gov>
+
+	* linear-algebra/krylov.m: New arg pflg.  If nonzero, avoid using
+	zero rows of [A,v] as householder pivots; this avoids spurious
+	non-zero entries in returned orthogonal matrix U, but destroys the
+	Householder matrix structure of H.
+
+Fri Nov 20 12:46:46 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* general/logical.m: Just copy input to output if argument is
+	already a logical object.
+
 Fri Nov  6 10:17:00 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* New files from OCST, in control subdiretory:
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -26,7 +26,7 @@
 	configure mkinstalldirs
 
 SUBDIRS = audio control elfun finance general image io linear-algebra \
-	miscellaneous plot polynomial set signal specfun \
+	miscellaneous plot polynomial quaternion set signal specfun \
 	special-matrix startup statistics strings time
 
 DISTSUBDIRS = $(SUBDIRS)
--- a/scripts/general/logical.m
+++ b/scripts/general/logical.m
@@ -32,7 +32,11 @@
 function y = logical (x)
 
   if (nargin == 1)
-    y = x != 0;
+    if (! islogical (x))
+      y = x != 0;
+    else
+      y = x;
+    endif
   else
     usage ("logical (x)");
   endif
--- a/scripts/image/imagesc.m
+++ b/scripts/image/imagesc.m
@@ -31,10 +31,10 @@
 ## Created: July 1994
 ## Adapted-By: jwe
 
-function x = imagesc (x, zoom)
+function y = imagesc (x, zoom)
 
   if (nargin < 1 || nargin > 2)
-    usage ("image (matrix, [zoom])");
+    usage ("imagesc (matrix, [zoom])");
   elseif (nargin == 1)
     zoom = 4;
   endif
@@ -48,12 +48,12 @@
   ## length (colormap) inclusive.
 
   if (maxval == minval)
-    x = ones (high, wide);
+    y = ones (high, wide);
   else
     ## Rescale values to between 1 and length (colormap) inclusive.
-    x = fix ((x - minval) / (maxval - minval) * (length (colormap) - 1)) + 1;
+    y = round ((x - minval) / (maxval - minval) * (rows (colormap) - 1)) + 1;
   endif
 
-  image (x, zoom);
+  image (y, zoom);
 
 endfunction
--- a/scripts/image/saveimage.m
+++ b/scripts/image/saveimage.m
@@ -150,31 +150,33 @@
   if (strcmp (img_form, "ppm"))
     if (grey && map_nr == 2 && bw)
 
-      map = map(:,1);
-
       if (map(1) != 0)
-	map(1) = 1;
+      	map = [1; 0];
       else
-	map(2) = 1;
+      	map = [0; 1];
       endif
 
-      img = map(img);
-      n_long = rem (img_sz, 8);
-      if (n_long == 0)
-	n_long = 8;
-      else
-	n_long++;
-      endif
+      n_long = rem (img_nc, 8);
+      tmp = zeros (ceil (img_nc/8), img_nr);
 
-      idx = 1:8:img_sz;
-      s_len = length (idx) - 1;
-
-      tmp = img (1:8:img_sz) * 128;
-      for i = 2:n_long
-	tmp = tmp + img (i:8:img_sz) * 2^(8-i);
-      endfor
-      for i = (n_long+1):8
-	tmp(1:s_len) = tmp(1:s_len) + img (i:8:img_sz) * 2^(8-i);
+      for i = 1:img_nr
+	idx = (i-1)*img_nc+1:i*img_nc;
+      	if (n_long > 0)
+	  img_row = [map(img(idx)); zeros (8-n_long, 1)];
+	else
+      	  img_row = map(img(idx));
+	endif
+	img_row
+	tmp
+	if (img_nc < 8)
+	  for j = 1:8
+	    tmp(:,i) = tmp(:,i) + img_row (j) * 2^(8-j);
+	  endfor
+	else
+	  for j = 1:8
+	    tmp(:,i) = tmp(:,i) + img_row (j:8:img_nc) * 2^(8-j);
+	  endfor
+	endif
       endfor
 
       fid = fopen (filename, "w");
--- a/scripts/linear-algebra/krylov.m
+++ b/scripts/linear-algebra/krylov.m
@@ -16,47 +16,63 @@
 # along with Octave; see the file COPYING.  If not, write to the Free 
 # Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  
-function [U,H,k1] = krylov(A,v,k,eps1);
+function [U,H,k1] = krylov(A,v,k,eps1,pflg);
   # function [U,H,k1] = krylov(A,v,k{,eps1});
   # construct orthogonal basis U of Krylov subspace;
-  # 	span([v Av A^2*v ... A^(k+1)*v]);
+  #     span([v Av A^2*v ... A^(k+1)*v]);
   # via householder reflections; reflections are multiplied to obtain U
-  # eps1: threshhold for 0 relative to norm of current column (default: 1e-12)
-  # method used: householder reflections to guard against loss of
-  # orthogonality
-  #
+  # inputs:
+  #   A: square matrix
+  #   v: column vector
+  #   k: desired krylov subspace dimension (as above)
+  #   eps1: threshhold for 0 relative to norm of current column (default: 1e-12)
+  #   pflg: permutation flag (default 0): avoid using zero rows of
+  #      [A,v] as householder pivots; this avoids spurious non-zero entries
+  #      in returned orthogonal matrix U, but destroys the Householder matrix
+  #      structure of H.
   # outputs:
-  # returned basis U is n x k+1; A*U(:,1:k) = U*H
+  #   U: (n x k+1) orthogonal basis of Krylov subspace. A*U(:,1:k) = U*H
+  #   H: (pflg=0): Hessenberg matrix satisfying A*U(:,1:k) = U*H
+  #      (pflg=1): Workspace; does not satisfy above equation.
   # k1: dimension of span of krylov subspace (based on eps1)
   # if k > m-1, krylov returns the Hessenberg decompostion of A.
-  
+
   # Written by A. S. Hodel 1992
   # $Revision: 1.2 $
   # $Log$
 
-  if(nargin == 3)
-    eps1 = 1e-12;
+  if    (nargin > 5)   usage("[U,H,k1] = krylov(A,v,k{,eps1,pflg})");
+  elseif(nargin < 5)   pflg = 0;
+  elseif(nargin < 4)   eps1 = 1e-12; endif
+  na = is_square(A);
+  if(!na) error("krylov: A(%dx%d) must be square",na,na); endif
+  [m,n] = size(v);
+  if(!is_vector(v)) error("krylov: v(%dx%d) must be a vector",m,n);
+  elseif(length(v) != na)
+    error("krylov: A(%dx%d), v(%dx1); mismatch",na,na,length(v));
+  endif
+  v = vec(v);    # make sure it's a column vector
+  if(!is_scalar(k))
+    error("krylov: k(%dx%d) must be a scalar",rows(k), columns(k));
+  elseif( k > m)
+    warning("krylov: k is too large; reducing to %d",m-1);
+    k = m-1;
   endif
 
-  if( !is_square(A) )
-    error("first argument must be a square matrix")
-  else
-    [m,n] = size(v); 
-    if(m != is_square(A))
-      error("krylov: argument dimensions do not match")
-    elseif( !is_sample(k) )
-      error("krylov: third argument must be a scalar integer")
-    elseif( k > m)
-      warning(["krylov: k is too large; reducing to ",num2str(m)]);
-      k = m-1;
-    endif
-  endif
+  # check for zero input vector
+  if(norm(v) == 0) U = []; H = []; k1 = 0; return endif
+
+  # indices of legal pivot points (identifies trivial null space).
+  abm = max(abs([A,v]')); nzidx = find(abm != 0); zidx = find(abm == 0);
 
-  if(norm(v) == 0)
-    U = [];
-    H = [];
-    k1 = 0;
-    return
+  # check permutation flag
+  if(pflg)
+    # permute zero rows of [A,v] to trailing rows
+    permvec = [vec(nzidx); vec(zidx)];
+    pmat = eye(na); pmat = pmat(permvec,:);
+    ipermvec = pmat'*vec(1:na);
+    A = A(permvec,permvec);
+    v = v(permvec);
   endif
 
   k1 = k+1;		# Assume subspace basis has full rank
@@ -127,4 +143,15 @@
    U(i:n,i:j1) = U(i:n,i:j1)-av*hv*(hv'*U(i:n,i:j1));
   endfor
 
+  # check permutation flag
+  if(pflg)
+    # permute rows of U back to original coordinates
+    U = U(ipermvec,:);
+  endif
+
+  # check for spurious nonzero entries
+  if( max(max( abs(U(zidx,:)) )) > eps1 )
+    warning("krylov: trivial null space corrupted; set pflg=1 or eps1>%e",eps1);
+  endif
+
 endfunction
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,33 @@
+Wed Dec  2 22:38:40 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* utils.cc (file_in_loadpath): Expect argc == 2, not 3.
+
+Tue Nov 24 23:38:19 1998  Eric Norum <eric@skatter.USask.Ca>
+
+	* mkbuiltins: Also strip off leading `./' from file names.
+	* mkops: Ditto.
+
+Tue Nov 24 23:24:26 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* strftime.c: Surround everything with #ifdef HAVE_STRFTIME / #endif.
+
+	* lex.h (YY_FATAL_ERROR): Call yy_falta_error after
+	jump_to_top_level to avoid gcc warning.
+
+Fri Nov 20 13:34:47 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* ov-bool.h, ov-bool.cc (class octave_bool): Derive from
+	octave_base_scalar and get common functions via derivation.
+	* ov-scalar.h, ov-scalar.cc (class octave_scalar): Ditto.
+	* ov-complex.h, ov-complex.cc (class octave_complex): Ditto.
+
+	* ov-base-scalar.h, ov-base-scalar.cc (class octave_base_scalar):
+	New files for new class definition.  Put common scalar data type
+	stuff here.
+	* Makefile.in (OV_INCLUDES, OV_SRC): Add them to the lists.
+
 Thu Nov 19 14:30:25 1998  John W. Eaton  <jwe@bevo.che.wisc.edu>
-
+	
 	* dynamic-ld.cc (octave_dynamic_loader::mangle_name):
 	Prepend underscore here.
 	(octave_dynamic_loader::load_fcn_from_dot_oct_file): Not here.
--- a/src/lex.h
+++ b/src/lex.h
@@ -33,6 +33,8 @@
     YY_FATAL_ERROR ("octave_read () in flex scanner failed");
 
 // Try to avoid crashing out completely on fatal scanner errors.
+// The call to yy_fatal_error should never happen, but it avoids a
+// `static function defined but not used' warning from gcc.
 
 #ifdef YY_FATAL_ERROR
 #undef YY_FATAL_ERROR
@@ -42,6 +44,7 @@
     { \
       error (msg); \
       jump_to_top_level (); \
+      yy_fatal_error (msg); \
     } \
   while (0)
 
--- a/src/mkbuiltins
+++ b/src/mkbuiltins
@@ -32,7 +32,7 @@
 EOF
 
 for file in $DEF_FILES; do
-  fcn=`echo $file | sed 's/\.df//; s/-/_/g'`
+  fcn=`echo $file | sed 's,^\./,,; s/\.df//; s/-/_/g'`
   echo "static void"
   echo "install_${fcn}_fcns (void)"
   echo "{"
@@ -42,7 +42,7 @@
 done
 
 for file in $VAR_FILES; do
-  f=`echo $file | sed 's/-/_/g'`
+  f=`echo $file | sed 's,^\./,,; s/-/_/g'`
   echo "extern void symbols_of_${f} (void);"
 done
 
@@ -54,7 +54,7 @@
 EOF
 
 for file in $VAR_FILES; do
-  f=`echo $file | sed 's/-/_/g'`
+  f=`echo $file | sed 's,^\./,,; s/-/_/g'`
   echo "  symbols_of_${f} ();"
 done
 
@@ -67,7 +67,7 @@
 EOF
 
 for file in $DEF_FILES; do
-  fcn=`echo $file | sed 's/\.df//; s/-/_/g'`
+  fcn=`echo $file | sed 's,^\./,,; s/\.df//; s/-/_/g'`
   echo "  install_${fcn}_fcns ();"
 done
 
--- a/src/mkops
+++ b/src/mkops
@@ -12,7 +12,7 @@
 EOF
 
 for file in "$@"; do
-  f=`echo $file | sed 's%^OPERATORS/op-%%; s%\.cc%%; s%-%_%g'`
+  f=`echo $file | sed 's,^\./,,; s%^OPERATORS/op-%%; s%\.cc%%; s%-%_%g'`
   echo "extern void install_${f}_ops (void);"
 done
 
@@ -26,7 +26,7 @@
 EOF
 
 for file in "$@"; do
-  f=`echo $file | sed 's%^OPERATORS/op-%%; s%\.cc%%; s%-%_%g'`
+  f=`echo $file | sed 's,^\./,,; s%^OPERATORS/op-%%; s%\.cc%%; s%-%_%g'`
   echo "  install_${f}_ops ();"
 done
 
--- a/src/ov-bool-mat.h
+++ b/src/ov-bool-mat.h
@@ -59,6 +59,9 @@
   octave_bool_matrix (const boolMatrix& bm)
     : octave_base_matrix<boolMatrix> (bm) { }
 
+  octave_bool_matrix (const Array2<bool>& a)
+    : octave_base_matrix<boolMatrix> (a) { }
+
   octave_bool_matrix (const octave_bool_matrix& bm)
     : octave_base_matrix<boolMatrix> (bm) { }
 
--- a/src/strftime.c
+++ b/src/strftime.c
@@ -21,6 +21,8 @@
 # include <config.h>
 #endif
 
+#ifndef HAVE_STRFTIME
+
 #ifdef _LIBC
 # define HAVE_LIMITS_H 1
 # define HAVE_MBLEN 1
@@ -889,3 +891,5 @@
     *p = '\0';
   return i;
 }
+
+#endif
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -249,7 +249,7 @@
   if (error_state)
     return retval;
 
-  if (argc == 3)
+  if (argc == 2)
     retval = octave_env::make_absolute (Vload_path_dir_path.find (argv[1]),
 					octave_env::getcwd ());
   else
--- a/src/version.h
+++ b/src/version.h
@@ -23,7 +23,7 @@
 #if !defined (octave_version_h)
 #define octave_version_h 1
 
-#define OCTAVE_VERSION "2.1.10"
+#define OCTAVE_VERSION "2.1.11"
 
 #define OCTAVE_COPYRIGHT \
   "Copyright (C) 1996, 1997, 1998 John W. Eaton."