comparison libinterp/octave-value/ov.cc @ 30888:32d2b6604a9f

doc: Ensure documentation lists output argument when it exists for functions in libinterp/ For new users of Octave it is best to show explicit calling forms in the documentation and to show a return argument when it exists. * __ftp__.cc, __magick_read__.cc, __pchip_deriv__.cc, bitfcns.cc, bsxfun.cc, call-stack.cc, cellfun.cc, chol.cc, conv2.cc, data.cc, debug.cc, defaults.cc, det.cc, dirfns.cc, display.cc, dot.cc, error.cc, event-manager.cc, fft.cc, fft2.cc, fftn.cc, file-io.cc, getgrent.cc, getpwent.cc, getrusage.cc, graphics.cc, hash.cc, help.cc, input.cc, interpreter.cc, kron.cc, load-path.cc, mappers.cc, max.cc, nproc.cc, oct-hist.cc, pager.cc, pinv.cc, psi.cc, rand.cc, settings.cc, sighandlers.cc, stream-euler.cc, strfns.cc, symtab.cc, syscalls.cc, sysdep.cc, time.cc, toplev.cc, utils.cc, variables.cc, __fltk_uigetfile__.cc, audiodevinfo.cc, audioread.cc, fftw.cc, ov-bool-mat.cc, ov-cell.cc, ov-class.cc, ov-classdef.cc, ov-fcn-handle.cc, ov-java.cc, ov-struct.cc, ov-typeinfo.cc, ov-usr-fcn.cc, ov.cc, octave.cc, profiler.cc: Add return arguments to @deftypefn macros where they were missing. Attempt to use standard naming convention for return variables. Occasionally improved the docstring itself by re-wording or adding code examples.
author Rik <rik@octave.org>
date Mon, 04 Apr 2022 10:31:48 -0700
parents 79edd49a5a97
children 670a0d878af1
comparison
equal deleted inserted replaced
30887:4bab8d3fce79 30888:32d2b6604a9f
1304 1304
1305 OCTAVE_NAMESPACE_BEGIN 1305 OCTAVE_NAMESPACE_BEGIN
1306 1306
1307 DEFUN (double, args, , 1307 DEFUN (double, args, ,
1308 doc: /* -*- texinfo -*- 1308 doc: /* -*- texinfo -*-
1309 @deftypefn {} {} double (@var{x}) 1309 @deftypefn {} {@var{y} =} double (@var{x})
1310 Convert @var{x} to double precision type. 1310 Convert @var{x} to double precision type.
1311 @seealso{single} 1311 @seealso{single}
1312 @end deftypefn */) 1312 @end deftypefn */)
1313 { 1313 {
1314 if (args.length () != 1) 1314 if (args.length () != 1)
1348 %! assert (class (y), "double"); 1348 %! assert (class (y), "double");
1349 */ 1349 */
1350 1350
1351 DEFUN (single, args, , 1351 DEFUN (single, args, ,
1352 doc: /* -*- texinfo -*- 1352 doc: /* -*- texinfo -*-
1353 @deftypefn {} {} single (@var{x}) 1353 @deftypefn {} {@var{y} =} single (@var{x})
1354 Convert @var{x} to single precision type. 1354 Convert @var{x} to single precision type.
1355 @seealso{double} 1355 @seealso{double}
1356 @end deftypefn */) 1356 @end deftypefn */)
1357 { 1357 {
1358 if (args.length () != 1) 1358 if (args.length () != 1)
1389 %! assert (class (y), "single"); 1389 %! assert (class (y), "single");
1390 */ 1390 */
1391 1391
1392 DEFUN (int8, args, , 1392 DEFUN (int8, args, ,
1393 doc: /* -*- texinfo -*- 1393 doc: /* -*- texinfo -*-
1394 @deftypefn {} {} int8 (@var{x}) 1394 @deftypefn {} {@var{y} =} int8 (@var{x})
1395 Convert @var{x} to 8-bit integer type. 1395 Convert @var{x} to 8-bit integer type.
1396 @seealso{uint8, int16, uint16, int32, uint32, int64, uint64} 1396 @seealso{uint8, int16, uint16, int32, uint32, int64, uint64}
1397 @end deftypefn */) 1397 @end deftypefn */)
1398 { 1398 {
1399 if (args.length () != 1) 1399 if (args.length () != 1)
1411 %!assert (int8 (-2^9), int8 (-2^8)) 1411 %!assert (int8 (-2^9), int8 (-2^8))
1412 */ 1412 */
1413 1413
1414 DEFUN (int16, args, , 1414 DEFUN (int16, args, ,
1415 doc: /* -*- texinfo -*- 1415 doc: /* -*- texinfo -*-
1416 @deftypefn {} {} int16 (@var{x}) 1416 @deftypefn {} {@var{y} =} int16 (@var{x})
1417 Convert @var{x} to 16-bit integer type. 1417 Convert @var{x} to 16-bit integer type.
1418 @seealso{int8, uint8, uint16, int32, uint32, int64, uint64} 1418 @seealso{int8, uint8, uint16, int32, uint32, int64, uint64}
1419 @end deftypefn */) 1419 @end deftypefn */)
1420 { 1420 {
1421 if (args.length () != 1) 1421 if (args.length () != 1)
1433 %!assert (int16 (-2^17), int16 (-2^16)) 1433 %!assert (int16 (-2^17), int16 (-2^16))
1434 */ 1434 */
1435 1435
1436 DEFUN (int32, args, , 1436 DEFUN (int32, args, ,
1437 doc: /* -*- texinfo -*- 1437 doc: /* -*- texinfo -*-
1438 @deftypefn {} {} int32 (@var{x}) 1438 @deftypefn {} {@var{y} =} int32 (@var{x})
1439 Convert @var{x} to 32-bit integer type. 1439 Convert @var{x} to 32-bit integer type.
1440 @seealso{int8, uint8, int16, uint16, uint32, int64, uint64} 1440 @seealso{int8, uint8, int16, uint16, uint32, int64, uint64}
1441 @end deftypefn */) 1441 @end deftypefn */)
1442 { 1442 {
1443 if (args.length () != 1) 1443 if (args.length () != 1)
1455 %!assert (int32 (-2^33), int32 (-2^32)) 1455 %!assert (int32 (-2^33), int32 (-2^32))
1456 */ 1456 */
1457 1457
1458 DEFUN (int64, args, , 1458 DEFUN (int64, args, ,
1459 doc: /* -*- texinfo -*- 1459 doc: /* -*- texinfo -*-
1460 @deftypefn {} {} int64 (@var{x}) 1460 @deftypefn {} {@var{y} =} int64 (@var{x})
1461 Convert @var{x} to 64-bit integer type. 1461 Convert @var{x} to 64-bit integer type.
1462 @seealso{int8, uint8, int16, uint16, int32, uint32, uint64} 1462 @seealso{int8, uint8, int16, uint16, int32, uint32, uint64}
1463 @end deftypefn */) 1463 @end deftypefn */)
1464 { 1464 {
1465 if (args.length () != 1) 1465 if (args.length () != 1)
1477 %!assert (int64 (-2^65), int64 (-2^64)) 1477 %!assert (int64 (-2^65), int64 (-2^64))
1478 */ 1478 */
1479 1479
1480 DEFUN (uint8, args, , 1480 DEFUN (uint8, args, ,
1481 doc: /* -*- texinfo -*- 1481 doc: /* -*- texinfo -*-
1482 @deftypefn {} {} uint8 (@var{x}) 1482 @deftypefn {} {@var{y} =} uint8 (@var{x})
1483 Convert @var{x} to unsigned 8-bit integer type. 1483 Convert @var{x} to unsigned 8-bit integer type.
1484 @seealso{int8, int16, uint16, int32, uint32, int64, uint64} 1484 @seealso{int8, int16, uint16, int32, uint32, int64, uint64}
1485 @end deftypefn */) 1485 @end deftypefn */)
1486 { 1486 {
1487 if (args.length () != 1) 1487 if (args.length () != 1)
1499 %!assert (uint8 (-2^9), uint8 (0)) 1499 %!assert (uint8 (-2^9), uint8 (0))
1500 */ 1500 */
1501 1501
1502 DEFUN (uint16, args, , 1502 DEFUN (uint16, args, ,
1503 doc: /* -*- texinfo -*- 1503 doc: /* -*- texinfo -*-
1504 @deftypefn {} {} uint16 (@var{x}) 1504 @deftypefn {} {@var{y} =} uint16 (@var{x})
1505 Convert @var{x} to unsigned 16-bit integer type. 1505 Convert @var{x} to unsigned 16-bit integer type.
1506 @seealso{int8, uint8, int16, int32, uint32, int64, uint64} 1506 @seealso{int8, uint8, int16, int32, uint32, int64, uint64}
1507 @end deftypefn */) 1507 @end deftypefn */)
1508 { 1508 {
1509 if (args.length () != 1) 1509 if (args.length () != 1)
1521 %!assert (uint16 (-2^17), uint16 (0)) 1521 %!assert (uint16 (-2^17), uint16 (0))
1522 */ 1522 */
1523 1523
1524 DEFUN (uint32, args, , 1524 DEFUN (uint32, args, ,
1525 doc: /* -*- texinfo -*- 1525 doc: /* -*- texinfo -*-
1526 @deftypefn {} {} uint32 (@var{x}) 1526 @deftypefn {} {@var{y} =} uint32 (@var{x})
1527 Convert @var{x} to unsigned 32-bit integer type. 1527 Convert @var{x} to unsigned 32-bit integer type.
1528 @seealso{int8, uint8, int16, uint16, int32, int64, uint64} 1528 @seealso{int8, uint8, int16, uint16, int32, int64, uint64}
1529 @end deftypefn */) 1529 @end deftypefn */)
1530 { 1530 {
1531 if (args.length () != 1) 1531 if (args.length () != 1)
1543 %!assert (uint32 (-2^33), uint32 (0)) 1543 %!assert (uint32 (-2^33), uint32 (0))
1544 */ 1544 */
1545 1545
1546 DEFUN (uint64, args, , 1546 DEFUN (uint64, args, ,
1547 doc: /* -*- texinfo -*- 1547 doc: /* -*- texinfo -*-
1548 @deftypefn {} {} uint64 (@var{x}) 1548 @deftypefn {} {@var{y} =} uint64 (@var{x})
1549 Convert @var{x} to unsigned 64-bit integer type. 1549 Convert @var{x} to unsigned 64-bit integer type.
1550 @seealso{int8, uint8, int16, uint16, int32, uint32, int64} 1550 @seealso{int8, uint8, int16, uint16, int32, uint32, int64}
1551 @end deftypefn */) 1551 @end deftypefn */)
1552 { 1552 {
1553 if (args.length () != 1) 1553 if (args.length () != 1)
3722 3722
3723 OCTAVE_NAMESPACE_BEGIN 3723 OCTAVE_NAMESPACE_BEGIN
3724 3724
3725 DEFUN (sizeof, args, , 3725 DEFUN (sizeof, args, ,
3726 doc: /* -*- texinfo -*- 3726 doc: /* -*- texinfo -*-
3727 @deftypefn {} {} sizeof (@var{val}) 3727 @deftypefn {} {@var{sz} =} sizeof (@var{val})
3728 Return the size of @var{val} in bytes. 3728 Return the size of @var{val} in bytes.
3729 @seealso{whos} 3729 @seealso{whos}
3730 @end deftypefn */) 3730 @end deftypefn */)
3731 { 3731 {
3732 if (args.length () != 1) 3732 if (args.length () != 1)
3800 } 3800 }
3801 } 3801 }
3802 3802
3803 DEFUN (subsref, args, nargout, 3803 DEFUN (subsref, args, nargout,
3804 doc: /* -*- texinfo -*- 3804 doc: /* -*- texinfo -*-
3805 @deftypefn {} {} subsref (@var{val}, @var{idx}) 3805 @deftypefn {} {@var{newval} =} subsref (@var{val}, @var{idx})
3806 Perform the subscripted element selection operation on @var{val} according 3806 Perform the subscripted element selection operation on @var{val} according
3807 to the subscript specified by @var{idx}. 3807 to the subscript specified by @var{idx}.
3808 3808
3809 The subscript @var{idx} must be a structure array with fields @samp{type} 3809 The subscript @var{idx} must be a structure array with fields @samp{type}
3810 and @samp{subs}. Valid values for @samp{type} are @qcode{"()"}, 3810 and @samp{subs}. Valid values for @samp{type} are @qcode{"()"},
3852 return arg0.subsref (type, idx, nargout); 3852 return arg0.subsref (type, idx, nargout);
3853 } 3853 }
3854 3854
3855 DEFUN (subsasgn, args, , 3855 DEFUN (subsasgn, args, ,
3856 doc: /* -*- texinfo -*- 3856 doc: /* -*- texinfo -*-
3857 @deftypefn {} {} subsasgn (@var{val}, @var{idx}, @var{rhs}) 3857 @deftypefn {} {@var{newval} =} subsasgn (@var{val}, @var{idx}, @var{rhs})
3858 Perform the subscripted assignment operation according to the subscript 3858 Perform the subscripted assignment operation according to the subscript
3859 specified by @var{idx}. 3859 specified by @var{idx}.
3860 3860
3861 The subscript @var{idx} must be a structure array with fields @samp{type} 3861 The subscript @var{idx} must be a structure array with fields @samp{type}
3862 and @samp{subs}. Valid values for @samp{type} are @qcode{"()"}, 3862 and @samp{subs}. Valid values for @samp{type} are @qcode{"()"},