Mercurial > hg > octave-lojdl
changeset 9048:867d5d1aed06
swap out args in balance for M*b compat
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 27 Mar 2009 14:28:10 +0100 |
parents | a1635f7c4cbe |
children | 56018fcd28b0 |
files | scripts/ChangeLog scripts/linear-algebra/expm.m src/ChangeLog src/DLD-FUNCTIONS/balance.cc |
diffstat | 4 files changed, 21 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2009-03-27 Jaroslav Hajek <highegg@gmail.com> + + * linear-algebra/expm.m: Fix order of outputs from balance. + 2009-03-25 Kai Habel <kai.habel@gmx.de> * general/gradient.m: Fix calculation for more than two
--- a/scripts/linear-algebra/expm.m +++ b/scripts/linear-algebra/expm.m @@ -115,12 +115,12 @@ a -= trshift*eye (n); endif ## Balancing. - [p, d, aa] = balance (a); + [d, p, aa] = balance (a); ## FIXME: can we both permute and scale at once? Or should we rather do ## this: ## - ## [p, xx, aa] = balance (a, "noscal"); - ## [xx, d, aa] = balance (aa, "noperm"); + ## [d, xx, aa] = balance (a, "noperm"); + ## [xx, p, aa] = balance (aa, "noscal"); [f, e] = log2 (norm (aa, "inf")); s = max (0, e); s = min (s, 1023);
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2009-03-27 Jaroslav Hajek <highegg@gmail.com> + + * DLD-FUNCTIONS/balance.cc (Fbalance): Fix order of output args. + 2009-03-26 Jaroslav Hajek <highegg@gmail.com> * DLD-FUNCTIONS/find.cc
--- a/src/DLD-FUNCTIONS/balance.cc +++ b/src/DLD-FUNCTIONS/balance.cc @@ -51,7 +51,7 @@ "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{aa} =} balance (@var{a}, @var{opt})\n\ @deftypefnx {Loadable Function} {[@var{dd}, @var{aa}] =} balance (@var{a}, @var{opt})\n\ -@deftypefnx {Loadable Function} {[@var{p}, @var{d}, @var{aa}] =} balance (@var{a}, @var{opt})\n\ +@deftypefnx {Loadable Function} {[@var{d}, @var{p}, @var{aa}] =} balance (@var{a}, @var{opt})\n\ @deftypefnx {Loadable Function} {[@var{cc}, @var{dd}, @var{aa}, @var{bb}] =} balance (@var{a}, @var{b}, @var{opt})\n\ \n\ Compute @code{aa = dd \\ a * dd} in which @code{aa} is a matrix whose\n\ @@ -62,7 +62,7 @@ eigenvalue calculation are typically improved by balancing first.\n\ \n\ If two output values are requested, @code{balance} returns \n\ -the permutation @code{p} and the diagonal @code{d} separately as vectors. \n\ +the diagonal @code{d} and the permutation @code{p} separately as vectors. \n\ In this case, @code{dd = eye(n)(p,:) * diag (d)}, where @code{n} is the matrix \n\ size. \n\ \n\ @@ -169,8 +169,8 @@ else { retval(2) = result.balanced_matrix (); - retval(1) = result.scaling_vector (); - retval(0) = result.permuting_vector (); + retval(0) = result.scaling_vector (); + retval(1) = result.permuting_vector (); } } @@ -188,8 +188,8 @@ else { retval(2) = result.balanced_matrix (); - retval(1) = result.scaling_vector (); - retval(0) = result.permuting_vector (); + retval(0) = result.scaling_vector (); + retval(1) = result.permuting_vector (); } } } @@ -209,8 +209,8 @@ else { retval(2) = result.balanced_matrix (); - retval(1) = result.scaling_vector (); - retval(0) = result.permuting_vector (); + retval(0) = result.scaling_vector (); + retval(1) = result.permuting_vector (); } } else @@ -227,8 +227,8 @@ else { retval(2) = result.balanced_matrix (); - retval(1) = result.scaling_vector (); - retval(0) = result.permuting_vector (); + retval(0) = result.scaling_vector (); + retval(1) = result.permuting_vector (); } } }