changeset 3726:b7d997d593d9

[project @ 2000-10-27 17:51:21 by jwe]
author jwe
date Fri, 27 Oct 2000 17:51:27 +0000
parents 7d2d642cbb53
children e6d0041aedf3
files ChangeLog Makeconf.in autogen.sh configure.in liboctave/CMatrix.cc liboctave/ChangeLog liboctave/dMatrix.cc src/ChangeLog src/Makefile.in src/oct-conf.h.in src/parse.y src/toplev.cc test/octave.test/arith/arith.exp test/octave.test/arith/cumprod-4.m test/octave.test/arith/cumsum-4.m test/octave.test/arith/prod-4.m test/octave.test/arith/sum-4.m test/octave.test/arith/sumsq-4.m
diffstat 18 files changed, 79 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Oct 12 16:14:00 2000 +0000
+++ b/ChangeLog	Fri Oct 27 17:51:27 2000 +0000
@@ -1,3 +1,12 @@
+2000-10-27  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* autogen.sh: Don't run configure.
+
+	* configure.in (SPECIAL_MATH_LIB): Delete code related to this var.
+	* Makeconf.in: Ditto.
+	(BLAS_LIBS, LIBS): Substitute here.
+	(do-subst-config-vals): Put BLAS_LIBS in oct-conf.h.
+
 2000-07-20  Joao Cardoso  <jcardoso@inescn.pt>
 
 	* configure.in: (LD_CXX): Define and substitute.
--- a/Makeconf.in	Thu Oct 12 16:14:00 2000 +0000
+++ b/Makeconf.in	Fri Oct 27 17:51:27 2000 +0000
@@ -147,7 +147,9 @@
 LIBOCTINTERP = @LIBOCTINTERP@
 LIBOCTAVE = @LIBOCTAVE@
 LIBCRUFT = @LIBCRUFT@
-SPECIAL_MATH_LIB = @SPECIAL_MATH_LIB@
+
+BLAS_LIBS = @BLAS_LIBS@
+LIBS = @LIBS@
 
 # The arguments passed to configure.
 config_opts = @config_opts@
@@ -332,6 +334,7 @@
   -e "s;%OCTAVE_CONF_ALL_LDFLAGS%;\"${ALL_LDFLAGS}\";" \
   -e "s;%OCTAVE_CONF_AR%;\"${AR}\";" \
   -e "s;%OCTAVE_CONF_ARFLAGS%;\"${ARFLAGS}\";" \
+  -e "s;%OCTAVE_CONF_BLAS_LIBS%;\"${BLAS_LIBS}\";" \
   -e "s;%OCTAVE_CONF_CC%;\"${CC}\";" \
   -e "s;%OCTAVE_CONF_CC_VERSION%;\"${CC_VERSION}\";" \
   -e "s;%OCTAVE_CONF_CFLAGS%;\"${CFLAGS}\";" \
@@ -384,7 +387,6 @@
   -e "s;%OCTAVE_CONF_SH_LD%;\"${SH_LD}\";" \
   -e "s;%OCTAVE_CONF_SH_LDFLAGS%;\"${SH_LDFLAGS}\";" \
   -e "s;%OCTAVE_CONF_SONAME_FLAGS%;\"${SONAME_FLAGS}\";" \
-  -e "s;%OCTAVE_CONF_SPECIAL_MATH_LIB%;\"${SPECIAL_MATH_LIB}\";" \
   -e "s;%OCTAVE_CONF_STATIC_LIBS%;\"${STATIC_LIBS}\";" \
   -e "s;%OCTAVE_CONF_TERMLIBS%;\"${TERMLIBS}\";" \
   -e "s;%OCTAVE_CONF_UGLY_DEFS%;\"${UGLY_DEFS}\";" \
--- a/autogen.sh	Thu Oct 12 16:14:00 2000 +0000
+++ b/autogen.sh	Fri Oct 27 17:51:27 2000 +0000
@@ -29,9 +29,7 @@
     autoheader
 ); done
 
-echo Done.cc
-
-./configure "$@"
+echo done
 
 if [ -f cvs.motd ]; then
   echo "ATTENTION CVS Users!"
--- a/configure.in	Thu Oct 12 16:14:00 2000 +0000
+++ b/configure.in	Fri Oct 27 17:51:27 2000 +0000
@@ -21,7 +21,7 @@
 ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 ### 02111-1307, USA. 
 
-AC_REVISION($Revision: 1.334 $)
+AC_REVISION($Revision: 1.335 $)
 AC_PREREQ(2.9)
 AC_INIT(src/octave.cc)
 AC_CONFIG_HEADER(config.h)
@@ -806,13 +806,6 @@
 AC_CHECK_LIB(sun, getpwnam)
 AC_CHECK_LIB(socket, gethostname)
 
-case "$canonical_host_type" in
-  alpha*-dec-osf*)
-    AC_CHECK_LIB(dxml, dgemm_, [SPECIAL_MATH_LIB=-ldxml])
-  ;;
-esac
-AC_SUBST(SPECIAL_MATH_LIB)
-
 ### How big are ints and how are they oriented?  These could probably
 ### be eliminated in favor of run-time checks.
 
--- a/liboctave/CMatrix.cc	Thu Oct 12 16:14:00 2000 +0000
+++ b/liboctave/CMatrix.cc	Fri Oct 27 17:51:27 2000 +0000
@@ -2331,10 +2331,10 @@
 	{
 	  for (int i = 0; i < nr; i++)
 	    {
-	      Complex prod = elem (0, 0);
+	      Complex prod = elem (i, 0);
 	      for (int j = 0; j < nc; j++)
 		{
-		  retval.elem (0, j) = prod;
+		  retval.elem (i, j) = prod;
 		  if (j < nc - 1)
 		    prod *= elem (i, j+1);
 		}
@@ -2369,7 +2369,7 @@
 	{
 	  for (int i = 0; i < nr; i++)
 	    {
-	      Complex sum = elem (0, 0);
+	      Complex sum = elem (i, 0);
 	      for (int j = 0; j < nc; j++)
 		{
 		  retval.elem (i, j) = sum;
--- a/liboctave/ChangeLog	Thu Oct 12 16:14:00 2000 +0000
+++ b/liboctave/ChangeLog	Fri Oct 27 17:51:27 2000 +0000
@@ -1,3 +1,9 @@
+2000-10-18  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* CMatrix.cc (ComplexMatrix::cumsum, ComplexMatrix::cumprod):
+	Correct indexing for operation across rows.
+	* dMatrix.cc (Matrix::cumsum, Matrix::cumprod): Likewise.
+
 2000-10-12  Paul Kienzle  <pkienzle@kienzle.powernet.co.uk>
 
 	* Array2-idx.h (Array2<T>::index (idx_vector&)): Avoid copying
--- a/liboctave/dMatrix.cc	Thu Oct 12 16:14:00 2000 +0000
+++ b/liboctave/dMatrix.cc	Fri Oct 27 17:51:27 2000 +0000
@@ -1888,7 +1888,7 @@
 	      double prod = elem (i, 0);
 	      for (int j = 0; j < nc; j++)
 		{
-		  retval.elem (0, j) = prod;
+		  retval.elem (i, j) = prod;
 		  if (j < nc - 1)
 		    prod *= elem (i, j+1);
 		}
--- a/src/ChangeLog	Thu Oct 12 16:14:00 2000 +0000
+++ b/src/ChangeLog	Fri Oct 27 17:51:27 2000 +0000
@@ -1,3 +1,16 @@
+2000-10-27  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* Makefile.in (ops.cc): Don't substitute BLAS_LIBS and LIBS here.
+
+	* oct-conf.h.in (OCTAVE_CONF_SPECIAL_MATH_LIB): Delete.
+	(OCTAVE_CONF_BLAS_LIBS): Add.
+	* toplev.cc (octave_config_info): Likewise, add BLAS_LIBS and
+	remove SPECIAL_MATH_LIB from the struct.
+
+	* parse.y (feval (const octave_value_list&, int)): Don't panic
+	while processing arg names if arg.length() and arg_names.length()
+	differ.
+
 2000-10-12  Paul Kienzle  <pkienzle@kienzle.powernet.co.uk>
 
 	* ov-cell.h (octave_cell::is_cell): New function.
--- a/src/Makefile.in	Thu Oct 12 16:14:00 2000 +0000
+++ b/src/Makefile.in	Fri Oct 27 17:51:27 2000 +0000
@@ -190,9 +190,6 @@
 OCTAVE_LIBS = $(LIBOCTINTERP) $(LIBOCTAVE) $(SPECIAL_MATH_LIB) $(LIBCRUFT) \
   $(LIBPLPLOT) $(LIBREADLINE) $(LIBKPATHSEA) $(LIBGLOB) $(LIBDLFCN)
 
-BLAS_LIBS = @BLAS_LIBS@
-LIBS = @LIBS@
-
 DISTFILES = Makefile.in ChangeLog mkdefs mkops mkgendoc \
 	DOCSTRINGS mkbuiltins mk-oct-links \
 	defaults.h.in oct-conf.h.in octave.gperf oct-gperf.h \
--- a/src/oct-conf.h.in	Thu Oct 12 16:14:00 2000 +0000
+++ b/src/oct-conf.h.in	Fri Oct 27 17:51:27 2000 +0000
@@ -48,6 +48,10 @@
 #define OCTAVE_CONF_AR %OCTAVE_CONF_AR%
 #endif
 
+#ifndef OCTAVE_CONF_BLAS_LIBS
+#define OCTAVE_CONF_BLAS_LIBS %OCTAVE_CONF_BLAS_LIBS%
+#endif
+
 #ifndef OCTAVE_CONF_CC
 #define OCTAVE_CONF_CC %OCTAVE_CONF_CC%
 #endif
@@ -260,10 +264,6 @@
 #define OCTAVE_CONF_SONAME_FLAGS %OCTAVE_CONF_SONAME_FLAGS%
 #endif
 
-#ifndef OCTAVE_CONF_SPECIAL_MATH_LIB
-#define OCTAVE_CONF_SPECIAL_MATH_LIB %OCTAVE_CONF_SPECIAL_MATH_LIB%
-#endif
-
 #ifndef OCTAVE_CONF_STATIC_LIBS
 #define OCTAVE_CONF_STATIC_LIBS %OCTAVE_CONF_STATIC_LIBS%
 #endif
--- a/src/parse.y	Thu Oct 12 16:14:00 2000 +0000
+++ b/src/parse.y	Fri Oct 27 17:51:27 2000 +0000
@@ -3253,6 +3253,11 @@
   return retval;
 }
 
+// Evaluate an Octave function (built-in or interpreted) and return
+// the list of result values.  the results.  NAME is the name of the
+// function to call.  ARGS are the arguments to the function.  NARGOUT
+// is the number of output arguments expected.
+
 octave_value_list
 feval (const std::string& name, const octave_value_list& args, int nargout)
 {
@@ -3266,6 +3271,12 @@
   return retval;
 }
 
+// Evaluate an Octave function (built-in or interpreted) and return
+// the list of result values.  The first element of ARGS should be a
+// string containing the name of the function to call, then the rest
+// are the actual arguments to the function.  NARGOUT is the number of
+// output arguments expected.
+
 octave_value_list
 feval (const octave_value_list& args, int nargout)
 {
@@ -3288,11 +3299,16 @@
 
 	  if (! arg_names.empty ())
 	    {
-	      assert (arg_names.length () == tmp_nargin + 1);
-
-	      string_vector tmp_arg_names (tmp_nargin);
-
-	      for (int i = 0; i < tmp_nargin; i++)
+	      // tmp_nargin and arg_names.length () - 1 may differ if
+	      // we are passed all_va_args.
+
+	      int n = arg_names.length () - 1;
+
+	      int len = n > tmp_nargin ? tmp_nargin : n;
+
+	      string_vector tmp_arg_names (len);
+
+	      for (int i = 0; i < len; i++)
 		tmp_arg_names(i) = arg_names(i+1);
 
 	      tmp_args.stash_name_tags (tmp_arg_names);
--- a/src/toplev.cc	Thu Oct 12 16:14:00 2000 +0000
+++ b/src/toplev.cc	Fri Oct 27 17:51:27 2000 +0000
@@ -612,6 +612,7 @@
   m ["ALL_LDFLAGS"] = OCTAVE_CONF_ALL_LDFLAGS;
   m ["AR"] = OCTAVE_CONF_AR;
   m ["ARFLAGS"] = OCTAVE_CONF_ARFLAGS;
+  m ["BLAS_LIBS"] = OCTAVE_CONF_BLAS_LIBS;
   m ["CC"] = OCTAVE_CONF_CC;
   m ["CC_VERSION"] = OCTAVE_CONF_CC_VERSION;
   m ["CFLAGS"] = OCTAVE_CONF_CFLAGS;
@@ -664,7 +665,6 @@
   m ["SH_LD"] = OCTAVE_CONF_SH_LD;
   m ["SH_LDFLAGS"] = OCTAVE_CONF_SH_LDFLAGS;
   m ["SONAME_FLAGS"] = OCTAVE_CONF_SONAME_FLAGS;
-  m ["SPECIAL_MATH_LIB"] = OCTAVE_CONF_SPECIAL_MATH_LIB;
   m ["STATIC_LIBS"] = OCTAVE_CONF_STATIC_LIBS;
   m ["TERMLIBS"] = OCTAVE_CONF_TERMLIBS;
   m ["UGLY_DEFS"] = OCTAVE_CONF_DEFS;
--- a/test/octave.test/arith/arith.exp	Thu Oct 12 16:14:00 2000 +0000
+++ b/test/octave.test/arith/arith.exp	Fri Oct 27 17:51:27 2000 +0000
@@ -717,7 +717,7 @@
 do_test sum-3.m
 
 set test sum-4
-set prog_output "\n... sum:.*"
+set prog_output "ans = 1"
 do_test sum-4.m
 
 set test prod-1
@@ -733,7 +733,7 @@
 do_test prod-3.m
 
 set test prod-4
-set prog_output "\n... prod:.*"
+set prog_output "ans = 1"
 do_test prod-4.m
 
 set test cumsum-1
@@ -749,7 +749,7 @@
 do_test cumsum-3.m
 
 set test cumsum-4
-set prog_output "\n... cumsum:.*"
+set prog_output "ans = 1"
 do_test cumsum-4.m
 
 set test cumprod-1
@@ -765,7 +765,7 @@
 do_test cumprod-3.m
 
 set test cumprod-4
-set prog_output "\n... cumprod:.*"
+set prog_output "ans = 1"
 do_test cumprod-4.m
 
 set test sumsq-1
@@ -781,7 +781,7 @@
 do_test sumsq-3.m
 
 set test sumsq-4
-set prog_output "\n... sumsq:.*"
+set prog_output "ans = 1"
 do_test sumsq-4.m
 
 set test bincoeff-1
--- a/test/octave.test/arith/cumprod-4.m	Thu Oct 12 16:14:00 2000 +0000
+++ b/test/octave.test/arith/cumprod-4.m	Fri Oct 27 17:51:27 2000 +0000
@@ -1,1 +1,2 @@
-cumprod (1, 2)
+(all (cumprod ([2, 3; 4, 5], 1) == [2, 3; 8, 15])
+ && all (cumprod ([2, 3; 4, 5], 2) == [2, 6; 4, 20]))
--- a/test/octave.test/arith/cumsum-4.m	Thu Oct 12 16:14:00 2000 +0000
+++ b/test/octave.test/arith/cumsum-4.m	Fri Oct 27 17:51:27 2000 +0000
@@ -1,1 +1,2 @@
-cumsum (1, 2)
+(all (cumsum ([1, 2; 3, 4], 1) == [1, 2; 4, 6])
+ && all (cumsum ([1, 2; 3, 4], 2) == [1, 3; 3, 7]))
--- a/test/octave.test/arith/prod-4.m	Thu Oct 12 16:14:00 2000 +0000
+++ b/test/octave.test/arith/prod-4.m	Fri Oct 27 17:51:27 2000 +0000
@@ -1,1 +1,2 @@
-prod (1, 2)
+(all (prod ([1, 2; 3, 4], 1) == [3, 8])
+ && all (prod ([1, 2; 3, 4], 2) == [2; 12]))
--- a/test/octave.test/arith/sum-4.m	Thu Oct 12 16:14:00 2000 +0000
+++ b/test/octave.test/arith/sum-4.m	Fri Oct 27 17:51:27 2000 +0000
@@ -1,1 +1,2 @@
-sum (1, 2)
+(all (sum ([1, 2; 3, 4], 1) == [4, 6])
+ && all (sum ([1, 2; 3, 4], 2) == [3; 7]))
--- a/test/octave.test/arith/sumsq-4.m	Thu Oct 12 16:14:00 2000 +0000
+++ b/test/octave.test/arith/sumsq-4.m	Fri Oct 27 17:51:27 2000 +0000
@@ -1,1 +1,2 @@
-sumsq (1, 2)
+(all (sumsq ([1, 2; 3, 4], 1) == [10, 20])
+ && all (sumsq ([1, 2; 3, 4], 2) == [5; 25]))