changeset 3107:a8dcfbf87ea3

[project @ 1997-11-19 22:34:59 by jwe]
author jwe
date Wed, 19 Nov 1997 22:35:03 +0000
parents 21208b797332
children bb7ffd516332
files ChangeLog NEWS acconfig.h aclocal.m4 configure.in dlfcn/Makefile.orig libcruft/Makefile.in liboctave/ChangeLog liboctave/MArray.h liboctave/MArray2.h liboctave/MDiagArray2.h liboctave/mx-inlines.cc octMakefile.in src/ChangeLog src/DLD-FUNCTIONS/filter.cc src/ov-cx-mat.cc src/ov-cx-mat.h src/ov-re-mat.cc src/ov-str-mat.cc src/pt-decl.cc src/version.h
diffstat 21 files changed, 366 insertions(+), 120 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+Wed Nov 19 01:54:11 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* aclocal.m4 (OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL): Don't forget
+	to call AC_LANG_RESTORE.
+
+	* acconfig.h: Add undefs for NO_EXTERN_TEMPLATE_DECLS and
+	NEED_TEMPLATE_FCN_SPECS.
+
+	* configure.in (CXX_VERSION): Require 2.7.2 or later.
+	Define NO_EXTERN_TEMPLATE_DECLS and NEED_TEMPLATE_FCN_SPECS if
+	using egcs or 2.8.x or later.
+
+Wed Nov 19 01:38:58 1997  Mumit Khan  <khan@dhaka.xraylith.wisc.edu>
+
+	* aclocal.m4 (OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL): New macro
+	check for new friend template declaration syntax (guiding
+	declarations in DWP).
+	* configure.in: Use it.
+	* config.h.in: Add undef for CXX_NEW_FRIEND_TEMPLATE_DECL.
+
+	* configure.in (CC_VERSION, CXX_VERISON): Check for egcs snapshots.
+
 Mon Oct 20 01:31:45 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* configure.in: Reprint important warning messages at the end of
--- a/NEWS
+++ b/NEWS
@@ -148,6 +148,19 @@
     right-hand-side functions that define the set of differential
     equations with respect to the state vector X.
 
+  * Global variables are now initialized to the empty matrix, for
+    compatibility with Matlab.
+
+  * Explicit initialization of global variables only happens once.
+    For example, after the following statements are evaluated, g still
+    has the value 1.
+
+      global g = 1
+      global g = 2
+
+    This is useful for initializing global variables that are used to
+    maintain state information that is shared among several functions.
+
   * Structure elements completion on the command line actually works
     now.
 
--- a/acconfig.h
+++ b/acconfig.h
@@ -10,6 +10,9 @@
    internal array and matrix classes. */
 #undef BOUNDS_CHECKING
 
+/* Define if your compiler supports `<>' stuff for template friends. */
+#undef CXX_NEW_FRIEND_TEMPLATE_DECL
+
 /* Define if your math.h declares struct exception for matherr() */
 #undef EXCEPTION_IN_MATH
 
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -565,3 +565,42 @@
   AC_DEFINE($1, $3)
 fi
 ])
+dnl
+dnl Check to see if C++ compiler needs the new friend template declaration 
+dnl syntax. 
+dnl
+dnl OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL
+AC_DEFUN(OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL, [
+  AC_REQUIRE([AC_PROG_CXX])
+  AC_MSG_CHECKING([for C++ support for new friend template declaration])
+  AC_CACHE_VAL(octave_cv_cxx_new_friend_template_decl, [
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    rm -f conftest.h
+    cat > conftest.h <<EOB
+       struct A {
+	 friend int operator== (const A&, const A&);
+	 A (int) { }
+       };
+
+       template <class T> int
+       operator== (const T&, const T&)
+       {
+	 return 0;
+       }
+EOB
+    AC_TRY_LINK([#include "conftest.h"], [
+        A a (1);
+        return a == A(1);
+      ], 
+      octave_cv_cxx_new_friend_template_decl=no,
+      octave_cv_cxx_new_friend_template_decl=yes,
+      octave_cv_cxx_new_friend_template_decl=yes
+    )
+    AC_LANG_RESTORE
+  ])
+  AC_MSG_RESULT($octave_cv_cxx_new_friend_template_decl)
+  if test $octave_cv_cxx_new_friend_template_decl = yes; then
+    AC_DEFINE(CXX_NEW_FRIEND_TEMPLATE_DECL)
+  fi
+])
--- 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.286 $)
+AC_REVISION($Revision: 1.287 $)
 AC_PREREQ(2.9)
 AC_INIT(src/octave.cc)
 AC_CONFIG_HEADER(config.h)
@@ -183,12 +183,17 @@
 
 ADD_CXX_WALL=false
 NO_IMPLICIT_TEMPLATES=
+
 gxx_version=`$CXX -v 2>&1 | grep "^.*g.. version" | \
-  sed -e 's/^.*g.. version *//' -e 's/cygnus-//'`
+  sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'`
+
 case "$gxx_version" in
 changequote(,)dnl
-  2.[6789].* | 2.[123456789][0123456789].*)
+  1.* | 2.[0123456].* | 2.7.[01]*)
 changequote([,])dnl
+    AC_MSG_ERROR([g++ version $gxx_version will not work to compile Octave])
+  ;;
+  2.7.[23456789]* | 2.7.[123456789][0123456789]*)
     if test -z "$EXTERN_CXXFLAGS"; then
       ADD_CXX_WALL=true
     fi
@@ -196,9 +201,13 @@
     AC_MSG_RESULT([defining NO_IMPLICIT_TEMPLATES to be $NO_IMPLICIT_TEMPLATES])
   ;;
 changequote(,)dnl
-  1.* | 2.[012345].*)
+  2.[89].* | 2.[123456789][0123456789].*)
 changequote([,])dnl
-    AC_MSG_ERROR([g++ version $gxx_version will not work to compile Octave])
+    if test -z "$EXTERN_CXXFLAGS"; then
+      ADD_CXX_WALL=true
+    fi
+    NO_IMPLICIT_TEMPLATES="-fno-implicit-templates"
+    AC_MSG_RESULT([defining NO_IMPLICIT_TEMPLATES to be $NO_IMPLICIT_TEMPLATES])
   ;;
   *)
     warn_gxx_only="Octave has only been tested with g++, and I can't find it"
@@ -206,18 +215,6 @@
   ;;
 esac
 
-HOST_CXXFLAGS=
-case "$gxx_version" in
-  2.6.*)
-    case "$canonical_host_type" in
-      rs6000-ibm-aix* | powerpc-ibm-aix*)
-        HOST_CXXFLAGS="-Wa,-u"
-        AC_MSG_RESULT([defining HOST_CXXFLAGS to be $HOST_CXXFLAGS])
-      ;;
-    esac
-  ;;
-esac
-
 CXX_VERSION=
 if test -n "$gxx_version"; then
   CXX_VERSION="$gxx_version"
@@ -227,6 +224,8 @@
 AC_SUBST(HOST_CXXFLAGS)
 AC_SUBST(NO_IMPLICIT_TEMPLATES)
 
+OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL
+
 ### See which C compiler to use (we expect to find gcc).
 
 EXTERN_CFLAGS="$CFLAGS"
@@ -239,7 +238,7 @@
 
 ADD_CC_WALL=false
 gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | \
-  sed -e 's/^.*g.. version *//' -e 's/cygnus-//'`
+  sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'`
 case "$gcc_version" in
   2.*)
     if test -z "$EXTERN_CFLAGS"; then
deleted file mode 100644
--- a/dlfcn/Makefile.orig
+++ /dev/null
@@ -1,44 +0,0 @@
-# %W% revision of %E%  %U%
-# This is an unpublished work copyright (c) 1992 HELIOS Software GmbH
-# 30159 Hannover, Germany
-
-# Do not edit at HELIOS, edit GNUmakefile instead!
-
-SHELL=/bin/sh
-IPATH=
-DEFS=
-DEBUGFLAGS=-g -DDEBUG
-NODEBUGFLAGS=-O
-CFLAGS=$(IPATH) $(DEFS) $(NODEBUGFLAGS)
-TARGET=libdl.a
-DEST=/usr/local/lib
-HDRS=dlfcn.h
-SRCS=dlfcn.c
-NOSTART=-e _nostart	# for AIX 3
-#NOSTART=-bnoentry	# for AIX 4
-OBJS=$(SRCS:%.c=%.o)
-
-all:		$(TARGET) dlfcn.c
-
-dlfcn.o:	dlfcn.h
-
-$(TARGET):	$(OBJS) dl.exp
-		$(CC) $(CFLAGS) -o $@ $(OBJS) -bE:dl.exp -bM:SRE $(NOSTART) -lld
-
-lint:
-		lint $(IPATH) $(DEFS) $(SRCS) >lintout
-
-info:
-		sccs info
-
-clean:
-		rm -f lintout a.out core *.o *-lg *% *~ tags deps%
-
-clobber:	clean
-		rm -f $(TARGET) deps
-
-install:	all
-		cp $(TARGETS) $(DEST)
-
-shar:
-		shar README Makefile dlfcn.h dlfcn.c dl.exp >dlfcn.shar
--- a/libcruft/Makefile.in
+++ b/libcruft/Makefile.in
@@ -30,8 +30,7 @@
 
 SUBDIRS = $(CRUFT_DIRS)
 
-DISTFILES = Makefile.in ChangeLog Makerules.in configure.in \
-	$(SOURCES) STOP.patch
+DISTFILES = Makefile.in ChangeLog Makerules.in $(SOURCES) STOP.patch
 
 ifeq ($(SHARED_LIBS), true)
   BINDISTFILES = libcruft.$(SHLEXT_VER)
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -1,3 +1,13 @@
+Wed Nov 19 02:30:04 1997  Mumit Khan <khan@dhaka.xraylith.wisc.edu>
+
+	Changes to make support egcs snapshots that implement explicit
+	specification of template functions according to CD2.
+
+	* MArray.h: If NEED_TEMPLATE_FCN_SPECS is defined, add explicit
+	template function specs for template friends.
+	* MArray2.h: Likewise.
+	* MDiagArray2.h: Likewise.
+
 Thu Nov 13 21:57:16 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* CMatrix.cc (sumsq): Compute equivalent of sum (x .* conj (x))
--- a/liboctave/MArray.h
+++ b/liboctave/MArray.h
@@ -30,6 +30,71 @@
 
 #include "Array.h"
 
+#if defined (LTGT)
+#undef LTGT
+#endif
+
+#if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
+#define LTGT
+#else
+
+#define LTGT <>
+
+template <class T> 
+class MArray;
+
+template <typename T> MArray<T>& 
+operator += (MArray<T>& a, const T& s);
+
+template <typename T> MArray<T>& 
+operator -= (MArray<T>& a, const T& s);
+
+template <typename T> MArray<T>& 
+operator += (MArray<T>& a, const MArray<T>& b);
+
+template <typename T> MArray<T>& 
+operator -= (MArray<T>& a, const MArray<T>& b);
+
+template <typename T> MArray<T> 
+operator + (const MArray<T>& a, const T& s);
+
+template <typename T> MArray<T> 
+operator - (const MArray<T>& a, const T& s);
+
+template <typename T> MArray<T> 
+operator * (const MArray<T>& a, const T& s);
+
+template <typename T> MArray<T> 
+operator / (const MArray<T>& a, const T& s);
+
+template <typename T> MArray<T> 
+operator + (const T& s, const MArray<T>& a);
+
+template <typename T> MArray<T> 
+operator - (const T& s, const MArray<T>& a);
+
+template <typename T> MArray<T> 
+operator * (const T& s, const MArray<T>& a);
+
+template <typename T> MArray<T> 
+operator / (const T& s, const MArray<T>& a);
+
+template <typename T> MArray<T> 
+operator + (const MArray<T>& a, const MArray<T>& b);
+
+template <typename T> MArray<T> 
+operator - (const MArray<T>& a, const MArray<T>& b);
+
+template <class T> MArray<T> 
+product (const MArray<T>& a, const MArray<T>& b);
+
+template <typename T> MArray<T> 
+quotient (const MArray<T>& a, const MArray<T>& b);
+
+template <typename T> MArray<T> 
+operator - (const MArray<T>& a);
+#endif
+
 // One dimensional array with math ops.
 
 template <class T>
@@ -57,44 +122,45 @@
 
   // element by element MArray by scalar ops
 
-  friend MArray<T>& operator += (MArray<T>& a, const T& s);
-  friend MArray<T>& operator -= (MArray<T>& a, const T& s);
+  friend MArray<T>& operator += LTGT (MArray<T>& a, const T& s);
+  friend MArray<T>& operator -= LTGT (MArray<T>& a, const T& s);
 
   // element by element MArray by MArray ops
 
-  friend MArray<T>& operator += (MArray<T>& a, const MArray<T>& b);
-  friend MArray<T>& operator -= (MArray<T>& a, const MArray<T>& b);
+  friend MArray<T>& operator += LTGT (MArray<T>& a, const MArray<T>& b);
+  friend MArray<T>& operator -= LTGT (MArray<T>& a, const MArray<T>& b);
 
   // element by element MArray by scalar ops
 
-  friend MArray<T> operator + (const MArray<T>& a, const T& s);
-  friend MArray<T> operator - (const MArray<T>& a, const T& s);
-  friend MArray<T> operator * (const MArray<T>& a, const T& s);
-  friend MArray<T> operator / (const MArray<T>& a, const T& s);
+  friend MArray<T> operator + LTGT (const MArray<T>& a, const T& s);
+  friend MArray<T> operator - LTGT (const MArray<T>& a, const T& s);
+  friend MArray<T> operator * LTGT (const MArray<T>& a, const T& s);
+  friend MArray<T> operator / LTGT (const MArray<T>& a, const T& s);
 
   // element by element scalar by MArray ops
 
-  friend MArray<T> operator + (const T& s, const MArray<T>& a);
-  friend MArray<T> operator - (const T& s, const MArray<T>& a);
-  friend MArray<T> operator * (const T& s, const MArray<T>& a);
-  friend MArray<T> operator / (const T& s, const MArray<T>& a);
+  friend MArray<T> operator + LTGT (const T& s, const MArray<T>& a);
+  friend MArray<T> operator - LTGT (const T& s, const MArray<T>& a);
+  friend MArray<T> operator * LTGT (const T& s, const MArray<T>& a);
+  friend MArray<T> operator / LTGT (const T& s, const MArray<T>& a);
 
   // element by element MArray by MArray ops
 
-  friend MArray<T> operator + (const MArray<T>& a, const MArray<T>& b);
+  friend MArray<T> operator + LTGT (const MArray<T>& a, const MArray<T>& b);
 
-  friend MArray<T> operator - (const MArray<T>& a, const MArray<T>& b);
+  friend MArray<T> operator - LTGT (const MArray<T>& a, const MArray<T>& b);
 
-  friend MArray<T> product (const MArray<T>& a, const MArray<T>& b);
-  friend MArray<T> quotient (const MArray<T>& a, const MArray<T>& b);
+  friend MArray<T> product LTGT (const MArray<T>& a, const MArray<T>& b);
+  friend MArray<T> quotient LTGT (const MArray<T>& a, const MArray<T>& b);
 
-  friend MArray<T> operator - (const MArray<T>& a);
+  friend MArray<T> operator - LTGT (const MArray<T>& a);
 };
 
+#undef LTGT
+
 extern void
 gripe_nonconformant (const char *op, int op1_len, int op2_len);
 
-
 #define INSTANTIATE_MARRAY_FRIENDS(T) \
   template MArray<T>& operator += (MArray<T>& a, const T& s); \
   template MArray<T>& operator -= (MArray<T>& a, const T& s); \
--- a/liboctave/MArray2.h
+++ b/liboctave/MArray2.h
@@ -30,6 +30,71 @@
 
 #include "Array2.h"
 
+#if defined (LTGT)
+#undef LTGT
+#endif
+
+#if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
+#define LTGT
+#else
+
+#define LTGT <>
+
+template <class T>
+class MArray2;
+
+template <typename T> MArray2<T>& 
+operator += (MArray2<T>& a, const T& s);
+
+template <typename T> MArray2<T>& 
+operator -= (MArray2<T>& a, const T& s);
+
+template <typename T> MArray2<T>& 
+operator += (MArray2<T>& a, const MArray2<T>& b);
+
+template <typename T> MArray2<T>& 
+operator -= (MArray2<T>& a, const MArray2<T>& b);
+
+template <typename T> MArray2<T> 
+operator + (const MArray2<T>& a, const T& s);
+
+template <typename T> MArray2<T> 
+operator - (const MArray2<T>& a, const T& s);
+
+template <typename T> MArray2<T> 
+operator * (const MArray2<T>& a, const T& s);
+
+template <typename T> MArray2<T> 
+operator / (const MArray2<T>& a, const T& s);
+
+template <typename T> MArray2<T> 
+operator + (const T& s, const MArray2<T>& a);
+
+template <typename T> MArray2<T> 
+operator - (const T& s, const MArray2<T>& a);
+
+template <typename T> MArray2<T> 
+operator * (const T& s, const MArray2<T>& a);
+
+template <typename T> MArray2<T> 
+operator / (const T& s, const MArray2<T>& a);
+
+template <typename T> MArray2<T> 
+operator + (const MArray2<T>& a, const MArray2<T>& b);
+
+template <typename T> MArray2<T> 
+operator - (const MArray2<T>& a, const MArray2<T>& b);
+
+template <typename T> MArray2<T> 
+product (const MArray2<T>& a, const MArray2<T>& b);
+
+template <typename T> MArray2<T> 
+quotient (const MArray2<T>& a, const MArray2<T>& b);
+
+template <typename T> MArray2<T> 
+operator - (const MArray2<T>& a);
+#endif
+
 // Two dimensional array with math ops.
 
 template <class T>
@@ -57,39 +122,41 @@
 
   // element by element MArray2 by scalar ops
 
-  friend MArray2<T>& operator += (MArray2<T>& a, const T& s);
-  friend MArray2<T>& operator -= (MArray2<T>& a, const T& s);
+  friend MArray2<T>& operator += LTGT (MArray2<T>& a, const T& s);
+  friend MArray2<T>& operator -= LTGT (MArray2<T>& a, const T& s);
 
   // element by element MArray2 by MArray2 ops
 
-  friend MArray2<T>& operator += (MArray2<T>& a, const MArray2<T>& b);
-  friend MArray2<T>& operator -= (MArray2<T>& a, const MArray2<T>& b);
+  friend MArray2<T>& operator += LTGT (MArray2<T>& a, const MArray2<T>& b);
+  friend MArray2<T>& operator -= LTGT (MArray2<T>& a, const MArray2<T>& b);
 
   // element by element MArray2 by scalar ops
 
-  friend MArray2<T> operator + (const MArray2<T>& a, const T& s);
-  friend MArray2<T> operator - (const MArray2<T>& a, const T& s);
-  friend MArray2<T> operator * (const MArray2<T>& a, const T& s);
-  friend MArray2<T> operator / (const MArray2<T>& a, const T& s);
+  friend MArray2<T> operator + LTGT (const MArray2<T>& a, const T& s);
+  friend MArray2<T> operator - LTGT (const MArray2<T>& a, const T& s);
+  friend MArray2<T> operator * LTGT (const MArray2<T>& a, const T& s);
+  friend MArray2<T> operator / LTGT (const MArray2<T>& a, const T& s);
 
   // element by element scalar by MArray2 ops
 
-  friend MArray2<T> operator + (const T& s, const MArray2<T>& a);
-  friend MArray2<T> operator - (const T& s, const MArray2<T>& a);
-  friend MArray2<T> operator * (const T& s, const MArray2<T>& a);
-  friend MArray2<T> operator / (const T& s, const MArray2<T>& a);
+  friend MArray2<T> operator + LTGT (const T& s, const MArray2<T>& a);
+  friend MArray2<T> operator - LTGT (const T& s, const MArray2<T>& a);
+  friend MArray2<T> operator * LTGT (const T& s, const MArray2<T>& a);
+  friend MArray2<T> operator / LTGT (const T& s, const MArray2<T>& a);
 
   // element by element MArray2 by MArray2 ops
 
-  friend MArray2<T> operator + (const MArray2<T>& a, const MArray2<T>& b);
-  friend MArray2<T> operator - (const MArray2<T>& a, const MArray2<T>& b);
+  friend MArray2<T> operator + LTGT (const MArray2<T>& a, const MArray2<T>& b);
+  friend MArray2<T> operator - LTGT (const MArray2<T>& a, const MArray2<T>& b);
 
-  friend MArray2<T> product (const MArray2<T>& a, const MArray2<T>& b);
-  friend MArray2<T> quotient (const MArray2<T>& a, const MArray2<T>& b);
+  friend MArray2<T> product LTGT (const MArray2<T>& a, const MArray2<T>& b);
+  friend MArray2<T> quotient LTGT (const MArray2<T>& a, const MArray2<T>& b);
 
-  friend MArray2<T> operator - (const MArray2<T>& a);
+  friend MArray2<T> operator - LTGT (const MArray2<T>& a);
 };
 
+#undef LTGT
+
 extern void
 gripe_nonconformant (const char *op, int op1_nr, int op1_nc,
 		     int op2_nr, int op2_nc);
--- a/liboctave/MDiagArray2.h
+++ b/liboctave/MDiagArray2.h
@@ -31,6 +31,47 @@
 #include "DiagArray2.h"
 #include "MArray2.h"
 
+#if defined (LTGT)
+#undef LTGT
+#endif
+
+#if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
+#define LTGT
+#else
+
+#define LTGT <>
+
+template <class T>
+class MDiagArray2;
+
+template <typename T> MDiagArray2<T>&
+operator += (MDiagArray2<T>& a, const MDiagArray2<T>& b);
+
+template <typename T> MDiagArray2<T>&
+operator -= (MDiagArray2<T>& a, const MDiagArray2<T>& b);
+
+template <typename T> MDiagArray2<T> 
+operator * (const MDiagArray2<T>& a, const T& s);
+
+template <typename T> MDiagArray2<T> 
+operator / (const MDiagArray2<T>& a, const T& s);
+
+template <typename T> MDiagArray2<T> 
+operator * (const T& s, const MDiagArray2<T>& a);
+
+template <typename T> MDiagArray2<T>
+operator + (const MDiagArray2<T>& a, const MDiagArray2<T>& b); 
+
+template <typename T> MDiagArray2<T>
+operator - (const MDiagArray2<T>& a, const MDiagArray2<T>& b);
+
+template <typename T> MDiagArray2<T>
+product (const MDiagArray2<T>& a, const MDiagArray2<T>& b);
+
+template <typename T> MDiagArray2<T> 
+operator - (const MDiagArray2<T>& a);
+#endif
+
 // Two dimensional diagonal array with math ops.
 
 template <class T>
@@ -72,33 +113,35 @@
   // element by element MDiagArray2 by MDiagArray2 ops
 
   friend MDiagArray2<T>&
-  operator += (MDiagArray2<T>& a, const MDiagArray2<T>& b);
+  operator += LTGT (MDiagArray2<T>& a, const MDiagArray2<T>& b);
 
   friend MDiagArray2<T>&
-  operator -= (MDiagArray2<T>& a, const MDiagArray2<T>& b);
+  operator -= LTGT (MDiagArray2<T>& a, const MDiagArray2<T>& b);
 
   // element by element MDiagArray2 by scalar ops
 
-  friend MDiagArray2<T> operator * (const MDiagArray2<T>& a, const T& s);
-  friend MDiagArray2<T> operator / (const MDiagArray2<T>& a, const T& s);
+  friend MDiagArray2<T> operator * LTGT (const MDiagArray2<T>& a, const T& s);
+  friend MDiagArray2<T> operator / LTGT (const MDiagArray2<T>& a, const T& s);
 
   // element by element scalar by MDiagArray2 ops
 
-  friend MDiagArray2<T> operator * (const T& s, const MDiagArray2<T>& a);
+  friend MDiagArray2<T> operator * LTGT (const T& s, const MDiagArray2<T>& a);
 
   // element by element MDiagArray2 by MDiagArray2 ops
 
   friend MDiagArray2<T>
-  operator + (const MDiagArray2<T>& a, const MDiagArray2<T>& b); 
+  operator + LTGT (const MDiagArray2<T>& a, const MDiagArray2<T>& b); 
+
+  friend MDiagArray2<T>
+  operator - LTGT (const MDiagArray2<T>& a, const MDiagArray2<T>& b);
 
   friend MDiagArray2<T>
-  operator - (const MDiagArray2<T>& a, const MDiagArray2<T>& b);
+  product LTGT (const MDiagArray2<T>& a, const MDiagArray2<T>& b);
 
-  friend MDiagArray2<T>
-  product (const MDiagArray2<T>& a, const MDiagArray2<T>& b);
+  friend MDiagArray2<T> operator - LTGT (const MDiagArray2<T>& a);
+};
 
-  friend MDiagArray2<T> operator - (const MDiagArray2<T>& a);
-};
+#undef LTGT
 
 #define INSTANTIATE_MDIAGARRAY_FRIENDS(T) \
   template MDiagArray2<T>& operator += (MDiagArray2<T>& a, const MDiagArray2<T>& b); \
--- a/liboctave/mx-inlines.cc
+++ b/liboctave/mx-inlines.cc
@@ -223,8 +223,8 @@
 
 OP_DUP_FCN (, make_complex, Complex, double)
 
-OP_DUP_FCN (-, negate, double,  double)
-OP_DUP_FCN (-, negate, Complex, Complex)
+OP_DUP_FCN (-, change_sign, double,  double)
+OP_DUP_FCN (-, change_sign, Complex, Complex)
 
 OP_DUP_FCN (real, real_dup, double,  Complex)
 OP_DUP_FCN (imag, imag_dup, double,  Complex)
--- a/octMakefile.in
+++ b/octMakefile.in
@@ -26,7 +26,7 @@
 DISTFILES = $(CONF_DISTFILES) \
 	BUGS COPYING INSTALL INSTALL.OCTAVE NEWS NEWS.[0-9] PROJECTS \
 	README README.Linux README.Windows ROADMAP SENDING-PATCHES \
-	THANKS INFO.PATCH move-if-change octave-sh octave-bug.in \
+	THANKS move-if-change octave-sh octave-bug.in \
 	install-octave mkinstalldirs mkoctfile.in texi2dvi \
 	ChangeLog ChangeLog.[0-9]
 
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,19 @@
+Wed Nov 19 02:05:40 1997  Mumit Khan <khan@dhaka.xraylith.wisc.edu>
+
+	* DLD-FUNCTIONS/filter.cc: Don't include extern template decls if
+	NO_EXTERN_TEMPLATE_DECLS is defined.
+	* ov-cx-mat.cc: Likewise.
+	* ov-re-mat.cc: Likewise.
+	* ov-str-mat.cc: Likewise.
+
+	* ov-cx-mat.h (octave_complex_matrix::decrement,
+	octave_complex_matrix):	Use explicit Complex constructor.
+
+Wed Nov 19 00:08:13 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* pt-decl.cc (tree_global_command::do_init): Initialize global
+	values to `[]'.  Only perform explicit initialization once.
+
 Tue Nov 18 04:27:55 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* pr-output.cc (Vfixed_point_format): New variable.
--- a/src/DLD-FUNCTIONS/filter.cc
+++ b/src/DLD-FUNCTIONS/filter.cc
@@ -36,11 +36,13 @@
 #include "error.h"
 #include "oct-obj.h"
 
+#if !defined (NO_EXTERN_TEMPLATE_DECLS)
 extern MArray<double>
 filter (MArray<double>&, MArray<double>&, MArray<double>&);
 
 extern MArray<Complex>
 filter (MArray<Complex>&, MArray<Complex>&, MArray<Complex>&);
+#endif
 
 template <class T>
 MArray<T>
@@ -125,6 +127,7 @@
   return y;
 }
 
+#if !defined (NO_EXTERN_TEMPLATE_DECLS)
 extern MArray<double>
 filter (MArray<double>&, MArray<double>&, MArray<double>&,
 	MArray<double>&);
@@ -132,6 +135,7 @@
 extern MArray<Complex>
 filter (MArray<Complex>&, MArray<Complex>&, MArray<Complex>&,
 	MArray<Complex>&);
+#endif
 
 template <class T>
 MArray<T>
--- a/src/ov-cx-mat.cc
+++ b/src/ov-cx-mat.cc
@@ -122,7 +122,9 @@
   return retval;
 }
 
+#if !defined (NO_EXTERN_TEMPLATE_DECLS)
 extern void assign (Array2<Complex>&, const Array2<Complex>&);
+#endif
 
 void
 octave_complex_matrix::assign (const octave_value_list& idx,
@@ -161,7 +163,9 @@
     }
 }
 
+#if !defined (NO_EXTERN_TEMPLATE_DECLS)
 extern void assign (Array2<Complex>&, const Array2<double>&);
+#endif
 
 void
 octave_complex_matrix::assign (const octave_value_list& idx,
--- a/src/ov-cx-mat.h
+++ b/src/ov-cx-mat.h
@@ -132,9 +132,9 @@
   octave_value hermitian (void) const
     { return octave_value (matrix.hermitian ()); }
 
-  void increment (void) { matrix += 1.0; }
+  void increment (void) { matrix += Complex (1.0); }
 
-  void decrement (void) { matrix -= 1.0; }
+  void decrement (void) { matrix -= Complex (1.0); }
 
   void print (ostream& os, bool pr_as_read_syntax = false) const;
 
--- a/src/ov-re-mat.cc
+++ b/src/ov-re-mat.cc
@@ -110,7 +110,9 @@
   return retval;
 }
 
+#if !defined (NO_EXTERN_TEMPLATE_DECLS)
 extern void assign (Array2<double>&, const Array2<double>&);
+#endif
 
 void
 octave_matrix::assign (const octave_value_list& idx, const Matrix& rhs)
--- a/src/ov-str-mat.cc
+++ b/src/ov-str-mat.cc
@@ -94,7 +94,9 @@
   return retval;
 }
 
+#if !defined (NO_EXTERN_TEMPLATE_DECLS)
 extern void assign (Array2<char>&, const Array2<char>&);
+#endif
 
 void
 octave_char_matrix_str::assign (const octave_value_list& idx,
--- a/src/pt-decl.cc
+++ b/src/pt-decl.cc
@@ -95,13 +95,14 @@
     {
       id->link_to_global ();
 
-      tree_expression *expr = elt.expression ();
+      octave_lvalue ult = id->lvalue ();
 
-      if (expr)
+      if (ult.is_undefined ())
 	{
-	  octave_value init_val = expr->rvalue ();
+	  tree_expression *expr = elt.expression ();
 
-	  octave_lvalue ult = id->lvalue ();
+	  octave_value init_val = expr
+	    ? expr->rvalue () : octave_value (Matrix ());
 
 	  ult.assign (octave_value::asn_eq, init_val);
 	}
--- 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.0"
+#define OCTAVE_VERSION "2.1.3"
 
 #define OCTAVE_COPYRIGHT \
   "Copyright (C) 1996, 1997 John W. Eaton."