Mercurial > hg > octave-nkf
comparison src/data.cc @ 8947:1e4b3149365a
allow size_equal called with 1 arg
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 10 Mar 2009 12:27:51 +0100 |
parents | c2099a4d12ea |
children | 5fa53d1b6247 |
comparison
equal
deleted
inserted
replaced
8946:e7e928088e90 | 8947:1e4b3149365a |
---|---|
2433 DEFUN (size_equal, args, , | 2433 DEFUN (size_equal, args, , |
2434 "-*- texinfo -*-\n\ | 2434 "-*- texinfo -*-\n\ |
2435 @deftypefn {Built-in Function} {} size_equal (@var{a}, @var{b}, @dots{})\n\ | 2435 @deftypefn {Built-in Function} {} size_equal (@var{a}, @var{b}, @dots{})\n\ |
2436 Return true if the dimensions of all arguments agree.\n\ | 2436 Return true if the dimensions of all arguments agree.\n\ |
2437 Trailing singleton dimensions are ignored.\n\ | 2437 Trailing singleton dimensions are ignored.\n\ |
2438 Called with a single argument, size_equal returns true.\n\ | |
2438 @seealso{size, numel}\n\ | 2439 @seealso{size, numel}\n\ |
2439 @end deftypefn") | 2440 @end deftypefn") |
2440 { | 2441 { |
2441 octave_value retval; | 2442 octave_value retval; |
2442 | 2443 |
2443 int nargin = args.length (); | 2444 int nargin = args.length (); |
2444 | 2445 |
2445 if (nargin >= 2) | 2446 if (nargin >= 1) |
2446 { | 2447 { |
2447 retval = true; | 2448 retval = true; |
2448 | 2449 |
2449 dim_vector a_dims = args(0).dims (); | 2450 dim_vector a_dims = args(0).dims (); |
2450 a_dims.chop_trailing_singletons (); | 2451 a_dims.chop_trailing_singletons (); |