Mercurial > hg > octave-nkf
changeset 503:dbb8a47acc3a
[project @ 1994-07-08 23:41:39 by jwe]
author | jwe |
---|---|
date | Fri, 08 Jul 1994 23:41:39 +0000 |
parents | e273a8532081 |
children | be155b3d5a2f |
files | src/balance.cc src/givens.cc |
diffstat | 2 files changed, 14 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/balance.cc +++ b/src/balance.cc @@ -236,6 +236,7 @@ switch (nargout) { + case 0: case 1: warning ("balance: should use two output arguments"); retval(0) = tree_constant (caa); @@ -251,7 +252,7 @@ retval(3) = tree_constant (cbb); break; default: - error ("balance: illegal number of output arguments"); + error ("balance: invalid number of output arguments"); break; } } @@ -259,6 +260,11 @@ { switch (nargout) { + case 0: + case 1: + warning ("balance: should use two output arguments"); + retval(0) = tree_constant (result.balanced_a_matrix ()); + break; case 2: retval(0) = tree_constant (result.balanced_a_matrix ()); retval(1) = tree_constant (result.balanced_b_matrix ()); @@ -270,7 +276,7 @@ retval(3) = tree_constant (result.balanced_b_matrix ()); break; default: - error ("balance: illegal number of output arguments"); + error ("balance: invalid number of output arguments"); break; } }
--- a/src/givens.cc +++ b/src/givens.cc @@ -111,7 +111,8 @@ switch (nargout) { - case 1: // output a matrix + case 0: // output a matrix + case 1: { ComplexMatrix g (2, 2); g.elem (0, 0) = cc; @@ -129,7 +130,7 @@ break; default: - error ("givens: illegal number of output arguments"); + error ("givens: invalid number of output arguments"); break; } } @@ -141,7 +142,8 @@ switch (nargout) { - case 1: // output a matrix + case 0: // output a matrix + case 1: { Matrix g (2, 2); g.elem (0, 0) = cc; @@ -159,7 +161,7 @@ break; default: - error ("givens: illegal number of output arguments"); + error ("givens: invalid number of output arguments"); break; } }