comparison src/pr-output.cc @ 3928:e8627dc4bdf2

[project @ 2002-05-03 19:56:01 by jwe]
author jwe
date Fri, 03 May 2002 19:56:02 +0000
parents 7ed917c1ca60
children f9ea3dcf58ee
comparison
equal deleted inserted replaced
3927:e7ad1397d67b 3928:e8627dc4bdf2
36 36
37 #include "CMatrix.h" 37 #include "CMatrix.h"
38 #include "Range.h" 38 #include "Range.h"
39 #include "cmd-edit.h" 39 #include "cmd-edit.h"
40 #include "dMatrix.h" 40 #include "dMatrix.h"
41 #include "Cell.h"
41 #include "lo-mappers.h" 42 #include "lo-mappers.h"
42 #include "mach-info.h" 43 #include "mach-info.h"
43 #include "oct-cmplx.h" 44 #include "oct-cmplx.h"
44 #include "str-vec.h" 45 #include "str-vec.h"
45 46
1752 { 1753 {
1753 os << "sorry, printing char matrices not implemented yet\n"; 1754 os << "sorry, printing char matrices not implemented yet\n";
1754 } 1755 }
1755 } 1756 }
1756 1757
1758 void
1759 octave_print_internal (std::ostream& os, const Cell& cell_val,
1760 bool pr_as_read_syntax, int extra_indent)
1761 {
1762 int nr = cell_val.rows ();
1763 int nc = cell_val.columns();
1764
1765 if (nr > 0 && nc > 0)
1766 {
1767 os << "{\n";
1768
1769 for (int j = 0; j < nc; j++)
1770 {
1771 for (int i = 0; i < nr; i++)
1772 {
1773 std::ostrstream buf;
1774 buf << "[" << i+1 << "," << j+1 << "]" << std::ends;
1775 const char *nm = buf.str ();
1776
1777 octave_value val = cell_val(i,j);
1778
1779 val.print_with_name (os, nm);
1780
1781 delete [] nm;
1782 }
1783 }
1784
1785 os << "}";
1786 }
1787 else
1788 os << "{}";
1789 }
1790
1757 DEFUN (disp, args, nargout, 1791 DEFUN (disp, args, nargout,
1758 "-*- texinfo -*-\n\ 1792 "-*- texinfo -*-\n\
1759 @deftypefn {Built-in Function} {} disp (@var{x})\n\ 1793 @deftypefn {Built-in Function} {} disp (@var{x})\n\
1760 Display the value of @var{x}. For example,\n\ 1794 Display the value of @var{x}. For example,\n\
1761 \n\ 1795 \n\