changeset 12741:324c4d80fb99

maint: periodic merge of stable to default
author John W. Eaton <jwe@octave.org>
date Tue, 14 Jun 2011 15:38:00 -0400
parents 8665c7957fdc (current diff) 0fe2eb81e6d0 (diff)
children fbf4ec3aff6f
files NEWS build-aux/diff-template
diffstat 4 files changed, 43 insertions(+), 81 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Fri Jun 10 18:14:03 2011 -0400
+++ b/Makefile.am	Tue Jun 14 15:38:00 2011 -0400
@@ -87,7 +87,9 @@
 
 CLEANFILES = $(bin_PROGRAMS) $(bin_SCRIPTS) $(BUILT_SOURCES)
 
-DISTCLEANFILES = $(INFO_FILES) ChangeLog .gdbinit 
+DISTCLEANFILES = .gdbinit 
+
+MAINTAINERCLEANFILES = $(BUILT_DISTFILES)
 
 CONFIG_FILES = @ac_config_headers@ @ac_config_files@
 
@@ -110,9 +112,10 @@
 	chmod a+rx "$@"
 
 .gdbinit: etc/gdbinit
-	if [ -f .gdbinit ]; then \
+	@if [ -f .gdbinit ]; then \
 	  echo "refusing to overwrite .gdbinit with newer version from $<" 1>&2; \
 	else \
+	  echo "Installing .gdbinit from version at $<" ; \
 	  cp $< $@; \
 	fi
 
@@ -121,7 +124,7 @@
 .PHONY: AUTHORS BUGS INSTALL.OCTAVE
 
 ChangeLog:
-	(cd $(srcdir); hg log --style=changelog.tmpl --prune=b0e60ad4ae26 --only-branch=`hg branch`; echo ""; echo "See the files in the directory etc/OLD-ChangeLogs for changes before 2011-04-19") > $@.t
+	(cd $(srcdir); hg log --style=build-aux/changelog.tmpl --prune=b0e60ad4ae26 --only-branch=`hg branch`; echo ""; echo "See the files in the directory etc/OLD-ChangeLogs for changes before 2011-04-19") > $@.t
 	mv $@.t $@
 .PHONY: ChangeLog
 
--- a/NEWS	Fri Jun 10 18:14:03 2011 -0400
+++ b/NEWS	Tue Jun 14 15:38:00 2011 -0400
@@ -81,6 +81,12 @@
  ** The logistic_regression_derivatives and logistic_regression_likelihood
     functions are now private.
 
+ ** ChangeLog files in the Octave sources are no longer maintained
+    by hand.  Instead, there is a single ChangeLog file generated from
+    the Mercurial version control commit messages.  Older ChangeLog
+    information can be found in the etc/OLD-ChangeLogs directory in the
+    source distribution.
+
 Summary of important user-visible changes for version 3.4:
 ---------------------------------------------------------
 
--- a/build-aux/diff-template	Fri Jun 10 18:14:03 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-#!/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@octave.org
-
-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
-
-echo 'removing the bsd-math directory'
-rm -rf bsd-math
-
-echo 'creating libcruft/slatec-fn directory'
-mkdir libcruft/slatec-fn
-
-echo 'removing old test files'
-rm -f test/octave.test/index.exp
-rm -f test/octave.test/prefer.exp
-rm -f test/octave.test/zero-one.exp
-
-echo 'creating directories for new test files'
-mkdir test/octave.test/index/dfi-f
-mkdir test/octave.test/index/dfi-t
-mkdir test/octave.test/prefer
-mkdir test/octave.test/zero-one/fff
-mkdir test/octave.test/zero-one/fft
-mkdir test/octave.test/zero-one/ftf
-mkdir test/octave.test/zero-one/tff
-mkdir test/octave.test/zero-one/ftt
-mkdir test/octave.test/zero-one/tft
-mkdir test/octave.test/zero-one/ttf
-mkdir test/octave.test/zero-one/ttt
-
-echo 'patching existing files'
-patch -p1 << \PATCH_EOF
-PATCH_EOF
--- a/src/DLD-FUNCTIONS/str2double.cc	Fri Jun 10 18:14:03 2011 -0400
+++ b/src/DLD-FUNCTIONS/str2double.cc	Tue Jun 14 15:38:00 2011 -0400
@@ -254,31 +254,39 @@
 {
   octave_value retval;
 
-  if (args.length () == 1)
+  if (args.length () != 1)
+    print_usage ();
+  else if (args(0).is_string ())
     {
-      if (args(0).is_string ())
+      if (args(0).rows () == 1 && args(0).ndims () == 2)
         {
-          if (args(0).rows () == 1 && args(0).ndims () == 2)
-            {
-              retval = str2double1 (args(0).string_value ());
-            }
-          else
-            {
-              const string_vector sv = args(0).all_strings ();
-              if (! error_state)
-                retval = sv.map<Complex> (str2double1);
-            }
-        }
-      else if (args(0).is_cellstr ())
-        {
-          Array<std::string> sa = args(0).cellstr_value ();
-          retval = sa.map<Complex> (str2double1);
+          retval = str2double1 (args(0).string_value ());
         }
       else
-        gripe_wrong_type_arg ("str2double", args(0));
+        {
+          const string_vector sv = args(0).all_strings ();
+          if (! error_state)
+            retval = sv.map<Complex> (str2double1);
+        }
+    }
+  else if (args(0).is_cell ())
+    {
+      const Cell cell = args(0).cell_value (); 
+
+      if (! error_state)
+      {
+        ComplexNDArray output (cell.dims (), octave_NaN);
+        for (octave_idx_type i = 0; i < cell.numel (); i++)
+        {
+          if (cell(i).is_string ())
+            output(i) = str2double1 (cell(i).string_value ());
+        }
+        retval = output;
+      }
     }
   else
-    print_usage ();
+    retval = NDArray (args(0).dims (), octave_NaN);
+  
 
   return retval;
 }
@@ -296,6 +304,7 @@
 %!assert (str2double ("1e-3 + i*.25"), 1e-3 + 0.25i)
 %!assert (str2double (["2 + j";"1.25e-3";"-05"]), [2+i; 1.25e-3; -5])
 %!assert (str2double ({"2 + j","1.25e-3","-05"}), [2+i, 1.25e-3, -5])
+%!assert (str2double (1), NaN)
 %!assert (str2double ("Hello World"), NaN)
 %!assert (str2double ("NaN"), NaN)
 %!assert (str2double ("NA"), NA)
@@ -305,5 +314,8 @@
 %!assert (str2double ("NaN + Inf*i"), complex (NaN, Inf))
 %!assert (str2double ("Inf - Inf*i"), complex (Inf, -Inf))
 %!assert (str2double ("-i*NaN - Inf"), complex (-Inf, -NaN))
+%!assert (str2double ({"abc", "4i"}), [NaN + 0i, 4i])
+%!assert (str2double ({2, "4i"}), [NaN + 0i, 4i])
+%!assert (str2double (zeros(3,1,2)), NaN (3,1,2))
 
 */