# HG changeset patch # User John W. Eaton # Date 1231788398 18000 # Node ID 830a03b5f1654fd29fe41cd5886e06378e8e43fe # Parent 866492035ecf79b2435d1ca8d5ff98e13bce77d6 qr.cc: require args to be numeric, not necessarily matrix objects diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-01-12 John W. Eaton + + * DLD-FUNCTIONS/qr.cc (Fqrupdate, Fqrinsert, Fqrdelete, Fqrshift): + Require args to be numeric, not necessarily matrix objects. + 2009-01-12 Ben Abbott * graphics.h.in (text::properties::fontunits): Fix typo in list of diff --git a/src/DLD-FUNCTIONS/qr.cc b/src/DLD-FUNCTIONS/qr.cc --- 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; }