Mercurial > hg > octave-terminal
changeset 8469:830a03b5f165
qr.cc: require args to be numeric, not necessarily matrix objects
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 12 Jan 2009 14:26:38 -0500 |
parents | 866492035ecf |
children | 5da39b223f61 |
files | src/ChangeLog src/DLD-FUNCTIONS/qr.cc |
diffstat | 2 files changed, 14 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-01-12 John W. Eaton <jwe@octave.org> + + * DLD-FUNCTIONS/qr.cc (Fqrupdate, Fqrinsert, Fqrdelete, Fqrshift): + Require args to be numeric, not necessarily matrix objects. + 2009-01-12 Ben Abbott <bpabbott@mac.com> * graphics.h.in (text::properties::fontunits): Fix typo in list of
--- a/src/DLD-FUNCTIONS/qr.cc +++ b/src/DLD-FUNCTIONS/qr.cc @@ -769,8 +769,8 @@ octave_value argu = args(2); octave_value argv = args(3); - if (argq.is_matrix_type () && argr.is_matrix_type () - && argu.is_matrix_type () && argv.is_matrix_type ()) + if (argq.is_numeric_type () && argr.is_numeric_type () + && argu.is_numeric_type () && argv.is_numeric_type ()) { octave_idx_type m = argq.rows (); octave_idx_type n = argr.columns (); @@ -854,7 +854,7 @@ error ("qrupdate: dimensions mismatch"); } else - print_usage (); + error ("qrupdate: expecting numeric arguments"); return retval; } @@ -958,8 +958,8 @@ octave_value argj = args(2); octave_value argx = args(3); - if (argq.is_matrix_type () && argr.is_matrix_type () - && argj.is_scalar_type () && argx.is_matrix_type () + if (argq.is_numeric_type () && argr.is_numeric_type () + && argj.is_scalar_type () && argx.is_numeric_type () && (nargin < 5 || args(4).is_string ())) { octave_idx_type m = argq.rows (); @@ -1178,7 +1178,8 @@ octave_value argr = args(1); octave_value argj = args(2); - if (argq.is_matrix_type () && argr.is_matrix_type () && argj.is_scalar_type () + if (argq.is_numeric_type () && argr.is_numeric_type () + && argj.is_scalar_type () && (nargin < 4 || args(3).is_string ())) { octave_idx_type m = argq.rows (); @@ -1438,7 +1439,7 @@ octave_value argi = args(2); octave_value argj = args(3); - if (argq.is_matrix_type () && argr.is_matrix_type () + if (argq.is_numeric_type () && argr.is_numeric_type () && argi.is_real_scalar () && argj.is_real_scalar ()) { octave_idx_type n = argr.columns (); @@ -1513,7 +1514,7 @@ error ("qrshift: dimensions mismatch"); } else - print_usage (); + error ("qrshift: expecting numeric arguments"); return retval; }