diff src/ov-complex.h @ 4749:a4bc7156bd60

[project @ 2004-02-07 16:59:28 by jwe]
author jwe
date Sat, 07 Feb 2004 16:59:28 +0000
parents e95c86d48732
children c638c144d4da
line wrap: on
line diff
--- a/src/ov-complex.h
+++ b/src/ov-complex.h
@@ -38,6 +38,7 @@
 
 #include "error.h"
 #include "ov-base.h"
+#include "ov-cx-mat.h"
 #include "ov-base-scalar.h"
 #include "ov-typeinfo.h"
 
@@ -65,7 +66,13 @@
   ~octave_complex (void) { }
 
   octave_value *clone (void) const { return new octave_complex (*this); }
-  octave_value *empty_clone (void) const { return new octave_complex (); }
+
+  // We return an octave_complex_matrix object here instead of an
+  // octave_complex object so that in expressions like A(2,2,2) = 2
+  // (for A previously undefined), A will be empty instead of a 1x1
+  // object.
+  octave_value *empty_clone (void) const
+    { return new octave_complex_matrix (); }
 
   octave_value *try_narrowing_conversion (void);