diff src/ov-re-mat.cc @ 2901:e6d25bc478dd

[project @ 1997-04-30 03:41:26 by jwe]
author jwe
date Wed, 30 Apr 1997 03:43:29 +0000
parents 8b262e771614
children 057273789b87
line wrap: on
line diff
--- a/src/ov-re-mat.cc	Wed Apr 30 03:37:00 1997 +0000
+++ b/src/ov-re-mat.cc	Wed Apr 30 03:43:29 1997 +0000
@@ -28,6 +28,8 @@
 #include <config.h>
 #endif
 
+#include <iostream.h>
+
 #include "lo-ieee.h"
 #include "lo-utils.h"
 #include "mx-base.h"
@@ -259,9 +261,41 @@
 }
 
 void
-octave_matrix::print (ostream& os, bool pr_as_read_syntax)
+octave_matrix::print (ostream& os, bool pr_as_read_syntax) const
+{
+  indent (os);
+  print_raw (os, pr_as_read_syntax);
+  newline (os);
+}
+
+void
+octave_matrix::print_raw (ostream& os, bool pr_as_read_syntax) const
+{
+  octave_print_internal (os, matrix, pr_as_read_syntax,
+			 current_print_indent_level ());
+}
+
+bool
+octave_matrix::print_name_tag (ostream& os, const string& name) const
 {
-  octave_print_internal (os, matrix, pr_as_read_syntax, struct_indent);
+  bool retval = false;
+
+  int nr = rows ();
+  int nc = columns ();
+
+  indent (os);
+
+  if (nr == 1 && nc == 1 || (nr == 0 || nc == 0))
+    os << name << " = ";
+  else
+    {
+      os << name << " =";
+      newline (os);
+      newline (os);
+      retval = true;
+    }
+
+  return retval;
 }
 
 /*