Classes | Defines | Functions | Variables

pr-output.cc File Reference

#include <cfloat>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include "Array-util.h"
#include "CMatrix.h"
#include "Range.h"
#include "cmd-edit.h"
#include "dMatrix.h"
#include "lo-mappers.h"
#include "lo-math.h"
#include "mach-info.h"
#include "oct-cmplx.h"
#include "quit.h"
#include "str-vec.h"
#include "Cell.h"
#include "defun.h"
#include "error.h"
#include "gripes.h"
#include "oct-obj.h"
#include "oct-stream.h"
#include "pager.h"
#include "pr-output.h"
#include "sysdep.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
Include dependency graph for pr-output.cc:

Go to the source code of this file.

Classes

union  equiv
class  float_format
class  octave_print_conv< T >
class  pr_engineering_float
class  pr_formatted_float
class  pr_rational_float

Defines

#define INSTANTIATE_ABS(T)   template /* static */ T abs (T)
#define PRINT_CHAR_BITS(os, c)
#define PRINT_CHAR_BITS_SWAPPED(os, c)
#define PRINT_CONV(T1, T2)
#define PRINT_INT_ARRAY_INTERNAL(TYPE)
#define PRINT_INT_SCALAR_INTERNAL(TYPE)
#define SPECIALIZE_UABS(T)

Functions

template<class T >
abs (T x)
static int calc_scale_exp (const int &x)
static int current_output_max_field_width (void)
static int current_output_precision (void)
 DEFUN (rats, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rats (@var{x}, @var{len})\n\ Convert @var{x} into a rational approximation represented as a string.\n\ You can convert the string back into a matrix as follows:\n\ \n\ @example\n\ @group\n\ r = rats(hilb(4));\n\ x = str2num(r)\n\ @end group\n\ @end example\n\ \n\ The optional second argument defines the maximum length of the string\n\ representing the elements of @var{x}. By default @var{len} is 9.\n\ @seealso{format, rat}\n\ @end deftypefn")
 DEFUN (disp, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} disp (@var{x})\n\ Display the value of @var{x}. For example:\n\ \n\ @example\n\ @group\n\ disp (\"The value of pi is:\"), disp (pi)\n\ \n\ @print{} the value of pi is:\n\ @print{} 3.1416\n\ @end group\n\ @end example\n\ \n\ @noindent\n\ Note that the output from @code{disp} always ends with a newline.\n\ \n\ If an output value is requested, @code{disp} prints nothing and\n\ returns the formatted output in a string.\n\ @seealso{fdisp}\n\ @end deftypefn")
 DEFUN (fdisp, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} fdisp (@var{fid}, @var{x})\n\ Display the value of @var{x} on the stream @var{fid}. For example:\n\ \n\ @example\n\ @group\n\ fdisp (stdout, \"The value of pi is:\"), fdisp (stdout, pi)\n\ \n\ @print{} the value of pi is:\n\ @print{} 3.1416\n\ @end group\n\ @end example\n\ \n\ @noindent\n\ Note that the output from @code{fdisp} always ends with a newline.\n\ @seealso{disp}\n\ @end deftypefn")
 DEFUN (format, args,,"-*- texinfo -*-\n\ @deftypefn {Command} {} format\n\ @deftypefnx {Command} {} format options\n\ Reset or specify the format of the output produced by @code{disp} and\n\ Octave's normal echoing mechanism. This command only affects the display\n\ of numbers but not how they are stored or computed. To change the internal\n\ representation from the default double use one of the conversion functions\n\ such as @code{single}, @code{uint8}, @code{int64}, etc.\n\ \n\ By default, Octave displays 5 significant digits in a human readable form\n\ (option @samp{short} paired with @samp{loose} format for matrices).\n\ If @code{format} is invoked without any options, this default format\n\ is restored.\n\ \n\ Valid formats for floating point numbers are listed in the following\n\ table.\n\ \n\ @table @code\n\ @item short\n\ Fixed point format with 5 significant figures in a field that is a maximum\n\ of 10 characters wide. (default).\n\ \n\ If Octave is unable to format a matrix so that columns line up on the\n\ decimal point and all numbers fit within the maximum field width then\n\ it switches to an exponential @samp{e} format.\n\ \n\ @item long\n\ Fixed point format with 15 significant figures in a field that is a maximum\n\ of 20 characters wide.\n\ \n\ As with the @samp{short} format, Octave will switch to an exponential\n\ @samp{e} format if it is unable to format a matrix properly using the\n\ current format.\n\ \n\ @item short e\n\ @itemx long e\n\ Exponential format. The number to be represented is split between a mantissa\n\ and an exponent (power of 10). The mantissa has 5 significant digits in the\n\ short format and 15 digits in the long format.\n\ For example, with the @samp{short e} format, @code{pi} is displayed as\n\ @code{3.1416e+00}.\n\ \n\ @item short E\n\ @itemx long E\n\ Identical to @samp{short e} or @samp{long e} but displays an uppercase\n\ @samp{E} to indicate the exponent.\n\ For example, with the @samp{long E} format, @code{pi} is displayed as\n\ @code{3.14159265358979E+00}.\n\ \n\ @item short g\n\ @itemx long g\n\ Optimally choose between fixed point and exponential format based on\n\ the magnitude of the number.\n\ For example, with the @samp{short g} format,\n\ @code{pi .^ [2; 4; 8; 16; 32]} is displayed as\n\ \n\ @example\n\ @group\n\ ans =\n\ \n\ 9.8696\n\ 97.409\n\ 9488.5\n\ 9.0032e+07\n\ 8.1058e+15\n\ @end group\n\ @end example\n\ \n\ @item short eng\n\ @itemx long eng\n\ Identical to @samp{short e} or @samp{long e} but displays the value\n\ using an engineering format, where the exponent is divisible by 3. For\n\ example, with the @samp{short eng} format, @code{10 * pi} is displayed as\n\ @code{31.4159e+00}.\n\ \n\ @item long G\n\ @itemx short G\n\ Identical to @samp{short g} or @samp{long g} but displays an uppercase\n\ @samp{E} to indicate the exponent.\n\ \n\ @item free\n\ @itemx none\n\ Print output in free format, without trying to line up columns of\n\ matrices on the decimal point. This also causes complex numbers to be\n\ formatted as numeric pairs like this @samp{(0.60419, 0.60709)} instead\n\ of like this @samp{0.60419 + 0.60709i}.\n\ @end table\n\ \n\ The following formats affect all numeric output (floating point and\n\ integer types).\n\ \n\ @table @code\n\ @item +\n\ @itemx + @var{chars}\n\ @itemx plus\n\ @itemx plus @var{chars}\n\ Print a @samp{+} symbol for nonzero matrix elements and a space for zero\n\ matrix elements. This format can be very useful for examining the\n\ structure of a large sparse matrix.\n\ \n\ The optional argument @var{chars} specifies a list of 3 characters to use\n\ for printing values greater than zero, less than zero and equal to zero.\n\ For example, with the @samp{+ \"+-.\"} format, @code{[1, 0, -1; -1, 0, 1]}\n\ is displayed as\n\ \n\ @example\n\ @group\n\ ans =\n\ \n\ +.-\n\ -.+\n\ @end group\n\ @end example\n\ \n\ @item bank\n\ Print in a fixed format with two digits to the right of the decimal\n\ point.\n\ \n\ @item native-hex\n\ Print the hexadecimal representation of numbers as they are stored in\n\ memory. For example, on a workstation which stores 8 byte real values\n\ in IEEE format with the least significant byte first, the value of\n\ @code{pi} when printed in @code{native-hex} format is\n\ @code{400921fb54442d18}.\n\ \n\ @item hex\n\ The same as @code{native-hex}, but always print the most significant\n\ byte first.\n\ \n\ @item native-bit\n\ Print the bit representation of numbers as stored in memory.\n\ For example, the value of @code{pi} is\n\ \n\ @example\n\ @group\n\ 01000000000010010010000111111011\n\ 01010100010001000010110100011000\n\ @end group\n\ @end example\n\ \n\ (shown here in two 32 bit sections for typesetting purposes) when\n\ printed in native-bit format on a workstation which stores 8 byte real values\n\ in IEEE format with the least significant byte first.\n\ \n\ @item bit\n\ The same as @code{native-bit}, but always print the most significant\n\ bits first.\n\ \n\ @item rat\n\ Print a rational approximation, i.e., values are approximated\n\ as the ratio of small integers.\n\ For example, with the @samp{rat} format,\n\ @code{pi} is displayed as @code{355/113}.\n\ @end table\n\ \n\ The following two options affect the display of all matrices.\n\ \n\ @table @code\n\ @item compact\n\ Remove blank lines around column number labels and between\n\ matrices producing more compact output with more data per page.\n\ \n\ @item loose\n\ Insert blank lines above and below column number labels and between matrices\n\ to produce a more readable output with less data per page. (default).\n\ @end table\n\ @seealso{fixed_point_format, output_max_field_width, output_precision, split_long_rows, rats}\n\ @end deftypefn")
 DEFUN (fixed_point_format, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} fixed_point_format ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} fixed_point_format (@var{new_val})\n\ @deftypefnx {Built-in Function} {} fixed_point_format (@var{new_val}, \"local\")\n\ Query or set the internal variable that controls whether Octave will\n\ use a scaled format to print matrix values such that the largest\n\ element may be written with a single leading digit with the scaling\n\ factor is printed on the first line of output. For example:\n\ \n\ @example\n\ @group\n\ octave:1> logspace (1, 7, 5)'\n\ ans =\n\ \n\ 1.0e+07 *\n\ \n\ 0.00000\n\ 0.00003\n\ 0.00100\n\ 0.03162\n\ 1.00000\n\ @end group\n\ @end example\n\ \n\ @noindent\n\ Notice that first value appears to be zero when it is actually 1. For\n\ this reason, you should be careful when setting\n\ @code{fixed_point_format} to a nonzero value.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @seealso{format, output_max_field_width, output_precision}\n\ @end deftypefn")
 DEFUN (print_empty_dimensions, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} print_empty_dimensions ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} print_empty_dimensions (@var{new_val})\n\ @deftypefnx {Built-in Function} {} print_empty_dimensions (@var{new_val}, \"local\")\n\ Query or set the internal variable that controls whether the\n\ dimensions of empty matrices are printed along with the empty matrix\n\ symbol, @samp{[]}. For example, the expression\n\ \n\ @example\n\ zeros (3, 0)\n\ @end example\n\ \n\ @noindent\n\ will print\n\ \n\ @example\n\ ans = [](3x0)\n\ @end example\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @seealso{format}\n\ @end deftypefn")
 DEFUN (split_long_rows, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} split_long_rows ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} split_long_rows (@var{new_val})\n\ @deftypefnx {Built-in Function} {} split_long_rows (@var{new_val}, \"local\")\n\ Query or set the internal variable that controls whether rows of a matrix\n\ may be split when displayed to a terminal window. If the rows are split,\n\ Octave will display the matrix in a series of smaller pieces, each of\n\ which can fit within the limits of your terminal width and each set of\n\ rows is labeled so that you can easily see which columns are currently\n\ being displayed. For example:\n\ \n\ @example\n\ @group\n\ octave:13> rand (2,10)\n\ ans =\n\ \n\ Columns 1 through 6:\n\ \n\ 0.75883 0.93290 0.40064 0.43818 0.94958 0.16467\n\ 0.75697 0.51942 0.40031 0.61784 0.92309 0.40201\n\ \n\ Columns 7 through 10:\n\ \n\ 0.90174 0.11854 0.72313 0.73326\n\ 0.44672 0.94303 0.56564 0.82150\n\ @end group\n\ @end example\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @seealso{format}\n\ @end deftypefn")
 DEFUN (output_max_field_width, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} output_max_field_width ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} output_max_field_width (@var{new_val})\n\ @deftypefnx {Built-in Function} {} output_max_field_width (@var{new_val}, \"local\")\n\ Query or set the internal variable that specifies the maximum width\n\ of a numeric output field.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @seealso{format, fixed_point_format, output_precision}\n\ @end deftypefn")
 DEFUN (output_precision, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} output_precision ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} output_precision (@var{new_val})\n\ @deftypefnx {Built-in Function} {} output_precision (@var{new_val}, \"local\")\n\ Query or set the internal variable that specifies the minimum number of\n\ significant figures to display for numeric output.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @seealso{format, fixed_point_format, output_max_field_width}\n\ @end deftypefn")
static int engineering_exponent (const double &x)
static void init_format_state (void)
 INSTANTIATE_ABS (signed char)
 INSTANTIATE_ABS (short)
 INSTANTIATE_ABS (int)
 INSTANTIATE_ABS (long)
static int num_digits (const double &x)
void octave_print_internal (std::ostream &os, const Matrix &m, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &, const Cell &, bool, int, bool)
void octave_print_internal (std::ostream &os, double d, bool)
void octave_print_internal (std::ostream &os, const DiagMatrix &m, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const NDArray &nda, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const Complex &c, bool)
void octave_print_internal (std::ostream &os, const charNDArray &nda, bool pr_as_read_syntax, int extra_indent, bool pr_as_string)
void octave_print_internal (std::ostream &os, const ComplexMatrix &cm, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const ComplexDiagMatrix &cm, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const PermMatrix &m, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const Range &r, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const ComplexNDArray &nda, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, bool d, bool pr_as_read_syntax)
void octave_print_internal (std::ostream &os, float d, bool pr_as_read_syntax)
void octave_print_internal (std::ostream &os, const FloatMatrix &m, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const FloatDiagMatrix &m, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const FloatNDArray &nda, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const FloatComplexMatrix &cm, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const FloatComplexDiagMatrix &cm, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const FloatComplexNDArray &nda, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const boolMatrix &bm, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const boolNDArray &nda, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const charMatrix &chm, bool pr_as_read_syntax, int, bool pr_as_string)
void octave_print_internal (std::ostream &os, const std::string &s, bool pr_as_read_syntax, int extra_indent)
void octave_print_internal (std::ostream &os, const Array< std::string > &nda, bool pr_as_read_syntax, int)
template<class T >
void octave_print_internal_template (std::ostream &os, const intNDArray< T > &nda, bool pr_as_read_syntax, int extra_indent)
template<class T >
void octave_print_internal_template (std::ostream &os, const octave_int< T > &val, bool)
std::ostream & operator<< (std::ostream &os, const pr_rational_float &prf)
std::ostream & operator<< (std::ostream &os, const pr_engineering_float &pef)
std::ostream & operator<< (std::ostream &os, const pr_formatted_float &pff)
static void pr_any_float (const float_format *fmt, std::ostream &os, double d, int fw=0)
static void pr_col_num_header (std::ostream &os, octave_idx_type total_width, int max_width, octave_idx_type lim, octave_idx_type col, int extra_indent)
static void pr_complex (std::ostream &os, const Complex &c, int r_fw=0, int i_fw=0, double scale=1.0)
static void pr_float (std::ostream &os, double d, int fw=0, double scale=1.0)
static void pr_imag_float (std::ostream &os, double d, int fw=0)
template void pr_int (std::ostream &, const octave_int8 &, int)
template<class T >
void pr_int (std::ostream &os, const T &d, int fw=0)
static double pr_max_internal (const Matrix &m)
static double pr_min_internal (const Matrix &m)
template<class T >
void pr_plus_format (std::ostream &os, const T &val)
template<>
void pr_plus_format (std::ostream &os, const Complex &c)
static void pr_scale_header (std::ostream &os, double scale)
 PRINT_CONV (octave_int8, octave_int16)
static void print_empty_matrix (std::ostream &os, octave_idx_type nr, octave_idx_type nc, bool pr_as_read_syntax)
static void print_empty_nd_array (std::ostream &os, const dim_vector &dims, bool pr_as_read_syntax)
template<typename NDA_T , typename ELT_T , typename MAT_T >
void print_nd_array (std::ostream &os, const NDA_T &nda, bool pr_as_read_syntax)
static std::string rational_approx (double val, int len)
static void set_complex_format (int x_max, int x_min, int r_x, bool inf_or_nan, int int_only, int &r_fw, int &i_fw)
static void set_complex_matrix_format (int x_max, int x_min, int r_x_max, int r_x_min, bool inf_or_nan, int int_or_inf_or_nan, int &r_fw, int &i_fw)
static void set_format (const ComplexMatrix &cm, int &r_fw, int &i_fw, double &scale)
static void set_format (const Matrix &m)
static void set_format (double d)
static void set_format (const Range &r, int &fw, double &scale)
static void set_format (const Range &r)
static void set_format (const Matrix &m, int &fw, double &scale)
static void set_format (const Complex &c)
static void set_format (double d, int &fw)
static void set_format (const ComplexMatrix &cm)
static void set_format (const Complex &c, int &r_fw, int &i_fw)
static void set_format_style (int argc, const string_vector &argv)
static void set_output_prec_and_fw (int prec, int fw)
static void set_range_format (int x_max, int x_min, int all_ints, int &fw)
static void set_real_format (int digits, bool inf_or_nan, bool int_only, int &fw)
static void set_real_matrix_format (int x_max, int x_min, bool inf_or_nan, int int_or_inf_or_nan, int &fw)

Variables

static bool bank_format = false
static int bit_format = 0
static float_formatcurr_imag_fmt = 0
static float_formatcurr_real_fmt = 0
static bool free_format = false
static int hex_format = 0
static bool plus_format = false
static std::string plus_format_chars = "+ "
static bool print_big_e = false
static bool print_e = false
static bool print_eng = false
static bool print_g = false
static bool rat_format = false
static int rat_string_len = -1
bool Vcompact_format = false
static bool Vfixed_point_format = false
static int Voutput_max_field_width = 10
static int Voutput_precision = 5
bool Vprint_empty_dimensions = true
static bool Vsplit_long_rows = true

Define Documentation

#define INSTANTIATE_ABS (   T  )     template /* static */ T abs (T)

Definition at line 3041 of file pr-output.cc.

#define PRINT_CHAR_BITS (   os,
  c 
)
Value:
do \
    { \
      unsigned char ctmp = c; \
      char stmp[9]; \
      stmp[0] = (ctmp & 0x80) ? '1' : '0'; \
      stmp[1] = (ctmp & 0x40) ? '1' : '0'; \
      stmp[2] = (ctmp & 0x20) ? '1' : '0'; \
      stmp[3] = (ctmp & 0x10) ? '1' : '0'; \
      stmp[4] = (ctmp & 0x08) ? '1' : '0'; \
      stmp[5] = (ctmp & 0x04) ? '1' : '0'; \
      stmp[6] = (ctmp & 0x02) ? '1' : '0'; \
      stmp[7] = (ctmp & 0x01) ? '1' : '0'; \
      stmp[8] = '\0'; \
      os << stmp; \
    } \
  while (0)

Definition at line 1406 of file pr-output.cc.

Referenced by pr_any_float(), and pr_int().

#define PRINT_CHAR_BITS_SWAPPED (   os,
  c 
)
Value:
do \
    { \
      unsigned char ctmp = c; \
      char stmp[9]; \
      stmp[0] = (ctmp & 0x01) ? '1' : '0'; \
      stmp[1] = (ctmp & 0x02) ? '1' : '0'; \
      stmp[2] = (ctmp & 0x04) ? '1' : '0'; \
      stmp[3] = (ctmp & 0x08) ? '1' : '0'; \
      stmp[4] = (ctmp & 0x10) ? '1' : '0'; \
      stmp[5] = (ctmp & 0x20) ? '1' : '0'; \
      stmp[6] = (ctmp & 0x40) ? '1' : '0'; \
      stmp[7] = (ctmp & 0x80) ? '1' : '0'; \
      stmp[8] = '\0'; \
      os << stmp; \
    } \
  while (0)

Definition at line 1424 of file pr-output.cc.

Referenced by pr_any_float(), and pr_int().

#define PRINT_CONV (   T1,
  T2 
)
Value:
template <> \
  class \
  octave_print_conv<T1> \
  { \
  public: \
    typedef T2 print_conv_type; \
  }

Definition at line 2949 of file pr-output.cc.

#define PRINT_INT_ARRAY_INTERNAL (   TYPE  ) 
Value:
OCTINTERP_API void \
  octave_print_internal (std::ostream& os, const intNDArray<TYPE>& nda, \
                         bool pr_as_read_syntax, int extra_indent) \
  { \
    octave_print_internal_template (os, nda, pr_as_read_syntax, extra_indent); \
  }

Definition at line 3348 of file pr-output.cc.

#define PRINT_INT_SCALAR_INTERNAL (   TYPE  ) 
Value:
OCTINTERP_API void \
  octave_print_internal (std::ostream& os, const octave_int<TYPE>& val, bool dummy) \
  { \
    octave_print_internal_template (os, val, dummy); \
  }

Definition at line 3106 of file pr-output.cc.

#define SPECIALIZE_UABS (   T  ) 
Value:
template <> \
  /* static */ inline unsigned T \
  abs (unsigned T x) \
  { \
    return x; \
  }

Definition at line 3050 of file pr-output.cc.


Function Documentation

template<class T >
T abs ( x  )  [inline]
static int calc_scale_exp ( const int x  )  [static]

Definition at line 213 of file pr-output.cc.

References print_eng.

Referenced by set_format().

static int current_output_max_field_width ( void   )  [static]

Definition at line 125 of file pr-output.cc.

static int current_output_precision ( void   )  [static]

Definition at line 131 of file pr-output.cc.

DEFUN ( rats  ,
args  ,
nargout   
)
DEFUN ( disp  ,
args  ,
nargout   
)
DEFUN ( fdisp  ,
args   
)
DEFUN ( format  ,
args   
)

Definition at line 3767 of file pr-output.cc.

References error_state, and set_format_style().

DEFUN ( fixed_point_format  ,
args  ,
nargout   
)

Definition at line 3951 of file pr-output.cc.

References SET_INTERNAL_VARIABLE.

DEFUN ( print_empty_dimensions  ,
args  ,
nargout   
)

Definition at line 3990 of file pr-output.cc.

References SET_INTERNAL_VARIABLE.

DEFUN ( split_long_rows  ,
args  ,
nargout   
)

Definition at line 4019 of file pr-output.cc.

References SET_INTERNAL_VARIABLE.

DEFUN ( output_max_field_width  ,
args  ,
nargout   
)

Definition at line 4057 of file pr-output.cc.

References SET_INTERNAL_VARIABLE_WITH_LIMITS.

DEFUN ( output_precision  ,
args  ,
nargout   
)

Definition at line 4074 of file pr-output.cc.

References SET_INTERNAL_VARIABLE_WITH_LIMITS.

static int engineering_exponent ( const double x  )  [static]

Definition at line 234 of file pr-output.cc.

References floor().

Referenced by pr_engineering_float::exponent(), and num_digits().

static void init_format_state ( void   )  [static]
INSTANTIATE_ABS ( signed  char  ) 
INSTANTIATE_ABS ( short   ) 
INSTANTIATE_ABS ( int   ) 
INSTANTIATE_ABS ( long   ) 
static int num_digits ( const double x  )  [static]

Definition at line 252 of file pr-output.cc.

References engineering_exponent(), floor(), and print_eng.

Referenced by set_format().

void octave_print_internal ( std::ostream &  os,
const Matrix m,
bool  pr_as_read_syntax,
int  extra_indent 
)
void octave_print_internal ( std::ostream &  ,
const Cell ,
bool  ,
int  ,
bool   
)

Definition at line 3366 of file pr-output.cc.

References panic_impossible.

void octave_print_internal ( std::ostream &  os,
double  d,
bool   
)
void octave_print_internal ( std::ostream &  os,
const DiagMatrix m,
bool  pr_as_read_syntax,
int  extra_indent 
)
void octave_print_internal ( std::ostream &  os,
const NDArray nda,
bool  pr_as_read_syntax,
int  extra_indent 
)
OCTINTERP_API void octave_print_internal ( std::ostream &  os,
const Complex c,
bool   
)

Definition at line 2610 of file pr-output.cc.

References octave_print_internal().

void octave_print_internal ( std::ostream &  os,
const charNDArray nda,
bool  pr_as_read_syntax,
int  extra_indent,
bool  pr_as_string 
)
void octave_print_internal ( std::ostream &  os,
const ComplexMatrix cm,
bool  pr_as_read_syntax,
int  extra_indent 
)
void octave_print_internal ( std::ostream &  os,
const ComplexDiagMatrix cm,
bool  pr_as_read_syntax,
int  extra_indent 
)
void octave_print_internal ( std::ostream &  os,
const PermMatrix m,
bool  pr_as_read_syntax,
int  extra_indent 
)
void octave_print_internal ( std::ostream &  os,
const Range r,
bool  pr_as_read_syntax,
int  extra_indent 
)
void octave_print_internal ( std::ostream &  os,
const ComplexNDArray nda,
bool  pr_as_read_syntax,
int  extra_indent 
)
void octave_print_internal ( std::ostream &  os,
bool  d,
bool  pr_as_read_syntax 
)

Definition at line 2575 of file pr-output.cc.

References octave_print_internal().

void octave_print_internal ( std::ostream &  os,
float  d,
bool  pr_as_read_syntax 
)

Definition at line 2583 of file pr-output.cc.

References octave_print_internal().

void octave_print_internal ( std::ostream &  os,
const FloatMatrix m,
bool  pr_as_read_syntax,
int  extra_indent 
)

Definition at line 2589 of file pr-output.cc.

References octave_print_internal().

void octave_print_internal ( std::ostream &  os,
const FloatDiagMatrix m,
bool  pr_as_read_syntax,
int  extra_indent 
)

Definition at line 2596 of file pr-output.cc.

References octave_print_internal().

void octave_print_internal ( std::ostream &  os,
const FloatNDArray nda,
bool  pr_as_read_syntax,
int  extra_indent 
)

Definition at line 2603 of file pr-output.cc.

References octave_print_internal().

void octave_print_internal ( std::ostream &  os,
const FloatComplexMatrix cm,
bool  pr_as_read_syntax,
int  extra_indent 
)

Definition at line 2617 of file pr-output.cc.

References octave_print_internal().

void octave_print_internal ( std::ostream &  os,
const FloatComplexDiagMatrix cm,
bool  pr_as_read_syntax,
int  extra_indent 
)

Definition at line 2624 of file pr-output.cc.

References octave_print_internal().

void octave_print_internal ( std::ostream &  os,
const FloatComplexNDArray nda,
bool  pr_as_read_syntax,
int  extra_indent 
)

Definition at line 2631 of file pr-output.cc.

References octave_print_internal().

void octave_print_internal ( std::ostream &  os,
const boolMatrix bm,
bool  pr_as_read_syntax,
int  extra_indent 
)

Definition at line 2748 of file pr-output.cc.

References octave_print_internal().

void octave_print_internal ( std::ostream &  os,
const boolNDArray nda,
bool  pr_as_read_syntax,
int  extra_indent 
)
void octave_print_internal ( std::ostream &  os,
const charMatrix chm,
bool  pr_as_read_syntax,
int  ,
bool  pr_as_string 
)
void octave_print_internal ( std::ostream &  os,
const std::string &  s,
bool  pr_as_read_syntax,
int  extra_indent 
)

Definition at line 2844 of file pr-output.cc.

References octave_print_internal().

void octave_print_internal ( std::ostream &  os,
const Array< std::string > &  nda,
bool  pr_as_read_syntax,
int   
)
template<class T >
void octave_print_internal_template ( std::ostream &  os,
const intNDArray< T > &  nda,
bool  pr_as_read_syntax,
int  extra_indent 
) [inline]
template<class T >
void octave_print_internal_template ( std::ostream &  os,
const octave_int< T > &  val,
bool   
)

Definition at line 3090 of file pr-output.cc.

References free_format, plus_format, pr_int(), and pr_plus_format().

Referenced by octave_print_internal_template().

std::ostream& operator<< ( std::ostream &  os,
const pr_rational_float prf 
)
std::ostream& operator<< ( std::ostream &  os,
const pr_engineering_float pef 
)
std::ostream& operator<< ( std::ostream &  os,
const pr_formatted_float pff 
)
static void pr_any_float ( const float_format fmt,
std::ostream &  os,
double  d,
int  fw = 0 
) [static]
static void pr_col_num_header ( std::ostream &  os,
octave_idx_type  total_width,
int  max_width,
octave_idx_type  lim,
octave_idx_type  col,
int  extra_indent 
) [static]

Definition at line 1667 of file pr-output.cc.

References Vcompact_format, and Vsplit_long_rows.

Referenced by octave_print_internal(), and octave_print_internal_template().

static void pr_complex ( std::ostream &  os,
const Complex c,
int  r_fw = 0,
int  i_fw = 0,
double  scale = 1.0 
) [static]
static void pr_float ( std::ostream &  os,
double  d,
int  fw = 0,
double  scale = 1.0 
) [inline, static]

Definition at line 1564 of file pr-output.cc.

References pr_any_float(), print_g, scale(), and Vfixed_point_format.

Referenced by octave_print_internal(), and pr_complex().

static void pr_imag_float ( std::ostream &  os,
double  d,
int  fw = 0 
) [inline, static]

Definition at line 1573 of file pr-output.cc.

References pr_any_float().

Referenced by pr_complex().

template void pr_int ( std::ostream &  ,
const octave_int8 ,
int   
)
template<class T >
void pr_int ( std::ostream &  os,
const T &  d,
int  fw = 0 
) [inline]
static double pr_max_internal ( const Matrix m  )  [static]

Definition at line 481 of file pr-output.cc.

References Array< T >::columns(), Array< T >::rows(), pr_rational_float::val, xisinf(), and xisnan().

Referenced by set_format().

static double pr_min_internal ( const Matrix m  )  [static]

Definition at line 510 of file pr-output.cc.

References Array< T >::columns(), Array< T >::rows(), pr_rational_float::val, xisinf(), and xisnan().

Referenced by set_format().

template<class T >
void pr_plus_format ( std::ostream &  os,
const T &  val 
) [inline]
template<>
void pr_plus_format ( std::ostream &  os,
const Complex c 
) [inline]

Definition at line 2102 of file pr-output.cc.

References pr_plus_format().

static void pr_scale_header ( std::ostream &  os,
double  scale 
) [static]

Definition at line 1650 of file pr-output.cc.

References left, print_g, Vcompact_format, and Vfixed_point_format.

Referenced by octave_print_internal().

PRINT_CONV ( octave_int8  ,
octave_int16   
)
static void print_empty_matrix ( std::ostream &  os,
octave_idx_type  nr,
octave_idx_type  nc,
bool  pr_as_read_syntax 
) [static]

Definition at line 1612 of file pr-output.cc.

References Vprint_empty_dimensions.

Referenced by octave_print_internal().

static void print_empty_nd_array ( std::ostream &  os,
const dim_vector dims,
bool  pr_as_read_syntax 
) [static]
template<typename NDA_T , typename ELT_T , typename MAT_T >
void print_nd_array ( std::ostream &  os,
const NDA_T &  nda,
bool  pr_as_read_syntax 
)
static std::string rational_approx ( double  val,
int  len 
) [inline, static]

Definition at line 348 of file pr-output.cc.

References d, D_NINT(), xisinf(), xisnan(), and xround().

Referenced by operator<<().

static void set_complex_format ( int  x_max,
int  x_min,
int  r_x,
bool  inf_or_nan,
int  int_only,
int r_fw,
int i_fw 
) [static]

Definition at line 827 of file pr-output.cc.

References bank_format, print_big_e, print_e, print_eng, print_g, rat_format, and float_format::uppercase().

Referenced by set_format().

static void set_complex_matrix_format ( int  x_max,
int  x_min,
int  r_x_max,
int  r_x_min,
bool  inf_or_nan,
int  int_or_inf_or_nan,
int r_fw,
int i_fw 
) [static]
static void set_format ( const ComplexMatrix cm,
int r_fw,
int i_fw,
double scale 
) [static]
static void set_format ( const Matrix m  )  [inline, static]

Definition at line 819 of file pr-output.cc.

References set_format().

static void set_format ( double  d  )  [inline, static]

Definition at line 659 of file pr-output.cc.

References set_format().

static void set_format ( const Range r,
int fw,
double scale 
) [static]
static void set_format ( const Range r  )  [inline, static]

Definition at line 1393 of file pr-output.cc.

References set_format().

static void set_format ( const Matrix m,
int fw,
double scale 
) [static]
static void set_format ( const Complex c  )  [inline, static]

Definition at line 1021 of file pr-output.cc.

References set_format().

static void set_format ( double  d,
int fw 
) [static]

Definition at line 638 of file pr-output.cc.

References D_NINT(), free_format, num_digits(), set_real_format(), xisinf(), and xisnan().

Referenced by octave_print_internal(), and set_format().

static void set_format ( const ComplexMatrix cm  )  [inline, static]

Definition at line 1238 of file pr-output.cc.

References set_format().

static void set_format ( const Complex c,
int r_fw,
int i_fw 
) [static]

Definition at line 980 of file pr-output.cc.

References D_NINT(), free_format, num_digits(), set_complex_format(), xisinf(), and xisnan().

static void set_format_style ( int  argc,
const string_vector argv 
) [static]
static void set_output_prec_and_fw ( int  prec,
int  fw 
) [static]

Definition at line 3584 of file pr-output.cc.

Referenced by set_format_style().

static void set_range_format ( int  x_max,
int  x_min,
int  all_ints,
int fw 
) [static]
static void set_real_format ( int  digits,
bool  inf_or_nan,
bool  int_only,
int fw 
) [static]

Definition at line 542 of file pr-output.cc.

References bank_format, print_big_e, print_e, print_eng, print_g, rat_format, and float_format::uppercase().

Referenced by set_format().

static void set_real_matrix_format ( int  x_max,
int  x_min,
bool  inf_or_nan,
int  int_or_inf_or_nan,
int fw 
) [static]

Variable Documentation

bool bank_format = false [static]
int bit_format = 0 [static]

Definition at line 103 of file pr-output.cc.

float_format* curr_imag_fmt = 0 [static]

Definition at line 478 of file pr-output.cc.

float_format* curr_real_fmt = 0 [static]

Definition at line 475 of file pr-output.cc.

bool free_format = false [static]
int hex_format = 0 [static]

Definition at line 100 of file pr-output.cc.

bool plus_format = false [static]
std::string plus_format_chars = "+ " [static]

Definition at line 88 of file pr-output.cc.

Referenced by pr_plus_format(), and set_format_style().

bool print_big_e = false [static]
bool print_e = false [static]
bool print_eng = false [static]
bool print_g = false [static]
bool rat_format = false [static]
int rat_string_len = -1 [static]

Definition at line 94 of file pr-output.cc.

bool Vfixed_point_format = false [static]

Definition at line 67 of file pr-output.cc.

int Voutput_precision = 5 [static]

Definition at line 71 of file pr-output.cc.

Definition at line 75 of file pr-output.cc.

Referenced by print_empty_matrix(), print_empty_nd_array(), and octave_cell::print_raw().

bool Vsplit_long_rows = true [static]
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines