changeset 9549:ed34b1da0e26

zero matrix assignment fix
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 19 Aug 2009 16:24:33 +0200
parents e5f7aee2ab8c
children 3d6a9aea2aea
files liboctave/Array-util.cc liboctave/ChangeLog
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/Array-util.cc	Wed Aug 19 15:54:31 2009 +0200
+++ b/liboctave/Array-util.cc	Wed Aug 19 16:24:33 2009 +0200
@@ -455,6 +455,12 @@
       rdv(0) = rhdv(0);
       rdv(1) = rhdv(1);
     }
+  else if (rhdv.length () == 2
+           && ! i.is_scalar () && ! j.is_scalar ())
+    {
+      rdv(0) = icol ? rhdv(0) : i.extent (0);
+      rdv(1) = jcol ? rhdv(1) : j.extent (0);
+    }
   else
     {
       dim_vector rhdv0 = rhdv;
--- a/liboctave/ChangeLog	Wed Aug 19 15:54:31 2009 +0200
+++ b/liboctave/ChangeLog	Wed Aug 19 16:24:33 2009 +0200
@@ -1,3 +1,7 @@
+2009-08-19  Jaroslav Hajek  <highegg@gmail.com>
+
+	* Array-util.cc (zero_dims_inquire): Add matching ndims case.
+
 2009-08-19  Jaroslav Hajek  <highegg@gmail.com>
 
 	* MArrayN.cc (operator+=, operator-=): Test matching dimensions first.