Mercurial > octave-nkf
changeset 18870:7bf70dc7f06c stable
Correctly return 0 for empty matrices (bug #42563).
* xnorm.cc (xnorm): Add check for empty matrix and return 0 if found.
author | pantxo <pantxo.diribarne@gmail.com> |
---|---|
date | Mon, 16 Jun 2014 09:03:51 -0700 |
parents | 94d791a03737 |
children | dd34502e5c3c |
files | libinterp/corefcn/xnorm.cc |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/xnorm.cc Mon Jun 16 08:55:17 2014 -0700 +++ b/libinterp/corefcn/xnorm.cc Mon Jun 16 09:03:51 2014 -0700 @@ -48,7 +48,9 @@ if (isfloat || x.is_double_type ()) { - if (isvector) + if (x.is_empty ()) + retval = octave_value (0); + else if (isvector) { if (isfloat & iscomplex) retval = xnorm (x.float_complex_column_vector_value (),