# HG changeset patch # User jwe # Date 898573651 0 # Node ID 09a3064a3a1785825af773235a977b40a00e2480 # Parent d81db29f8b2b9844dd265627031257d9eefa8b32 [project @ 1998-06-23 03:46:42 by jwe] diff -r d81db29f8b2b -r 09a3064a3a17 ChangeLog --- a/ChangeLog Thu May 28 15:23:51 1998 +0000 +++ b/ChangeLog Tue Jun 23 03:47:31 1998 +0000 @@ -1,3 +1,8 @@ +Thu Jun 18 20:24:40 1998 Roman Hodek + + * configure.in (RLD_FLAG): Set correctly for Linux on all + architectures. From + Thu May 28 10:17:45 1998 John W. Eaton * configure.in: When checking for glob stuff, make sure that the diff -r d81db29f8b2b -r 09a3064a3a17 configure.in --- a/configure.in Thu May 28 15:23:51 1998 +0000 +++ b/configure.in Tue Jun 23 03:47:31 1998 +0000 @@ -21,7 +21,7 @@ ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA ### 02111-1307, USA. -AC_REVISION($Revision: 1.306 $) +AC_REVISION($Revision: 1.307 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -550,9 +550,7 @@ SONAME_FLAGS='-Xlinker -soname -Xlinker $@' RLD_FLAG='-Xlinker -rpath -Xlinker $(octlibdir)' ;; -changequote(,)dnl - i[3456789]86-*-linux*) -changequote([,])dnl + *-*-linux*) SONAME_FLAGS='-Xlinker -soname -Xlinker $@' RLD_FLAG='-Xlinker -rpath -Xlinker $(octlibdir)' ;; diff -r d81db29f8b2b -r 09a3064a3a17 doc/liboctave/array.texi --- a/doc/liboctave/array.texi Thu May 28 15:23:51 1998 +0000 +++ b/doc/liboctave/array.texi Tue Jun 23 03:47:31 1998 +0000 @@ -1,4 +1,4 @@ -@node Arrays, Matrix and Vector @var{Operations}, Introduction, Top +@node Arrays, Matrix and Vector Operations, Introduction, Top @chapter Arrays @cindex arrays diff -r d81db29f8b2b -r 09a3064a3a17 doc/liboctave/factor.texi --- a/doc/liboctave/factor.texi Thu May 28 15:23:51 1998 +0000 +++ b/doc/liboctave/factor.texi Tue Jun 23 03:47:31 1998 +0000 @@ -1,4 +1,4 @@ -@node Matrix Factorizations, Ranges, Matrix and Vector @var{Operations}, Top +@node Matrix Factorizations, Ranges, Matrix and Vector Operations, Top @chapter Matrix Factorizations @cindex matrix factorizations @cindex factorizations diff -r d81db29f8b2b -r 09a3064a3a17 doc/liboctave/liboctave.texi --- a/doc/liboctave/liboctave.texi Thu May 28 15:23:51 1998 +0000 +++ b/doc/liboctave/liboctave.texi Tue Jun 23 03:47:31 1998 +0000 @@ -28,7 +28,7 @@ @c This file doesn't include a chapter, so it must not be included @c if you want to run the Emacs function texinfo-multiple-files-update. -@include conf.texi +@c @include conf.texi @settitle Octave C++ Classes @@ -98,7 +98,7 @@ * Copying:: * Introduction:: * Arrays:: -* Matrix and Vector @var{Operations}:: +* Matrix and Vector Operations:: * Matrix Factorizations:: * Ranges:: * Nonlinear Functions:: diff -r d81db29f8b2b -r 09a3064a3a17 doc/liboctave/matvec.texi --- a/doc/liboctave/matvec.texi Thu May 28 15:23:51 1998 +0000 +++ b/doc/liboctave/matvec.texi Tue Jun 23 03:47:31 1998 +0000 @@ -107,7 +107,7 @@ @c ------------------------------------------------------------------------ -@node Matrix and Vector @var{Operations}, Matrix Factorizations, Arrays, Top +@node Matrix and Vector Operations, Matrix Factorizations, Arrays, Top @chapter Matrix and Vector Operations @cindex matrix manipulations @cindex vector manipulations diff -r d81db29f8b2b -r 09a3064a3a17 libcruft/ChangeLog --- a/libcruft/ChangeLog Thu May 28 15:23:51 1998 +0000 +++ b/libcruft/ChangeLog Tue Jun 23 03:47:31 1998 +0000 @@ -1,3 +1,7 @@ +Tue Jun 2 09:57:52 1998 John W. Eaton + + * specfun/rybesl.f (rybesl): Don't access by(2) unless nb .gt. 1. + Mon May 11 12:33:42 1998 John W. Eaton * fftpack/passb3.f, fftpack/passb5.f, fftpack/passf3.f, diff -r d81db29f8b2b -r 09a3064a3a17 libcruft/specfun/rybesl.f --- a/libcruft/specfun/rybesl.f Thu May 28 15:23:51 1998 +0000 +++ b/libcruft/specfun/rybesl.f Tue Jun 23 03:47:31 1998 +0000 @@ -406,10 +406,10 @@ C Now have first one or two Y's C---------------------------------------------------------------------- BY(1) = YA - BY(2) = YA1 - IF (YA1 .EQ. ZERO) THEN - NCALC = 1 - ELSE + NCALC = 1 + IF (NB .GT. 1) THEN + BY(2) = YA1 + IF (YA1 .NE. ZERO) THEN AYE = ONE + ALPHA TWOBYX = TWO/EX NCALC = 2 @@ -425,6 +425,7 @@ AYE = AYE + ONE NCALC = NCALC + 1 400 CONTINUE + END IF END IF 450 DO 460 I = NCALC+1, NB BY(I) = ZERO diff -r d81db29f8b2b -r 09a3064a3a17 liboctave/ChangeLog --- a/liboctave/ChangeLog Thu May 28 15:23:51 1998 +0000 +++ b/liboctave/ChangeLog Tue Jun 23 03:47:31 1998 +0000 @@ -1,3 +1,19 @@ +Mon Jun 22 17:04:27 1998 Tomislav Goles + + * EIG.cc (EIG::init): Move invariant code outside loop. + +Thu Jun 18 11:08:23 1998 John W. Eaton + + * MArray2.cc (MARRAY_A2A2_OP): If operands are empty, make result + have the same size as the operands. + +Thu May 28 10:41:04 1998 John W. Eaton + + * DASSL.cc (DASSL::do_integrate): If an exception occurs in the + call to ddassl, set integration_error to 1 before calling the + error handler and returning. + * LSODE.cc (LSODE::do_integrate): Likewise. + Wed May 27 13:46:30 1998 John W. Eaton * Array2-idx.h (assign): Allow A([],[]) = scalar and, if diff -r d81db29f8b2b -r 09a3064a3a17 liboctave/DASSL.cc --- a/liboctave/DASSL.cc Thu May 28 15:23:51 1998 +0000 +++ b/liboctave/DASSL.cc Tue Jun 23 03:47:31 1998 +0000 @@ -276,7 +276,10 @@ piwork, liw, dummy, idummy, ddassl_j)); if (f77_exception_encountered) - (*current_liboctave_error_handler) ("unrecoverable error in dassl"); + { + integration_error = 1; + (*current_liboctave_error_handler) ("unrecoverable error in dassl"); + } else { switch (idid) diff -r d81db29f8b2b -r 09a3064a3a17 liboctave/EIG.cc --- a/liboctave/EIG.cc Thu May 28 15:23:51 1998 +0000 +++ b/liboctave/EIG.cc Tue Jun 23 03:47:31 1998 +0000 @@ -125,10 +125,11 @@ return -1; } + lambda.elem(j) = Complex (wr.elem(j), wi.elem(j)); + lambda.elem(j+1) = Complex (wr.elem(j+1), wi.elem(j+1)); + for (int i = 0; i < n; i++) { - lambda.elem(j) = Complex (wr.elem(j), wi.elem(j)); - lambda.elem(j+1) = Complex (wr.elem(j+1), wi.elem(j+1)); double real_part = vr.elem (i, j); double imag_part = vr.elem (i, j+1); v.elem (i, j) = Complex (real_part, imag_part); diff -r d81db29f8b2b -r 09a3064a3a17 liboctave/LSODE.cc --- a/liboctave/LSODE.cc Thu May 28 15:23:51 1998 +0000 +++ b/liboctave/LSODE.cc Tue Jun 23 03:47:31 1998 +0000 @@ -252,7 +252,10 @@ piwork, liw, lsode_j, method_flag)); if (f77_exception_encountered) - (*current_liboctave_error_handler) ("unrecoverable error in lsode"); + { + integration_error = 1; + (*current_liboctave_error_handler) ("unrecoverable error in lsode"); + } else { switch (istate) diff -r d81db29f8b2b -r 09a3064a3a17 liboctave/MArray2.cc --- a/liboctave/MArray2.cc Thu May 28 15:23:51 1998 +0000 +++ b/liboctave/MArray2.cc Tue Jun 23 03:47:31 1998 +0000 @@ -146,7 +146,7 @@ return MArray2 (); \ } \ if (r == 0 || c == 0) \ - return MArray2 (); \ + return MArray2 (r, c); \ int l = a.length (); \ DO_VV_OP (OP); \ return MArray2 (result, r, c); \ diff -r d81db29f8b2b -r 09a3064a3a17 scripts/ChangeLog --- a/scripts/ChangeLog Thu May 28 15:23:51 1998 +0000 +++ b/scripts/ChangeLog Tue Jun 23 03:47:31 1998 +0000 @@ -1,3 +1,7 @@ +Thu Jun 18 16:32:15 1998 John W. Eaton + + * plot/__plt__.m: Don't call usleep. + Mon May 18 11:42:36 1998 John W. Eaton * linear-algebra/dot.m: New function. diff -r d81db29f8b2b -r 09a3064a3a17 scripts/plot/__plt__.m --- a/scripts/plot/__plt__.m Thu May 28 15:23:51 1998 +0000 +++ b/scripts/plot/__plt__.m Tue Jun 23 03:47:31 1998 +0000 @@ -72,13 +72,6 @@ x_set = 1; endif - ## Something fishy is going on. I don't think this should be - ## necessary, but without it, sometimes not all the lines from a - ## given plot command appear on the screen. Even with it, the - ## delay might not be long enough for some systems... - - usleep (1e5); - endwhile ## Handle last plot. diff -r d81db29f8b2b -r 09a3064a3a17 src/ChangeLog --- a/src/ChangeLog Thu May 28 15:23:51 1998 +0000 +++ b/src/ChangeLog Tue Jun 23 03:47:31 1998 +0000 @@ -1,3 +1,22 @@ +Mon Jun 22 22:13:38 1998 John W. Eaton + + * variables.cc (is_valid_function): Provide version that takes + function name as string. + + * parse.y (binary_expr): Fix thinko that resulted in incorrect + evaluation of -x^y. Thanks to Richard Allan Holcombe + . + (feval): Don't attempt to copy nonexistent arg names. + +Mon Jun 22 21:35:50 1998 Richard Allan Holcombe + + * xpow.cc (xpow): Improve efficiency for matrix^(scalar int) case. + +Thu Jun 4 12:42:46 1998 John W. Eaton + + * ov-usr-fcn.cc (octave_user_function::octave_all_va_args): + If num_args_passed < num_named_args, create zero length list. + Thu May 14 16:23:15 1998 John W. Eaton * DLD-FUNCTIONS/getrusage.cc: Include sys/types.h too. diff -r d81db29f8b2b -r 09a3064a3a17 src/ov-usr-fcn.cc --- a/src/ov-usr-fcn.cc Thu May 28 15:23:51 1998 +0000 +++ b/src/ov-usr-fcn.cc Tue Jun 23 03:47:31 1998 +0000 @@ -171,11 +171,16 @@ { octave_value_list retval; - retval.resize (num_args_passed - num_named_args); + int n = num_args_passed - num_named_args; - int k = 0; - for (int i = num_named_args; i < num_args_passed; i++) - retval(k++) = args_passed(i); + if (n > 0) + { + retval.resize (n); + + int k = 0; + for (int i = num_named_args; i < num_args_passed; i++) + retval(k++) = args_passed(i); + } return retval; } diff -r d81db29f8b2b -r 09a3064a3a17 src/parse.y --- a/src/parse.y Thu May 28 15:23:51 1998 +0000 +++ b/src/parse.y Tue Jun 23 03:47:31 1998 +0000 @@ -31,6 +31,7 @@ #include #endif +#include #include #ifdef YYBYACC @@ -620,6 +621,8 @@ prefix_expr : postfix_expr { $$ = $1; } + | binary_expr + { $$ = $1; } | PLUS_PLUS prefix_expr %prec UNARY { $$ = make_prefix_op (PLUS_PLUS, $2, $1); } | MINUS_MINUS prefix_expr %prec UNARY @@ -632,31 +635,29 @@ { $$ = make_prefix_op ('-', $2, $1); } ; -binary_expr : prefix_expr - { $$ = $1; } - | binary_expr POW binary_expr +binary_expr : prefix_expr POW prefix_expr { $$ = make_binary_op (POW, $1, $2, $3); } - | binary_expr EPOW binary_expr + | prefix_expr EPOW prefix_expr { $$ = make_binary_op (EPOW, $1, $2, $3); } - | binary_expr '+' binary_expr + | prefix_expr '+' prefix_expr { $$ = make_binary_op ('+', $1, $2, $3); } - | binary_expr '-' binary_expr + | prefix_expr '-' prefix_expr { $$ = make_binary_op ('-', $1, $2, $3); } - | binary_expr '*' binary_expr + | prefix_expr '*' prefix_expr { $$ = make_binary_op ('*', $1, $2, $3); } - | binary_expr '/' binary_expr + | prefix_expr '/' prefix_expr { $$ = make_binary_op ('/', $1, $2, $3); } - | binary_expr EPLUS binary_expr + | prefix_expr EPLUS prefix_expr { $$ = make_binary_op ('+', $1, $2, $3); } - | binary_expr EMINUS binary_expr + | prefix_expr EMINUS prefix_expr { $$ = make_binary_op ('-', $1, $2, $3); } - | binary_expr EMUL binary_expr + | prefix_expr EMUL prefix_expr { $$ = make_binary_op (EMUL, $1, $2, $3); } - | binary_expr EDIV binary_expr + | prefix_expr EDIV prefix_expr { $$ = make_binary_op (EDIV, $1, $2, $3); } - | binary_expr LEFTDIV binary_expr + | prefix_expr LEFTDIV prefix_expr { $$ = make_binary_op (LEFTDIV, $1, $2, $3); } - | binary_expr ELEFTDIV binary_expr + | prefix_expr ELEFTDIV prefix_expr { $$ = make_binary_op (ELEFTDIV, $1, $2, $3); } ; @@ -664,9 +665,9 @@ { $$ = finish_colon_expression ($1); } ; -colon_expr1 : binary_expr +colon_expr1 : prefix_expr { $$ = new tree_colon_expression ($1); } - | colon_expr1 ':' binary_expr + | colon_expr1 ':' prefix_expr { if (! ($$ = $1->append ($3))) ABORT_PARSE; @@ -2984,22 +2985,27 @@ if (! error_state) { - string_vector arg_names = args.name_tags (); - int tmp_nargin = args.length () - 1; octave_value_list tmp_args (tmp_nargin, octave_value ()); - string_vector tmp_arg_names (tmp_nargin); - for (int i = 0; i < tmp_nargin; i++) + tmp_args(i) = args(i+1); + + string_vector arg_names = args.name_tags (); + + if (! arg_names.empty ()) { - tmp_args(i) = args(i+1); - tmp_arg_names(i) = arg_names(i+1); + assert (arg_names.length () == tmp_nargin + 1); + + string_vector tmp_arg_names (tmp_nargin); + + for (int i = 0; i < tmp_nargin; i++) + tmp_arg_names(i) = arg_names(i+1); + + tmp_args.stash_name_tags (tmp_arg_names); } - tmp_args.stash_name_tags (tmp_arg_names); - retval = feval (name, tmp_args, nargout); } } diff -r d81db29f8b2b -r 09a3064a3a17 src/variables.cc --- a/src/variables.cc Thu May 28 15:23:51 1998 +0000 +++ b/src/variables.cc Tue Jun 23 03:47:31 1998 +0000 @@ -134,23 +134,10 @@ // Is this octave_value a valid function? octave_function * -is_valid_function (const octave_value& arg, const string& warn_for, bool warn) +is_valid_function (const string& fcn_name, const string& warn_for, bool warn) { octave_function *ans = 0; - string fcn_name; - - if (arg.is_string ()) - fcn_name = arg.string_value (); - - if (fcn_name.empty () || error_state) - { - if (warn) - error ("%s: expecting function name as argument", - warn_for.c_str ()); - return ans; - } - symbol_record *sr = 0; if (! fcn_name.empty ()) @@ -174,6 +161,24 @@ } octave_function * +is_valid_function (const octave_value& arg, const string& warn_for, bool warn) +{ + octave_function *ans = 0; + + string fcn_name; + + if (arg.is_string ()) + fcn_name = arg.string_value (); + + if (! error_state) + ans = is_valid_function (fcn_name, warn_for, warn); + else if (warn) + error ("%s: expecting function name as argument", warn_for.c_str ()); + + return ans; +} + +octave_function * extract_function (const octave_value& arg, const string& warn_for, const string& fname, const string& header, const string& trailer) diff -r d81db29f8b2b -r 09a3064a3a17 src/variables.h --- a/src/variables.h Thu May 28 15:23:51 1998 +0000 +++ b/src/variables.h Tue Jun 23 03:47:31 1998 +0000 @@ -53,6 +53,9 @@ is_valid_function (const octave_value&, const string&, bool warn = false); extern octave_function * +is_valid_function (const string&, const string&, bool warn = false); + +extern octave_function * extract_function (const octave_value& arg, const string& warn_for, const string& fname, const string& header, const string& trailer); diff -r d81db29f8b2b -r 09a3064a3a17 src/xpow.cc --- a/src/xpow.cc Thu May 28 15:23:51 1998 +0000 +++ b/src/xpow.cc Tue Jun 23 03:47:31 1998 +0000 @@ -194,8 +194,19 @@ atmp = a; Matrix result (atmp); - for (int i = 1; i < btmp; i++) - result = result * atmp; + + btmp--; + + while (btmp > 0) + { + if (btmp & 1) + result = result * atmp; + + btmp >>= 1; + + if (btmp > 0) + atmp = atmp * atmp; + } retval = result; } @@ -379,8 +390,19 @@ atmp = a; ComplexMatrix result (atmp); - for (int i = 1; i < btmp; i++) - result = result * atmp; + + btmp--; + + while (btmp > 0) + { + if (btmp & 1) + result = result * atmp; + + btmp >>= 1; + + if (btmp > 0) + atmp = atmp * atmp; + } retval = result; }