changeset 4437:0a59e4de215e

[project @ 2003-06-24 19:28:48 by jwe]
author jwe
date Tue, 24 Jun 2003 19:28:48 +0000
parents 689f730954b3
children 4cc739e3cbd8
files liboctave/Array2-idx.h liboctave/ChangeLog src/ChangeLog src/pt-mat.cc src/variables.cc
diffstat 5 files changed, 29 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/Array2-idx.h	Tue Jun 24 13:00:12 2003 +0000
+++ b/liboctave/Array2-idx.h	Tue Jun 24 19:28:48 2003 +0000
@@ -74,7 +74,7 @@
       // Fast magic colon processing.
 
       int result_nr = nr * nc;
-      int result_nc = result_nr ? 1 : 0;
+      int result_nc = 1;
 
       retval = Array2<T> (*this, result_nr, result_nc);
     }
--- a/liboctave/ChangeLog	Tue Jun 24 13:00:12 2003 +0000
+++ b/liboctave/ChangeLog	Tue Jun 24 19:28:48 2003 +0000
@@ -1,3 +1,8 @@
+2003-06-24  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* Array2-idx.h (Array2<T>::index (idx_vector&, int, const T&)):
+	Magic colon indexing always produces an object with one column.
+
 2003-06-21  Paul Kienzle <pkienzle@users.sf.net>
 
 	* kpse-xfns.h (NAME_BEGINS_WITH_DEVICE): Arg is std::string, not char*.
--- a/src/ChangeLog	Tue Jun 24 13:00:12 2003 +0000
+++ b/src/ChangeLog	Tue Jun 24 19:28:48 2003 +0000
@@ -1,5 +1,11 @@
 2003-06-24  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
+	* pt-mat.cc (tm_row_const::init, tm_const::init): Don't ignore
+	empty matrices that have one non-zero dimension.
+
+	* variables.cc (symbol_exist): Use dir_path::find_first_of to
+	search for .oct and .m files.
+
 	* ov-base.cc (octave_base_value::subsasgn): Also allow type
 	conversion for empty numeric objects with more than one index.
 	* ov-base-mat.cc (octave_base_matrix<T>::subsasgn): Likewise.
--- a/src/pt-mat.cc	Tue Jun 24 13:00:12 2003 +0000
+++ b/src/pt-mat.cc	Tue Jun 24 19:28:48 2003 +0000
@@ -189,7 +189,7 @@
 	  int this_elt_nr = tmp.rows ();
 	  int this_elt_nc = tmp.columns ();
 
-	  if (this_elt_nr == 0 || this_elt_nc == 0)
+	  if (this_elt_nr == 0 && this_elt_nc == 0)
 	    {
 	      if (Vempty_list_elements_ok < 0)
 		eval_warning ("empty matrix found in matrix list",
@@ -358,7 +358,7 @@
 	  int this_elt_nr = elt.rows ();
 	  int this_elt_nc = elt.cols ();
 
-	  if (this_elt_nr == 0 || this_elt_nc == 0)
+	  if (this_elt_nr == 0 && this_elt_nc == 0)
 	    {
 	      if (Vempty_list_elements_ok < 0)
 		warning ("empty matrix found in matrix list");
--- a/src/variables.cc	Tue Jun 24 13:00:12 2003 +0000
+++ b/src/variables.cc	Tue Jun 24 19:28:48 2003 +0000
@@ -603,21 +603,24 @@
 
   if (! retval)
     {
-      std::string file_name = fcn_file_in_path (name);
+      string_vector names (2);
 
-      if ((type == "any" || type == "file") && ! file_name.empty ())
-	{
-	  retval = 2;
-	}
-    }
+      names(0) = name + ".oct";
+      names(1) = name + ".m";
+
+      std::string file_name = Vload_path_dir_path.find_first_of (names);
+
+      size_t len = file_name.length ();
 
-  if (! retval)
-    {
-      std::string file_name = oct_file_in_path (name);
-
-      if ((type == "any" || type == "file") && ! file_name.empty ())
+      if (! file_name.empty ())
 	{
-	  retval = 3;
+	  if (type == "any" || type == "file")
+	    {
+	      if (file_name.substr (len-4) == ".oct")
+		retval = 3;
+	      else
+		retval = 2;
+	    }
 	}
     }