Mercurial > hg > octave-nkf
changeset 5822:4fdc2515ebad
[project @ 2006-05-18 19:31:36 by jwe]
author | jwe |
---|---|
date | Thu, 18 May 2006 19:31:37 +0000 |
parents | 11e4ae44984f |
children | 080c08b192d8 |
files | liboctave/ChangeLog liboctave/EIG.cc src/DLD-FUNCTIONS/conv2.cc |
diffstat | 3 files changed, 21 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2006-05-18 John W. Eaton <jwe@octave.org> + + * EIG.cc (EIG::init): Trap Inf and NaN values here. + From Keith Goodman <kwgoodman@gmail.com>. + 2006-05-08 David Bateman <dbateman@free.fr> * Sparse-op-defs.h (SPARSE_SPARSE_MUL): fix bug in previous
--- a/liboctave/EIG.cc +++ b/liboctave/EIG.cc @@ -70,6 +70,13 @@ octave_idx_type EIG::init (const Matrix& a, bool calc_ev) { + if (a.any_element_is_inf_or_nan ()) + { + (*current_liboctave_error_handler) + ("EIG: matrix contains Inf or NaN values"); + return -1; + } + if (a.is_symmetric ()) return symmetric_init (a, calc_ev); @@ -237,6 +244,13 @@ octave_idx_type EIG::init (const ComplexMatrix& a, bool calc_ev) { + if (a.any_element_is_inf_or_nan ()) + { + (*current_liboctave_error_handler) + ("EIG: matrix contains Inf or NaN values"); + return -1; + } + if (a.is_hermitian ()) return hermitian_init (a, calc_ev);
--- a/src/DLD-FUNCTIONS/conv2.cc +++ b/src/DLD-FUNCTIONS/conv2.cc @@ -269,7 +269,7 @@ } else if (nargin == 3) { - if args(2).is_string ()) + if (args(2).is_string ()) shape = args(2).string_value (); else separable = true; @@ -288,7 +288,7 @@ ishape = SHAPE_VALID; else { - error("Shape type not valid"); + error ("conv2: shape type not valid"); print_usage ("conv2"); return retval; }