Mercurial > octave-nkf
changeset 5665:d42bd103de79
[project @ 2006-03-14 19:13:40 by jwe]
author | jwe |
---|---|
date | Tue, 14 Mar 2006 19:13:41 +0000 |
parents | f043021a9df7 |
children | 4a48a1df26b7 |
files | src/ChangeLog src/load-save.cc src/xpow.cc |
diffstat | 3 files changed, 44 insertions(+), 38 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Tue Mar 14 05:21:54 2006 +0000 +++ b/src/ChangeLog Tue Mar 14 19:13:41 2006 +0000 @@ -1,3 +1,11 @@ +2006-03-14 Bill Denney <bill@givebillmoney.com> + + * load-save.cc (Fload, Fsave): Update docstring for functional form. + +2006-03-14 John W. Eaton <jwe@octave.org> + + * xpow.cc (elem_xpow): Undo previous change. + 2006-03-14 Paul Kienzle <pkienzle@users.sf.net> * xpow.cc: New tests.
--- a/src/load-save.cc Tue Mar 14 05:21:54 2006 +0000 +++ b/src/load-save.cc Tue Mar 14 19:13:41 2006 +0000 @@ -600,6 +600,16 @@ load data\n\ @end example\n\ \n\ +If load is invoked using the functional form\n\ +\n\ +@example\n\ +load (\"-text\", \"file.txt\", \"a\")\n\ +@end example\n\ +\n\ +@noindent\n\ +then the @var{options}, @var{file}, and variable name arguments\n\ +(@var{v1}, @dots{}) must be specified as character strings.\n\ +\n\ If a variable that is not marked as global is loaded from a file when a\n\ global symbol with the same name already exists, it is loaded in the\n\ global symbol table. Also, if a variable is marked as global in a file\n\ @@ -1447,7 +1457,7 @@ DEFCMD (save, args, , "-*- texinfo -*-\n\ -@deffn {Command} save options file v1 v2 @dots{}\n\ +@deffn {Command} save options file @var{v1} @var{v2} @dots{}\n\ Save the named variables @var{v1}, @var{v2}, @dots{} in the file\n\ @var{file}. The special filename @samp{-} can be used to write the\n\ output to your terminal. If no variable names are listed, Octave saves\n\ @@ -1456,6 +1466,16 @@ modify the output format override the format specified by the built-in\n\ variable @code{default_save_options}.\n\ \n\ +If save is invoked using the functional form\n\ +\n\ +@example\n\ +save (\"-text\", \"file.txt\", \"a\")\n\ +@end example\n\ +\n\ +@noindent\n\ +then the @var{options}, @var{file}, and variable name arguments\n\ +(@var{vname1}, @dots{}) must be specified as character strings.\n\ +\n\ @table @code\n\ @item -ascii\n\ Save the data in Octave's text data format.\n\
--- a/src/xpow.cc Tue Mar 14 05:21:54 2006 +0000 +++ b/src/xpow.cc Tue Mar 14 19:13:41 2006 +0000 @@ -569,15 +569,11 @@ for (octave_idx_type j = 0; j < nc; j++) for (octave_idx_type i = 0; i < nr; i++) { - OCTAVE_QUIT; - double ax = a (i, j); - if (ax < 0.0) - { - Complex atmp (ax); - result (i, j) = std::pow (atmp, b); - } - else - result (i, j) = std::pow (ax, b); + OCTAVE_QUIT; + + Complex atmp (a (i, j)); + + result (i, j) = std::pow (atmp, b); } retval = result; @@ -641,16 +637,9 @@ for (octave_idx_type i = 0; i < nr; i++) { OCTAVE_QUIT; - double ax = a (i, j); - double bx = b (i, j); - if (ax < 0.0 && static_cast<int> (bx) != bx) - { - Complex atmp (ax); - Complex btmp (bx); - complex_result (i, j) = std::pow (atmp, btmp); - } - else - complex_result (i, j) = std::pow (ax, bx); + Complex atmp (a (i, j)); + Complex btmp (b (i, j)); + complex_result (i, j) = std::pow (atmp, btmp); } retval = complex_result; @@ -964,14 +953,10 @@ for (octave_idx_type i = 0; i < a.length (); i++) { OCTAVE_QUIT; - double ax = a (i); - if (ax < 0.0) - { - Complex atmp (ax); - result(i) = std::pow (atmp, b); - } - else - result(i) = std::pow (ax, b); + + Complex atmp (a (i)); + + result(i) = std::pow (atmp, b); } retval = result; @@ -1032,16 +1017,9 @@ for (octave_idx_type i = 0; i < len; i++) { OCTAVE_QUIT; - double ax = a(i); - double bx = b(i); - if (ax < 0.0 && static_cast<int> (bx) != bx) - { - Complex atmp (ax); - Complex btmp (bx); - complex_result(i) = std::pow (atmp, btmp); - } - else - complex_result(i) = std::pow (ax, bx); + Complex atmp (a(i)); + Complex btmp (b(i)); + complex_result(i) = std::pow (atmp, btmp); } retval = complex_result;