# HG changeset patch # User Rik # Date 1271968655 25200 # Node ID 8db807a0eb784fba656c946e95ae8f0b3b34aebe # Parent 26673015caec80d90836243a755db3ffe7a6cd4a Return correct Hessenberg matrix when called with 0 or 1 output arguments rather than full form with two output arguments. diff -r 26673015caec -r 8db807a0eb78 src/ChangeLog --- a/src/ChangeLog Thu Apr 22 09:41:37 2010 +0200 +++ b/src/ChangeLog Thu Apr 22 13:37:35 2010 -0700 @@ -1,3 +1,8 @@ +2010-04-22 Rik + + * DLD-FUNCTIONS/hess.cc.: return correct Hessenberg matrix when called + with only one output argument. + 2010-04-22 Jaroslav Hajek * data.cc (do_hypot): New helper function. Move bulk code from Fhypot diff -r 26673015caec -r 8db807a0eb78 src/DLD-FUNCTIONS/hess.cc --- a/src/DLD-FUNCTIONS/hess.cc Thu Apr 22 09:41:37 2010 +0200 +++ b/src/DLD-FUNCTIONS/hess.cc Thu Apr 22 13:37:35 2010 -0700 @@ -99,8 +99,13 @@ { FloatHESS result (tmp); - retval(1) = result.hess_matrix (); - retval(0) = result.unitary_hess_matrix (); + if (nargout <= 1) + retval(0) = result.hess_matrix (); + else + { + retval(1) = result.hess_matrix (); + retval(0) = result.unitary_hess_matrix (); + } } } else if (arg.is_complex_type ()) @@ -111,8 +116,13 @@ { FloatComplexHESS result (ctmp); - retval(1) = result.hess_matrix (); - retval(0) = result.unitary_hess_matrix (); + if (nargout <= 1) + retval(0) = result.hess_matrix (); + else + { + retval(1) = result.hess_matrix (); + retval(0) = result.unitary_hess_matrix (); + } } } } @@ -126,8 +136,13 @@ { HESS result (tmp); - retval(1) = result.hess_matrix (); - retval(0) = result.unitary_hess_matrix (); + if (nargout <= 1) + retval(0) = result.hess_matrix (); + else + { + retval(1) = result.hess_matrix (); + retval(0) = result.unitary_hess_matrix (); + } } } else if (arg.is_complex_type ()) @@ -138,8 +153,13 @@ { ComplexHESS result (ctmp); - retval(1) = result.hess_matrix (); - retval(0) = result.unitary_hess_matrix (); + if (nargout <= 1) + retval(0) = result.hess_matrix (); + else + { + retval(1) = result.hess_matrix (); + retval(0) = result.unitary_hess_matrix (); + } } } else