Mercurial > octave
comparison libinterp/corefcn/pr-output.cc @ 21966:112b20240c87
move docstrings in C++ files out of C strings and into comments
* __contourc__.cc, __dispatch__.cc, __dsearchn__.cc, __ichol__.cc,
__ilu__.cc, __lin_interpn__.cc, __luinc__.cc, __magick_read__.cc,
__pchip_deriv__.cc, __qp__.cc, balance.cc, besselj.cc, betainc.cc,
bitfcns.cc, bsxfun.cc, cellfun.cc, colloc.cc, conv2.cc, daspk.cc,
dasrt.cc, dassl.cc, data.cc, debug.cc, defaults.cc, det.cc, dirfns.cc,
dlmread.cc, dot.cc, eig.cc, ellipj.cc, error.cc, fft.cc, fft2.cc,
fftn.cc, file-io.cc, filter.cc, find.cc, gammainc.cc, gcd.cc,
getgrent.cc, getpwent.cc, getrusage.cc, givens.cc, graphics.cc,
hash.cc, help.cc, hess.cc, hex2num.cc, input.cc, inv.cc, kron.cc,
load-path.cc, load-save.cc, lookup.cc, ls-oct-text.cc, lsode.cc,
lu.cc, mappers.cc, matrix_type.cc, max.cc, mgorth.cc, nproc.cc,
oct-hist.cc, octave-link.cc, ordschur.cc, pager.cc, pinv.cc,
pr-output.cc, profiler.cc, psi.cc, pt-jit.cc, quad.cc, quadcc.cc,
qz.cc, rand.cc, rcond.cc, regexp.cc, schur.cc, sighandlers.cc,
sparse.cc, spparms.cc, sqrtm.cc, str2double.cc, strfind.cc, strfns.cc,
sub2ind.cc, svd.cc, sylvester.cc, symtab.cc, syscalls.cc, sysdep.cc,
time.cc, toplev.cc, tril.cc, tsearch.cc, typecast.cc, urlwrite.cc,
utils.cc, variables.cc, __delaunayn__.cc, __eigs__.cc,
__fltk_uigetfile__.cc, __glpk__.cc, __init_fltk__.cc,
__init_gnuplot__.cc, __osmesa_print__.cc, __voronoi__.cc, amd.cc,
audiodevinfo.cc, audioread.cc, ccolamd.cc, chol.cc, colamd.cc,
convhulln.cc, dmperm.cc, fftw.cc, qr.cc, symbfact.cc, symrcm.cc,
ov-base.cc, ov-bool-mat.cc, ov-cell.cc, ov-class.cc, ov-classdef.cc,
ov-fcn-handle.cc, ov-fcn-inline.cc, ov-flt-re-mat.cc, ov-int16.cc,
ov-int32.cc, ov-int64.cc, ov-int8.cc, ov-java.cc, ov-null-mat.cc,
ov-oncleanup.cc, ov-range.cc, ov-re-mat.cc, ov-struct.cc,
ov-typeinfo.cc, ov-uint16.cc, ov-uint32.cc, ov-uint64.cc, ov-uint8.cc,
ov-usr-fcn.cc, ov.cc, octave.cc, pt-arg-list.cc, pt-binop.cc,
pt-eval.cc, pt-mat.cc, lex.ll, oct-parse.in.yy:
Docstrings are now comments instead of C strings.
* build-aux/mk-opts.pl: Emit docstrings as comments instead of C
strings.
* DASPK-opts.in, LSODE-opts.in: Don't quote " in docstring fragments.
* builtins.h: Include builtin-defun-decls.h unconditionally.
* defun.h (DEFUN, DEFUNX, DEFCONSTFUN): Simply emit declaration.
(DEFALIAS): Always expand to nothing.
* defun-dld.h: No special macro expansions for MAKE_BUILTINS.
(DEFUN_DLD): Use FORWARD_DECLARE_FUN.
(DEFUNX_DLD): Use FORWARD_DECLARE_FUNX.
* defun-int.h: No special macro expansions for MAKE_BUILTINS.
(FORWARD_DECLARE_FUN, FORWARD_DECLARE_FUNX): New macros.
(DEFINE_FUN_INSTALLER_FUN): If compiling an Octave source file, pass
"external-doc" to DEFINE_FUNX_INSTALLER_FUN.
(DEFUN_INTERNAL, DEFCONSTFUN_INTERNAL, DEFUNX_INTERNAL,
DEFALIAS_INTERNAL): Delete.
* common.mk (move_if_change_rule): New macro.
(simple_move_if_change_rule): Define using move_if_change_rule.
* find-defun-files.sh (DEFUN_PATTERN): Update. Don't transform file
name extension to ".df".
* libinterp/mk-pkg-add, gendoc.pl: Operate directly on source files.
* mkbuiltins: New argument, SRCDIR. Operate directly on source files.
* mkdefs: Delete.
* libinterp/module.mk (BUILT_SOURCES): Update list to contain only
files included in other source files.
(GENERATED_MAKE_BUILTINS_INCS, DEF_FILES): Delete.
(LIBINTERP_BUILT_DISTFILES): Include $(OPT_HANDLERS) here.
(LIBINTERP_BUILT_NODISTFILES): Not here. Remove $(ALL_DEF_FILES from
the list.
(libinterp_EXTRA_DIST): Remove mkdefs from the list.
(FOUND_DEFUN_FILES): Rename from SRC_DEF_FILES.
(DLDFCN_DEFUN_FILES): Rename from DLDFCN_DEF_FILES.
(SRC_DEFUN_FILES): Rename from SRC_DEF_FILES.
(ALL_DEFUN_FILES): Rename from ALL_DEF_FILES.
(%.df: %.cc): Delete pattern rule.
(libinterp/build-env-features.cc, libinterp/builtins.cc,
libinterp/dldfcn/PKG_ADD): Use mv instead of move-if-change.
(libinterp/builtins.cc, libinterp/builtin-defun-decls.h):
Update mkbuiltins command.
($(srcdir)/libinterp/DOCSTRINGS): Update gendoc.pl command.
* liboctave/module.mk (BUILT_SOURCES): Don't include
liboctave-build-info.cc in the list.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 21 Jun 2016 16:07:51 -0400 |
parents | aab79a1885cc |
children | 278fc29b69ca |
comparison
equal
deleted
inserted
replaced
21965:da218a61ce4a | 21966:112b20240c87 |
---|---|
3406 { | 3406 { |
3407 panic_impossible (); | 3407 panic_impossible (); |
3408 } | 3408 } |
3409 | 3409 |
3410 DEFUN (rats, args, , | 3410 DEFUN (rats, args, , |
3411 "-*- texinfo -*-\n\ | 3411 doc: /* -*- texinfo -*- |
3412 @deftypefn {} {} rats (@var{x}, @var{len})\n\ | 3412 @deftypefn {} {} rats (@var{x}, @var{len}) |
3413 Convert @var{x} into a rational approximation represented as a string.\n\ | 3413 Convert @var{x} into a rational approximation represented as a string. |
3414 \n\ | 3414 |
3415 The string can be converted back into a matrix as follows:\n\ | 3415 The string can be converted back into a matrix as follows: |
3416 \n\ | 3416 |
3417 @example\n\ | 3417 @example |
3418 @group\n\ | 3418 @group |
3419 r = rats (hilb (4));\n\ | 3419 r = rats (hilb (4)); |
3420 x = str2num (r)\n\ | 3420 x = str2num (r) |
3421 @end group\n\ | 3421 @end group |
3422 @end example\n\ | 3422 @end example |
3423 \n\ | 3423 |
3424 The optional second argument defines the maximum length of the string\n\ | 3424 The optional second argument defines the maximum length of the string |
3425 representing the elements of @var{x}. By default @var{len} is 9.\n\ | 3425 representing the elements of @var{x}. By default @var{len} is 9. |
3426 \n\ | 3426 |
3427 If the length of the smallest possible rational approximation exceeds\n\ | 3427 If the length of the smallest possible rational approximation exceeds |
3428 @var{len}, an asterisk (*) padded with spaces will be returned instead.\n\ | 3428 @var{len}, an asterisk (*) padded with spaces will be returned instead. |
3429 @seealso{format, rat}\n\ | 3429 @seealso{format, rat} |
3430 @end deftypefn") | 3430 @end deftypefn */) |
3431 { | 3431 { |
3432 int nargin = args.length (); | 3432 int nargin = args.length (); |
3433 | 3433 |
3434 if (nargin < 1 || nargin > 2) | 3434 if (nargin < 1 || nargin > 2) |
3435 print_usage (); | 3435 print_usage (); |
3478 | 3478 |
3479 return ovl (string_vector (lst)); | 3479 return ovl (string_vector (lst)); |
3480 } | 3480 } |
3481 | 3481 |
3482 DEFUN (disp, args, nargout, | 3482 DEFUN (disp, args, nargout, |
3483 "-*- texinfo -*-\n\ | 3483 doc: /* -*- texinfo -*- |
3484 @deftypefn {} {} disp (@var{x})\n\ | 3484 @deftypefn {} {} disp (@var{x}) |
3485 Display the value of @var{x}.\n\ | 3485 Display the value of @var{x}. |
3486 \n\ | 3486 |
3487 For example:\n\ | 3487 For example: |
3488 \n\ | 3488 |
3489 @example\n\ | 3489 @example |
3490 @group\n\ | 3490 @group |
3491 disp (\"The value of pi is:\"), disp (pi)\n\ | 3491 disp ("The value of pi is:"), disp (pi) |
3492 \n\ | 3492 |
3493 @print{} the value of pi is:\n\ | 3493 @print{} the value of pi is: |
3494 @print{} 3.1416\n\ | 3494 @print{} 3.1416 |
3495 @end group\n\ | 3495 @end group |
3496 @end example\n\ | 3496 @end example |
3497 \n\ | 3497 |
3498 @noindent\n\ | 3498 @noindent |
3499 Note that the output from @code{disp} always ends with a newline.\n\ | 3499 Note that the output from @code{disp} always ends with a newline. |
3500 \n\ | 3500 |
3501 If an output value is requested, @code{disp} prints nothing and returns the\n\ | 3501 If an output value is requested, @code{disp} prints nothing and returns the |
3502 formatted output in a string.\n\ | 3502 formatted output in a string. |
3503 @seealso{fdisp}\n\ | 3503 @seealso{fdisp} |
3504 @end deftypefn") | 3504 @end deftypefn */) |
3505 { | 3505 { |
3506 if (args.length () != 1) | 3506 if (args.length () != 1) |
3507 print_usage (); | 3507 print_usage (); |
3508 | 3508 |
3509 octave_value_list retval; | 3509 octave_value_list retval; |
3521 | 3521 |
3522 return retval; | 3522 return retval; |
3523 } | 3523 } |
3524 | 3524 |
3525 DEFUN (fdisp, args, , | 3525 DEFUN (fdisp, args, , |
3526 "-*- texinfo -*-\n\ | 3526 doc: /* -*- texinfo -*- |
3527 @deftypefn {} {} fdisp (@var{fid}, @var{x})\n\ | 3527 @deftypefn {} {} fdisp (@var{fid}, @var{x}) |
3528 Display the value of @var{x} on the stream @var{fid}.\n\ | 3528 Display the value of @var{x} on the stream @var{fid}. |
3529 \n\ | 3529 |
3530 For example:\n\ | 3530 For example: |
3531 \n\ | 3531 |
3532 @example\n\ | 3532 @example |
3533 @group\n\ | 3533 @group |
3534 fdisp (stdout, \"The value of pi is:\"), fdisp (stdout, pi)\n\ | 3534 fdisp (stdout, "The value of pi is:"), fdisp (stdout, pi) |
3535 \n\ | 3535 |
3536 @print{} the value of pi is:\n\ | 3536 @print{} the value of pi is: |
3537 @print{} 3.1416\n\ | 3537 @print{} 3.1416 |
3538 @end group\n\ | 3538 @end group |
3539 @end example\n\ | 3539 @end example |
3540 \n\ | 3540 |
3541 @noindent\n\ | 3541 @noindent |
3542 Note that the output from @code{fdisp} always ends with a newline.\n\ | 3542 Note that the output from @code{fdisp} always ends with a newline. |
3543 @seealso{disp}\n\ | 3543 @seealso{disp} |
3544 @end deftypefn") | 3544 @end deftypefn */) |
3545 { | 3545 { |
3546 if (args.length () != 2) | 3546 if (args.length () != 2) |
3547 print_usage (); | 3547 print_usage (); |
3548 | 3548 |
3549 int fid = octave_stream_list::get_file_number (args(0)); | 3549 int fid = octave_stream_list::get_file_number (args(0)); |
3854 format_string = format; | 3854 format_string = format; |
3855 } | 3855 } |
3856 | 3856 |
3857 | 3857 |
3858 DEFUN (format, args, , | 3858 DEFUN (format, args, , |
3859 "-*- texinfo -*-\n\ | 3859 doc: /* -*- texinfo -*- |
3860 @deftypefn {} {} format\n\ | 3860 @deftypefn {} {} format |
3861 @deftypefnx {} {} format options\n\ | 3861 @deftypefnx {} {} format options |
3862 Reset or specify the format of the output produced by @code{disp} and\n\ | 3862 Reset or specify the format of the output produced by @code{disp} and |
3863 Octave's normal echoing mechanism.\n\ | 3863 Octave's normal echoing mechanism. |
3864 \n\ | 3864 |
3865 This command only affects the display of numbers but not how they are stored\n\ | 3865 This command only affects the display of numbers but not how they are stored |
3866 or computed. To change the internal representation from the default double\n\ | 3866 or computed. To change the internal representation from the default double |
3867 use one of the conversion functions such as @code{single}, @code{uint8},\n\ | 3867 use one of the conversion functions such as @code{single}, @code{uint8}, |
3868 @code{int64}, etc.\n\ | 3868 @code{int64}, etc. |
3869 \n\ | 3869 |
3870 By default, Octave displays 5 significant digits in a human readable form\n\ | 3870 By default, Octave displays 5 significant digits in a human readable form |
3871 (option @samp{short} paired with @samp{loose} format for matrices).\n\ | 3871 (option @samp{short} paired with @samp{loose} format for matrices). |
3872 If @code{format} is invoked without any options, this default format\n\ | 3872 If @code{format} is invoked without any options, this default format |
3873 is restored.\n\ | 3873 is restored. |
3874 \n\ | 3874 |
3875 Valid formats for floating point numbers are listed in the following\n\ | 3875 Valid formats for floating point numbers are listed in the following |
3876 table.\n\ | 3876 table. |
3877 \n\ | 3877 |
3878 @table @code\n\ | 3878 @table @code |
3879 @item short\n\ | 3879 @item short |
3880 Fixed point format with 5 significant figures in a field that is a maximum\n\ | 3880 Fixed point format with 5 significant figures in a field that is a maximum |
3881 of 10 characters wide. (default).\n\ | 3881 of 10 characters wide. (default). |
3882 \n\ | 3882 |
3883 If Octave is unable to format a matrix so that columns line up on the\n\ | 3883 If Octave is unable to format a matrix so that columns line up on the |
3884 decimal point and all numbers fit within the maximum field width then\n\ | 3884 decimal point and all numbers fit within the maximum field width then |
3885 it switches to an exponential @samp{e} format.\n\ | 3885 it switches to an exponential @samp{e} format. |
3886 \n\ | 3886 |
3887 @item long\n\ | 3887 @item long |
3888 Fixed point format with 15 significant figures in a field that is a maximum\n\ | 3888 Fixed point format with 15 significant figures in a field that is a maximum |
3889 of 20 characters wide.\n\ | 3889 of 20 characters wide. |
3890 \n\ | 3890 |
3891 As with the @samp{short} format, Octave will switch to an exponential\n\ | 3891 As with the @samp{short} format, Octave will switch to an exponential |
3892 @samp{e} format if it is unable to format a matrix properly using the\n\ | 3892 @samp{e} format if it is unable to format a matrix properly using the |
3893 current format.\n\ | 3893 current format. |
3894 \n\ | 3894 |
3895 @item short e\n\ | 3895 @item short e |
3896 @itemx long e\n\ | 3896 @itemx long e |
3897 Exponential format. The number to be represented is split between a\n\ | 3897 Exponential format. The number to be represented is split between a |
3898 mantissa and an exponent (power of 10). The mantissa has 5 significant\n\ | 3898 mantissa and an exponent (power of 10). The mantissa has 5 significant |
3899 digits in the short format and 15 digits in the long format. For example,\n\ | 3899 digits in the short format and 15 digits in the long format. For example, |
3900 with the @samp{short e} format, @code{pi} is displayed as\n\ | 3900 with the @samp{short e} format, @code{pi} is displayed as |
3901 @code{3.1416e+00}.\n\ | 3901 @code{3.1416e+00}. |
3902 \n\ | 3902 |
3903 @item short E\n\ | 3903 @item short E |
3904 @itemx long E\n\ | 3904 @itemx long E |
3905 Identical to @samp{short e} or @samp{long e} but displays an uppercase\n\ | 3905 Identical to @samp{short e} or @samp{long e} but displays an uppercase |
3906 @samp{E} to indicate the exponent.\n\ | 3906 @samp{E} to indicate the exponent. |
3907 For example, with the @samp{long E} format, @code{pi} is displayed as\n\ | 3907 For example, with the @samp{long E} format, @code{pi} is displayed as |
3908 @code{3.14159265358979E+00}.\n\ | 3908 @code{3.14159265358979E+00}. |
3909 \n\ | 3909 |
3910 @item short g\n\ | 3910 @item short g |
3911 @itemx long g\n\ | 3911 @itemx long g |
3912 Optimally choose between fixed point and exponential format based on\n\ | 3912 Optimally choose between fixed point and exponential format based on |
3913 the magnitude of the number.\n\ | 3913 the magnitude of the number. |
3914 For example, with the @samp{short g} format,\n\ | 3914 For example, with the @samp{short g} format, |
3915 @code{pi .^ [2; 4; 8; 16; 32]} is displayed as\n\ | 3915 @code{pi .^ [2; 4; 8; 16; 32]} is displayed as |
3916 \n\ | 3916 |
3917 @example\n\ | 3917 @example |
3918 @group\n\ | 3918 @group |
3919 ans =\n\ | 3919 ans = |
3920 \n\ | 3920 |
3921 9.8696\n\ | 3921 9.8696 |
3922 97.409\n\ | 3922 97.409 |
3923 9488.5\n\ | 3923 9488.5 |
3924 9.0032e+07\n\ | 3924 9.0032e+07 |
3925 8.1058e+15\n\ | 3925 8.1058e+15 |
3926 @end group\n\ | 3926 @end group |
3927 @end example\n\ | 3927 @end example |
3928 \n\ | 3928 |
3929 @item short eng\n\ | 3929 @item short eng |
3930 @itemx long eng\n\ | 3930 @itemx long eng |
3931 Identical to @samp{short e} or @samp{long e} but displays the value\n\ | 3931 Identical to @samp{short e} or @samp{long e} but displays the value |
3932 using an engineering format, where the exponent is divisible by 3. For\n\ | 3932 using an engineering format, where the exponent is divisible by 3. For |
3933 example, with the @samp{short eng} format, @code{10 * pi} is displayed as\n\ | 3933 example, with the @samp{short eng} format, @code{10 * pi} is displayed as |
3934 @code{31.4159e+00}.\n\ | 3934 @code{31.4159e+00}. |
3935 \n\ | 3935 |
3936 @item long G\n\ | 3936 @item long G |
3937 @itemx short G\n\ | 3937 @itemx short G |
3938 Identical to @samp{short g} or @samp{long g} but displays an uppercase\n\ | 3938 Identical to @samp{short g} or @samp{long g} but displays an uppercase |
3939 @samp{E} to indicate the exponent.\n\ | 3939 @samp{E} to indicate the exponent. |
3940 \n\ | 3940 |
3941 @item free\n\ | 3941 @item free |
3942 @itemx none\n\ | 3942 @itemx none |
3943 Print output in free format, without trying to line up columns of\n\ | 3943 Print output in free format, without trying to line up columns of |
3944 matrices on the decimal point. This also causes complex numbers to be\n\ | 3944 matrices on the decimal point. This also causes complex numbers to be |
3945 formatted as numeric pairs like this @samp{(0.60419, 0.60709)} instead\n\ | 3945 formatted as numeric pairs like this @samp{(0.60419, 0.60709)} instead |
3946 of like this @samp{0.60419 + 0.60709i}.\n\ | 3946 of like this @samp{0.60419 + 0.60709i}. |
3947 @end table\n\ | 3947 @end table |
3948 \n\ | 3948 |
3949 The following formats affect all numeric output (floating point and\n\ | 3949 The following formats affect all numeric output (floating point and |
3950 integer types).\n\ | 3950 integer types). |
3951 \n\ | 3951 |
3952 @table @code\n\ | 3952 @table @code |
3953 @item \"+\"\n\ | 3953 @item "+" |
3954 @itemx \"+\" @var{chars}\n\ | 3954 @itemx "+" @var{chars} |
3955 @itemx plus\n\ | 3955 @itemx plus |
3956 @itemx plus @var{chars}\n\ | 3956 @itemx plus @var{chars} |
3957 Print a @samp{+} symbol for matrix elements greater than zero, a\n\ | 3957 Print a @samp{+} symbol for matrix elements greater than zero, a |
3958 @samp{-} symbol for elements less than zero and a space for zero matrix\n\ | 3958 @samp{-} symbol for elements less than zero and a space for zero matrix |
3959 elements. This format can be very useful for examining the structure\n\ | 3959 elements. This format can be very useful for examining the structure |
3960 of a large sparse matrix.\n\ | 3960 of a large sparse matrix. |
3961 \n\ | 3961 |
3962 The optional argument @var{chars} specifies a list of 3 characters to use\n\ | 3962 The optional argument @var{chars} specifies a list of 3 characters to use |
3963 for printing values greater than zero, less than zero and equal to zero.\n\ | 3963 for printing values greater than zero, less than zero and equal to zero. |
3964 For example, with the @samp{\"+\" \"+-.\"} format,\n\ | 3964 For example, with the @samp{"+" "+-."} format, |
3965 @code{[1, 0, -1; -1, 0, 1]} is displayed as\n\ | 3965 @code{[1, 0, -1; -1, 0, 1]} is displayed as |
3966 \n\ | 3966 |
3967 @example\n\ | 3967 @example |
3968 @group\n\ | 3968 @group |
3969 ans =\n\ | 3969 ans = |
3970 \n\ | 3970 |
3971 +.-\n\ | 3971 +.- |
3972 -.+\n\ | 3972 -.+ |
3973 @end group\n\ | 3973 @end group |
3974 @end example\n\ | 3974 @end example |
3975 \n\ | 3975 |
3976 @item bank\n\ | 3976 @item bank |
3977 Print in a fixed format with two digits to the right of the decimal\n\ | 3977 Print in a fixed format with two digits to the right of the decimal |
3978 point.\n\ | 3978 point. |
3979 \n\ | 3979 |
3980 @item native-hex\n\ | 3980 @item native-hex |
3981 Print the hexadecimal representation of numbers as they are stored in\n\ | 3981 Print the hexadecimal representation of numbers as they are stored in |
3982 memory. For example, on a workstation which stores 8 byte real values\n\ | 3982 memory. For example, on a workstation which stores 8 byte real values |
3983 in IEEE format with the least significant byte first, the value of\n\ | 3983 in IEEE format with the least significant byte first, the value of |
3984 @code{pi} when printed in @code{native-hex} format is\n\ | 3984 @code{pi} when printed in @code{native-hex} format is |
3985 @code{400921fb54442d18}.\n\ | 3985 @code{400921fb54442d18}. |
3986 \n\ | 3986 |
3987 @item hex\n\ | 3987 @item hex |
3988 The same as @code{native-hex}, but always print the most significant\n\ | 3988 The same as @code{native-hex}, but always print the most significant |
3989 byte first.\n\ | 3989 byte first. |
3990 \n\ | 3990 |
3991 @item native-bit\n\ | 3991 @item native-bit |
3992 Print the bit representation of numbers as stored in memory.\n\ | 3992 Print the bit representation of numbers as stored in memory. |
3993 For example, the value of @code{pi} is\n\ | 3993 For example, the value of @code{pi} is |
3994 \n\ | 3994 |
3995 @example\n\ | 3995 @example |
3996 @group\n\ | 3996 @group |
3997 01000000000010010010000111111011\n\ | 3997 01000000000010010010000111111011 |
3998 01010100010001000010110100011000\n\ | 3998 01010100010001000010110100011000 |
3999 @end group\n\ | 3999 @end group |
4000 @end example\n\ | 4000 @end example |
4001 \n\ | 4001 |
4002 (shown here in two 32 bit sections for typesetting purposes) when\n\ | 4002 (shown here in two 32 bit sections for typesetting purposes) when |
4003 printed in native-bit format on a workstation which stores 8 byte real\n\ | 4003 printed in native-bit format on a workstation which stores 8 byte real |
4004 values in IEEE format with the least significant byte first.\n\ | 4004 values in IEEE format with the least significant byte first. |
4005 \n\ | 4005 |
4006 @item bit\n\ | 4006 @item bit |
4007 The same as @code{native-bit}, but always print the most significant\n\ | 4007 The same as @code{native-bit}, but always print the most significant |
4008 bits first.\n\ | 4008 bits first. |
4009 \n\ | 4009 |
4010 @item rat\n\ | 4010 @item rat |
4011 Print a rational approximation, i.e., values are approximated\n\ | 4011 Print a rational approximation, i.e., values are approximated |
4012 as the ratio of small integers.\n\ | 4012 as the ratio of small integers. |
4013 For example, with the @samp{rat} format,\n\ | 4013 For example, with the @samp{rat} format, |
4014 @code{pi} is displayed as @code{355/113}.\n\ | 4014 @code{pi} is displayed as @code{355/113}. |
4015 @end table\n\ | 4015 @end table |
4016 \n\ | 4016 |
4017 The following two options affect the display of all matrices.\n\ | 4017 The following two options affect the display of all matrices. |
4018 \n\ | 4018 |
4019 @table @code\n\ | 4019 @table @code |
4020 @item compact\n\ | 4020 @item compact |
4021 Remove blank lines around column number labels and between\n\ | 4021 Remove blank lines around column number labels and between |
4022 matrices producing more compact output with more data per page.\n\ | 4022 matrices producing more compact output with more data per page. |
4023 \n\ | 4023 |
4024 @item loose\n\ | 4024 @item loose |
4025 Insert blank lines above and below column number labels and between matrices\n\ | 4025 Insert blank lines above and below column number labels and between matrices |
4026 to produce a more readable output with less data per page. (default).\n\ | 4026 to produce a more readable output with less data per page. (default). |
4027 @end table\n\ | 4027 @end table |
4028 @seealso{fixed_point_format, output_max_field_width, output_precision, split_long_rows, print_empty_dimensions, rats}\n\ | 4028 @seealso{fixed_point_format, output_max_field_width, output_precision, split_long_rows, print_empty_dimensions, rats} |
4029 @end deftypefn") | 4029 @end deftypefn */) |
4030 { | 4030 { |
4031 int argc = args.length () + 1; | 4031 int argc = args.length () + 1; |
4032 | 4032 |
4033 string_vector argv = args.make_argv ("format"); | 4033 string_vector argv = args.make_argv ("format"); |
4034 | 4034 |
4036 | 4036 |
4037 return ovl (); | 4037 return ovl (); |
4038 } | 4038 } |
4039 | 4039 |
4040 DEFUN (__compactformat__, args, nargout, | 4040 DEFUN (__compactformat__, args, nargout, |
4041 "-*- texinfo -*-\n\ | 4041 doc: /* -*- texinfo -*- |
4042 @deftypefn {} {@var{val} =} __compactformat__ ()\n\ | 4042 @deftypefn {} {@var{val} =} __compactformat__ () |
4043 @deftypefnx {} {} __compactformat__ (@var{TRUE|FALSE})\n\ | 4043 @deftypefnx {} {} __compactformat__ (@var{TRUE|FALSE}) |
4044 Undocumented internal function\n\ | 4044 Undocumented internal function |
4045 @end deftypefn") | 4045 @end deftypefn */) |
4046 { | 4046 { |
4047 return SET_INTERNAL_VARIABLE (compact_format); | 4047 return SET_INTERNAL_VARIABLE (compact_format); |
4048 } | 4048 } |
4049 | 4049 |
4050 DEFUN (__formatstring__, , , | 4050 DEFUN (__formatstring__, , , |
4051 "-*- texinfo -*-\n\ | 4051 doc: /* -*- texinfo -*- |
4052 @deftypefn {} {@var{val} =} __formatstring__ ()\n\ | 4052 @deftypefn {} {@var{val} =} __formatstring__ () |
4053 Undocumented internal function\n\ | 4053 Undocumented internal function |
4054 @end deftypefn") | 4054 @end deftypefn */) |
4055 { | 4055 { |
4056 return ovl (format_string); | 4056 return ovl (format_string); |
4057 } | 4057 } |
4058 | 4058 |
4059 DEFUN (fixed_point_format, args, nargout, | 4059 DEFUN (fixed_point_format, args, nargout, |
4060 "-*- texinfo -*-\n\ | 4060 doc: /* -*- texinfo -*- |
4061 @deftypefn {} {@var{val} =} fixed_point_format ()\n\ | 4061 @deftypefn {} {@var{val} =} fixed_point_format () |
4062 @deftypefnx {} {@var{old_val} =} fixed_point_format (@var{new_val})\n\ | 4062 @deftypefnx {} {@var{old_val} =} fixed_point_format (@var{new_val}) |
4063 @deftypefnx {} {} fixed_point_format (@var{new_val}, \"local\")\n\ | 4063 @deftypefnx {} {} fixed_point_format (@var{new_val}, "local") |
4064 Query or set the internal variable that controls whether Octave will\n\ | 4064 Query or set the internal variable that controls whether Octave will |
4065 use a scaled format to print matrix values.\n\ | 4065 use a scaled format to print matrix values. |
4066 \n\ | 4066 |
4067 The scaled format prints a scaling factor on the first line of output chosen\n\ | 4067 The scaled format prints a scaling factor on the first line of output chosen |
4068 such that the largest matrix element can be written with a single leading\n\ | 4068 such that the largest matrix element can be written with a single leading |
4069 digit. For example:\n\ | 4069 digit. For example: |
4070 \n\ | 4070 |
4071 @example\n\ | 4071 @example |
4072 @group\n\ | 4072 @group |
4073 logspace (1, 7, 5)'\n\ | 4073 logspace (1, 7, 5)' |
4074 ans =\n\ | 4074 ans = |
4075 \n\ | 4075 |
4076 1.0e+07 *\n\ | 4076 1.0e+07 * |
4077 \n\ | 4077 |
4078 0.00000\n\ | 4078 0.00000 |
4079 0.00003\n\ | 4079 0.00003 |
4080 0.00100\n\ | 4080 0.00100 |
4081 0.03162\n\ | 4081 0.03162 |
4082 1.00000\n\ | 4082 1.00000 |
4083 @end group\n\ | 4083 @end group |
4084 @end example\n\ | 4084 @end example |
4085 \n\ | 4085 |
4086 @noindent\n\ | 4086 @noindent |
4087 Notice that the first value appears to be 0 when it is actually 1. Because\n\ | 4087 Notice that the first value appears to be 0 when it is actually 1. Because |
4088 of the possibility for confusion you should be careful about enabling\n\ | 4088 of the possibility for confusion you should be careful about enabling |
4089 @code{fixed_point_format}.\n\ | 4089 @code{fixed_point_format}. |
4090 \n\ | 4090 |
4091 When called from inside a function with the @qcode{\"local\"} option, the\n\ | 4091 When called from inside a function with the @qcode{"local"} option, the |
4092 variable is changed locally for the function and any subroutines it calls.\n\ | 4092 variable is changed locally for the function and any subroutines it calls. |
4093 The original variable value is restored when exiting the function.\n\ | 4093 The original variable value is restored when exiting the function. |
4094 @seealso{format, output_max_field_width, output_precision}\n\ | 4094 @seealso{format, output_max_field_width, output_precision} |
4095 @end deftypefn") | 4095 @end deftypefn */) |
4096 { | 4096 { |
4097 return SET_INTERNAL_VARIABLE (fixed_point_format); | 4097 return SET_INTERNAL_VARIABLE (fixed_point_format); |
4098 } | 4098 } |
4099 | 4099 |
4100 DEFUN (print_empty_dimensions, args, nargout, | 4100 DEFUN (print_empty_dimensions, args, nargout, |
4101 "-*- texinfo -*-\n\ | 4101 doc: /* -*- texinfo -*- |
4102 @deftypefn {} {@var{val} =} print_empty_dimensions ()\n\ | 4102 @deftypefn {} {@var{val} =} print_empty_dimensions () |
4103 @deftypefnx {} {@var{old_val} =} print_empty_dimensions (@var{new_val})\n\ | 4103 @deftypefnx {} {@var{old_val} =} print_empty_dimensions (@var{new_val}) |
4104 @deftypefnx {} {} print_empty_dimensions (@var{new_val}, \"local\")\n\ | 4104 @deftypefnx {} {} print_empty_dimensions (@var{new_val}, "local") |
4105 Query or set the internal variable that controls whether the dimensions of\n\ | 4105 Query or set the internal variable that controls whether the dimensions of |
4106 empty matrices are printed along with the empty matrix symbol, @samp{[]}.\n\ | 4106 empty matrices are printed along with the empty matrix symbol, @samp{[]}. |
4107 \n\ | 4107 |
4108 For example, the expression\n\ | 4108 For example, the expression |
4109 \n\ | 4109 |
4110 @example\n\ | 4110 @example |
4111 zeros (3, 0)\n\ | 4111 zeros (3, 0) |
4112 @end example\n\ | 4112 @end example |
4113 \n\ | 4113 |
4114 @noindent\n\ | 4114 @noindent |
4115 will print\n\ | 4115 will print |
4116 \n\ | 4116 |
4117 @example\n\ | 4117 @example |
4118 ans = [](3x0)\n\ | 4118 ans = [](3x0) |
4119 @end example\n\ | 4119 @end example |
4120 \n\ | 4120 |
4121 When called from inside a function with the @qcode{\"local\"} option, the\n\ | 4121 When called from inside a function with the @qcode{"local"} option, the |
4122 variable is changed locally for the function and any subroutines it calls.\n\ | 4122 variable is changed locally for the function and any subroutines it calls. |
4123 The original variable value is restored when exiting the function.\n\ | 4123 The original variable value is restored when exiting the function. |
4124 @seealso{format}\n\ | 4124 @seealso{format} |
4125 @end deftypefn") | 4125 @end deftypefn */) |
4126 { | 4126 { |
4127 return SET_INTERNAL_VARIABLE (print_empty_dimensions); | 4127 return SET_INTERNAL_VARIABLE (print_empty_dimensions); |
4128 } | 4128 } |
4129 | 4129 |
4130 DEFUN (split_long_rows, args, nargout, | 4130 DEFUN (split_long_rows, args, nargout, |
4131 "-*- texinfo -*-\n\ | 4131 doc: /* -*- texinfo -*- |
4132 @deftypefn {} {@var{val} =} split_long_rows ()\n\ | 4132 @deftypefn {} {@var{val} =} split_long_rows () |
4133 @deftypefnx {} {@var{old_val} =} split_long_rows (@var{new_val})\n\ | 4133 @deftypefnx {} {@var{old_val} =} split_long_rows (@var{new_val}) |
4134 @deftypefnx {} {} split_long_rows (@var{new_val}, \"local\")\n\ | 4134 @deftypefnx {} {} split_long_rows (@var{new_val}, "local") |
4135 Query or set the internal variable that controls whether rows of a matrix\n\ | 4135 Query or set the internal variable that controls whether rows of a matrix |
4136 may be split when displayed to a terminal window.\n\ | 4136 may be split when displayed to a terminal window. |
4137 \n\ | 4137 |
4138 If the rows are split, Octave will display the matrix in a series of smaller\n\ | 4138 If the rows are split, Octave will display the matrix in a series of smaller |
4139 pieces, each of which can fit within the limits of your terminal width and\n\ | 4139 pieces, each of which can fit within the limits of your terminal width and |
4140 each set of rows is labeled so that you can easily see which columns are\n\ | 4140 each set of rows is labeled so that you can easily see which columns are |
4141 currently being displayed. For example:\n\ | 4141 currently being displayed. For example: |
4142 \n\ | 4142 |
4143 @example\n\ | 4143 @example |
4144 @group\n\ | 4144 @group |
4145 octave:13> rand (2,10)\n\ | 4145 octave:13> rand (2,10) |
4146 ans =\n\ | 4146 ans = |
4147 \n\ | 4147 |
4148 Columns 1 through 6:\n\ | 4148 Columns 1 through 6: |
4149 \n\ | 4149 |
4150 0.75883 0.93290 0.40064 0.43818 0.94958 0.16467\n\ | 4150 0.75883 0.93290 0.40064 0.43818 0.94958 0.16467 |
4151 0.75697 0.51942 0.40031 0.61784 0.92309 0.40201\n\ | 4151 0.75697 0.51942 0.40031 0.61784 0.92309 0.40201 |
4152 \n\ | 4152 |
4153 Columns 7 through 10:\n\ | 4153 Columns 7 through 10: |
4154 \n\ | 4154 |
4155 0.90174 0.11854 0.72313 0.73326\n\ | 4155 0.90174 0.11854 0.72313 0.73326 |
4156 0.44672 0.94303 0.56564 0.82150\n\ | 4156 0.44672 0.94303 0.56564 0.82150 |
4157 @end group\n\ | 4157 @end group |
4158 @end example\n\ | 4158 @end example |
4159 \n\ | 4159 |
4160 When called from inside a function with the @qcode{\"local\"} option, the\n\ | 4160 When called from inside a function with the @qcode{"local"} option, the |
4161 variable is changed locally for the function and any subroutines it calls.\n\ | 4161 variable is changed locally for the function and any subroutines it calls. |
4162 The original variable value is restored when exiting the function.\n\ | 4162 The original variable value is restored when exiting the function. |
4163 @seealso{format}\n\ | 4163 @seealso{format} |
4164 @end deftypefn") | 4164 @end deftypefn */) |
4165 { | 4165 { |
4166 return SET_INTERNAL_VARIABLE (split_long_rows); | 4166 return SET_INTERNAL_VARIABLE (split_long_rows); |
4167 } | 4167 } |
4168 | 4168 |
4169 DEFUN (output_max_field_width, args, nargout, | 4169 DEFUN (output_max_field_width, args, nargout, |
4170 "-*- texinfo -*-\n\ | 4170 doc: /* -*- texinfo -*- |
4171 @deftypefn {} {@var{val} =} output_max_field_width ()\n\ | 4171 @deftypefn {} {@var{val} =} output_max_field_width () |
4172 @deftypefnx {} {@var{old_val} =} output_max_field_width (@var{new_val})\n\ | 4172 @deftypefnx {} {@var{old_val} =} output_max_field_width (@var{new_val}) |
4173 @deftypefnx {} {} output_max_field_width (@var{new_val}, \"local\")\n\ | 4173 @deftypefnx {} {} output_max_field_width (@var{new_val}, "local") |
4174 Query or set the internal variable that specifies the maximum width\n\ | 4174 Query or set the internal variable that specifies the maximum width |
4175 of a numeric output field.\n\ | 4175 of a numeric output field. |
4176 \n\ | 4176 |
4177 When called from inside a function with the @qcode{\"local\"} option, the\n\ | 4177 When called from inside a function with the @qcode{"local"} option, the |
4178 variable is changed locally for the function and any subroutines it calls.\n\ | 4178 variable is changed locally for the function and any subroutines it calls. |
4179 The original variable value is restored when exiting the function.\n\ | 4179 The original variable value is restored when exiting the function. |
4180 @seealso{format, fixed_point_format, output_precision}\n\ | 4180 @seealso{format, fixed_point_format, output_precision} |
4181 @end deftypefn") | 4181 @end deftypefn */) |
4182 { | 4182 { |
4183 return SET_INTERNAL_VARIABLE_WITH_LIMITS (output_max_field_width, 0, | 4183 return SET_INTERNAL_VARIABLE_WITH_LIMITS (output_max_field_width, 0, |
4184 std::numeric_limits<int>::max ()); | 4184 std::numeric_limits<int>::max ()); |
4185 } | 4185 } |
4186 | 4186 |
4187 DEFUN (output_precision, args, nargout, | 4187 DEFUN (output_precision, args, nargout, |
4188 "-*- texinfo -*-\n\ | 4188 doc: /* -*- texinfo -*- |
4189 @deftypefn {} {@var{val} =} output_precision ()\n\ | 4189 @deftypefn {} {@var{val} =} output_precision () |
4190 @deftypefnx {} {@var{old_val} =} output_precision (@var{new_val})\n\ | 4190 @deftypefnx {} {@var{old_val} =} output_precision (@var{new_val}) |
4191 @deftypefnx {} {} output_precision (@var{new_val}, \"local\")\n\ | 4191 @deftypefnx {} {} output_precision (@var{new_val}, "local") |
4192 Query or set the internal variable that specifies the minimum number of\n\ | 4192 Query or set the internal variable that specifies the minimum number of |
4193 significant figures to display for numeric output.\n\ | 4193 significant figures to display for numeric output. |
4194 \n\ | 4194 |
4195 When called from inside a function with the @qcode{\"local\"} option, the\n\ | 4195 When called from inside a function with the @qcode{"local"} option, the |
4196 variable is changed locally for the function and any subroutines it calls.\n\ | 4196 variable is changed locally for the function and any subroutines it calls. |
4197 The original variable value is restored when exiting the function.\n\ | 4197 The original variable value is restored when exiting the function. |
4198 @seealso{format, fixed_point_format, output_max_field_width}\n\ | 4198 @seealso{format, fixed_point_format, output_max_field_width} |
4199 @end deftypefn") | 4199 @end deftypefn */) |
4200 { | 4200 { |
4201 return SET_INTERNAL_VARIABLE_WITH_LIMITS (output_precision, -1, | 4201 return SET_INTERNAL_VARIABLE_WITH_LIMITS (output_precision, -1, |
4202 std::numeric_limits<int>::max ()); | 4202 std::numeric_limits<int>::max ()); |
4203 } | 4203 } |