Mercurial > hg > octave-nkf
diff 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 |
line wrap: on
line diff
--- a/src/pr-output.cc +++ b/src/pr-output.cc @@ -38,6 +38,7 @@ #include "Range.h" #include "cmd-edit.h" #include "dMatrix.h" +#include "Cell.h" #include "lo-mappers.h" #include "mach-info.h" #include "oct-cmplx.h" @@ -1754,6 +1755,39 @@ } } +void +octave_print_internal (std::ostream& os, const Cell& cell_val, + bool pr_as_read_syntax, int extra_indent) +{ + int nr = cell_val.rows (); + int nc = cell_val.columns(); + + if (nr > 0 && nc > 0) + { + os << "{\n"; + + for (int j = 0; j < nc; j++) + { + for (int i = 0; i < nr; i++) + { + std::ostrstream buf; + buf << "[" << i+1 << "," << j+1 << "]" << std::ends; + const char *nm = buf.str (); + + octave_value val = cell_val(i,j); + + val.print_with_name (os, nm); + + delete [] nm; + } + } + + os << "}"; + } + else + os << "{}"; +} + DEFUN (disp, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} disp (@var{x})\n\