Mercurial > hg > octave-avbm
changeset 4139:02ca908056e9
[project @ 2002-11-01 00:49:13 by jwe]
author | jwe |
---|---|
date | Fri, 01 Nov 2002 00:49:13 +0000 |
parents | b38835ea3c6e |
children | 303b28a7a7e4 |
files | libcruft/ChangeLog libcruft/odessa/odessa.f libcruft/odessa/odessa_intdy.f liboctave/ChangeLog liboctave/mx-inlines.cc scripts/ChangeLog scripts/control/base/analdemo.m src/ChangeLog src/DLD-FUNCTIONS/fsolve.cc src/Makefile.in src/ov-base.cc test/ChangeLog test/octave.test/arith/prod-4.m test/octave.test/arith/sum-4.m |
diffstat | 14 files changed, 182 insertions(+), 85 deletions(-) [+] |
line wrap: on
line diff
--- a/libcruft/ChangeLog +++ b/libcruft/ChangeLog @@ -1,3 +1,8 @@ +2002-10-31 John W. Eaton <jwe@bevo.che.wisc.edu> + + * odessa/odessa.f (ODESSA): Second arg of xerrwd is string length. + * odessa/odessa_intdy.f (ODESSA_INTDY): Likewise. + 2002-10-29 John W. Eaton <jwe@bevo.che.wisc.edu> * dasrt/ddasrt.f (DDASRT): Fix computation of LENRW.
--- a/libcruft/odessa/odessa.f +++ b/libcruft/odessa/odessa.f @@ -1618,17 +1618,17 @@ NHNIL = NHNIL + 1 IF (NHNIL .GT. MXHNIL) GO TO 290 CALL XERRWD ('ODESSA - WARNING..INTERNAL T (=R1) AND H (=R2) ARE', - 1 101, 1, 0, 0, 0, 0, ZERO, ZERO) + 1 50, 101, 1, 0, 0, 0, 0, ZERO, ZERO) CALL XERRWD 1 ('SUCH THAT IN THE MACHINE, T + H = T ON THE NEXT STEP', - 1 101, 1, 0, 0, 0, 0, ZERO, ZERO) + 1 52, 101, 1, 0, 0, 0, 0, ZERO, ZERO) CALL XERRWD ('(H = STEP SIZE). SOLVER WILL CONTINUE ANYWAY', - 1 101, 1, 0, 0, 0, 2, TN, H) + 1 44, 101, 1, 0, 0, 0, 2, TN, H) IF (NHNIL .LT. MXHNIL) GO TO 290 CALL XERRWD ('ODESSA - ABOVE WARNING HAS BEEN ISSUED I1 TIMES.', - 1 102, 1, 0, 0, 0, 0, ZERO, ZERO) + 1 48, 102, 1, 0, 0, 0, 0, ZERO, ZERO) CALL XERRWD ('IT WILL NOT BE ISSUED AGAIN FOR THIS PROBLEM', - 1 102, 1, 1, MXHNIL, 0, 0, ZERO,ZERO) + 1 44, 102, 1, 1, MXHNIL, 0, 0, ZERO,ZERO) 290 CONTINUE C----------------------------------------------------------------------- C CALL ODESSA_STODE(NEQ,Y,YH,NYH,YH,WM,IWM,EWT,SAVF,ACOR,PAR,NRS, @@ -1702,7 +1702,7 @@ 430 NTREP = NTREP + 1 IF (NTREP .LT. 5) RETURN CALL XERRWD ('ODESSA -- REPEATED CALLS WITH ISTATE = 1 AND - 1TOUT = T (=R1)', 301, 1, 0, 0, 0, 1, T, ZERO) + 1 TOUT = T (=R1)', 59, 301, 1, 0, 0, 0, 1, T, ZERO) GO TO 800 C----------------------------------------------------------------------- C BLOCK H. @@ -1715,39 +1715,39 @@ C----------------------------------------------------------------------- C THE MAXIMUM NUMBER OF STEPS WAS TAKEN BEFORE REACHING TOUT. ---------- 500 CALL XERRWD ('ODESSA - AT CURRENT T (=R1), MXSTEP (=I1) STEPS', - 1 201, 1, 0, 0, 0, 0, ZERO,ZERO) + 1 47, 201, 1, 0, 0, 0, 0, ZERO,ZERO) CALL XERRWD ('TAKEN ON THIS CALL BEFORE REACHING TOUT', - 1 201, 1, 1, MXSTEP, 0, 1, TN, ZERO) + 1 39, 201, 1, 1, MXSTEP, 0, 1, TN, ZERO) ISTATE = -1 GO TO 580 C EWT(I) .LE. 0.0 FOR SOME I (NOT AT START OF PROBLEM). ---------------- 510 EWTI = RWORK(LEWT+I-1) CALL XERRWD ('ODESSA - AT T (=R1), EWT(I1) HAS BECOME R2 .LE. 0.', - 1 202, 1, 1, I, 0, 2, TN, EWTI) + 1 50, 202, 1, 1, I, 0, 2, TN, EWTI) ISTATE = -6 GO TO 580 C TOO MUCH ACCURACY REQUESTED FOR MACHINE PRECISION. ------------------- 520 CALL XERRWD ('ODESSA - AT T (=R1), TOO MUCH ACCURACY REQUESTED', - 1 203, 1, 0, 0, 0, 0, ZERO,ZERO) + 1 48, 203, 1, 0, 0, 0, 0, ZERO,ZERO) CALL XERRWD ('FOR PRECISION OF MACHINE.. SEE TOLSF (=R2)', - 1 203, 1, 0, 0, 0, 2, TN, TOLSF) + 1 43, 203, 1, 0, 0, 0, 2, TN, TOLSF) RWORK(14) = TOLSF ISTATE = -2 GO TO 580 C KFLAG = -1. ERROR TEST FAILED REPEATEDLY OR WITH ABS(H) = HMIN. ----- 530 CALL XERRWD ('ODESSA - AT T(=R1) AND STEP SIZE H(=R2), THE ERROR', - 1 204, 1, 0, 0, 0, 0, ZERO, ZERO) + 1 50, 204, 1, 0, 0, 0, 0, ZERO, ZERO) CALL XERRWD ('TEST FAILED REPEATEDLY OR WITH ABS(H) = HMIN', - 1 204, 1, 0, 0, 0, 2, TN, H) + 1 44, 204, 1, 0, 0, 0, 2, TN, H) ISTATE = -4 GO TO 560 C KFLAG = -2. CONVERGENCE FAILED REPEATEDLY OR WITH ABS(H) = HMIN. ---- 540 CALL XERRWD ('ODESSA - AT T (=R1) AND STEP SIZE H (=R2), THE', - 1 205, 1, 0, 0, 0, 0, ZERO,ZERO) + 1 46, 205, 1, 0, 0, 0, 0, ZERO,ZERO) CALL XERRWD ('CORRECTOR CONVERGENCE FAILED REPEATEDLY', - 1 205, 1, 0, 0, 0, 0, ZERO,ZERO) + 1 39, 205, 1, 0, 0, 0, 0, ZERO,ZERO) CALL XERRWD ('OR WITH ABS(H) = HMIN', - 1 205, 1, 0, 0, 0, 2, TN, H) + 1 21, 0, 1, 0, 0, 0, 2, TN, H) ISTATE = -5 C COMPUTE IMXER IF RELEVANT. ------------------------------------------- 560 BIG = ZERO @@ -1785,126 +1785,126 @@ C THE RUN IS HALTED. C----------------------------------------------------------------------- 601 CALL XERRWD ('ODESSA - ISTATE (=I1) ILLEGAL', - 1 1, 1, 1, ISTATE, 0, 0, ZERO,ZERO) + 1 29, 1, 1, 1, ISTATE, 0, 0, ZERO,ZERO) GO TO 700 602 CALL XERRWD ('ODESSA - ITASK (=I1) ILLEGAL', - 1 2, 1, 1, ITASK, 0, 0, ZERO,ZERO) + 1 28, 2, 1, 1, ITASK, 0, 0, ZERO,ZERO) GO TO 700 603 CALL XERRWD ('ODESSA - ISTATE .GT. 1 BUT ODESSA NOT INITIALIZED', - 1 3, 1, 0, 0, 0, 0, ZERO,ZERO) + 1 49, 3, 1, 0, 0, 0, 0, ZERO,ZERO) GO TO 700 604 CALL XERRWD ('ODESSA - NEQ (=I1) .LT. 1', - 1 4, 1, 1, NEQ(1), 0, 0, ZERO,ZERO) + 1 25, 4, 1, 1, NEQ(1), 0, 0, ZERO,ZERO) GO TO 700 605 CALL XERRWD ('ODESSA - ISTATE = 3 AND NEQ CHANGED. (I1 TO I2)', - 1 5, 1, 2, N, NEQ(1), 0, ZERO,ZERO) + 1 48, 5, 1, 2, N, NEQ(1), 0, ZERO,ZERO) GO TO 700 606 CALL XERRWD ('ODESSA - ITOL (=I1) ILLEGAL', - 1 6, 1, 1, ITOL, 0, 0, ZERO,ZERO) + 1 27, 6, 1, 1, ITOL, 0, 0, ZERO,ZERO) GO TO 700 - 607 CALL XERRWD ('ODESSA - IOPT (=I1) ILLEGAL', - 1 7, 1, 1, IOPT, 0, 0, ZERO,ZERO) + 607 CALL XERRWD ('ODESSA - IOPT (=I1) ILLEGAL', + 1 27, 7, 1, 1, IOPT, 0, 0, ZERO,ZERO) GO TO 700 - 608 CALL XERRWD('ODESSA - MF (=I1) ILLEGAL', - 1 8, 1, 1, MF, 0, 0, ZERO,ZERO) + 608 CALL XERRWD('ODESSA - MF (=I1) ILLEGAL', + 1 25, 8, 1, 1, MF, 0, 0, ZERO,ZERO) GO TO 700 609 CALL XERRWD('ODESSA - ML (=I1) ILLEGAL.. .LT.0 OR .GE.NEQ (=I2)', - 1 9, 1, 2, ML, NEQ(1), 0, ZERO,ZERO) + 1 50, 9, 1, 2, ML, NEQ(1), 0, ZERO,ZERO) GO TO 700 610 CALL XERRWD('ODESSA - MU (=I1) ILLEGAL.. .LT.0 OR .GE.NEQ (=I2)', - 1 10, 1, 2, MU, NEQ(1), 0, ZERO,ZERO) + 1 50, 10, 1, 2, MU, NEQ(1), 0, ZERO,ZERO) GO TO 700 - 611 CALL XERRWD('ODESSA - MAXORD (=I1) .LT. 0', - 1 11, 1, 1, MAXORD, 0, 0, ZERO,ZERO) + 611 CALL XERRWD('ODESSA - MAXORD (=I1) .LT. 0', + 1 28, 11, 1, 1, MAXORD, 0, 0, ZERO,ZERO) GO TO 700 - 612 CALL XERRWD('ODESSA - MXSTEP (=I1) .LT. 0', - 1 12, 1, 1, MXSTEP, 0, 0, ZERO,ZERO) + 612 CALL XERRWD('ODESSA - MXSTEP (=I1) .LT. 0', + 1 28, 12, 1, 1, MXSTEP, 0, 0, ZERO,ZERO) GO TO 700 - 613 CALL XERRWD('ODESSA - MXHNIL (=I1) .LT. 0', - 1 13, 1, 1, MXHNIL, 0, 0, ZERO,ZERO) + 613 CALL XERRWD('ODESSA - MXHNIL (=I1) .LT. 0', + 1 28, 13, 1, 1, MXHNIL, 0, 0, ZERO,ZERO) GO TO 700 - 614 CALL XERRWD('ODESSA - TOUT (=R1) BEHIND T (=R2)', - 1 14, 1, 0, 0, 0, 2, TOUT, T) + 614 CALL XERRWD('ODESSA - TOUT (=R1) BEHIND T (=R2)', + 1 34, 14, 1, 0, 0, 0, 2, TOUT, T) CALL XERRWD('INTEGRATION DIRECTION IS GIVEN BY H0 (=R1)', - 1 14, 1, 0, 0, 0, 1, H0, ZERO) + 1 42, 14, 1, 0, 0, 0, 1, H0, ZERO) GO TO 700 - 615 CALL XERRWD('ODESSA - HMAX (=R1) .LT. 0.0', - 1 15, 1, 0, 0, 0, 1, HMAX, ZERO) + 615 CALL XERRWD('ODESSA - HMAX (=R1) .LT. 0.0', + 1 28, 15, 1, 0, 0, 0, 1, HMAX, ZERO) GO TO 700 - 616 CALL XERRWD('ODESSA - HMIN (=R1) .LT. 0.0', - 1 16, 1, 0, 0, 0, 1, HMIN, ZERO) + 616 CALL XERRWD('ODESSA - HMIN (=R1) .LT. 0.0', + 1 28, 16, 1, 0, 0, 0, 1, HMIN, ZERO) GO TO 700 617 CALL XERRWD('ODESSA - RWORK LENGTH NEEDED, LENRW (=I1), EXCEEDS - 1 LRW (=I2)', 17, 1, 2, LENRW, LRW, 0, ZERO,ZERO) + 1 LRW (=I2)', 60, 17, 1, 2, LENRW, LRW, 0, ZERO,ZERO) GO TO 700 618 CALL XERRWD('ODESSA - IWORK LENGTH NEEDED, LENIW (=I1), EXCEEDS - 1 LIW (=I2)', 18, 1, 2, LENIW, LIW, 0, ZERO,ZERO) + 1 LIW (=I2)', 60, 18, 1, 2, LENIW, LIW, 0, ZERO,ZERO) GO TO 700 - 619 CALL XERRWD('ODESSA - RTOL(I1) IS R1 .LT. 0.0', - 1 19, 1, 1, I, 0, 1, RTOLI, ZREO) + 619 CALL XERRWD('ODESSA - RTOL(I1) IS R1 .LT. 0.0', + 1 32, 19, 1, 1, I, 0, 1, RTOLI, ZREO) GO TO 700 - 620 CALL XERRWD('ODESSA - ATOL(I1) IS R1 .LT. 0.0', - 1 20, 1, 1, I, 0, 1, ATOLI, ZERO) + 620 CALL XERRWD('ODESSA - ATOL(I1) IS R1 .LT. 0.0', + 1 32, 20, 1, 1, I, 0, 1, ATOLI, ZERO) GO TO 700 * - 621 EWTI = RWORK(LEWT+I-1) + 621 EWTI = RWORK(LEWT+I-1) CALL XERRWD('ODESSA - EWT(I1) IS R1 .LE. 0.0', - 1 21, 1, 1, I, 0, 1, EWTI, ZERO) + 1 31, 21, 1, 1, I, 0, 1, EWTI, ZERO) GO TO 700 622 CALL XERRWD('ODESSA - TOUT (=R1) TOO CLOSE TO T(=R2) TO START - 1 INTEGRATION', 22, 1, 0, 0, 0, 2, TOUT, T) + 1 INTEGRATION', 60, 22, 1, 0, 0, 0, 2, TOUT, T) GO TO 700 623 CALL XERRWD('ODESSA - ITASK = I1 AND TOUT (=R1) BEHIND TCUR - HU - 1 (= R2)', 23, 1, 1, ITASK, 0, 2, TOUT, TP) + 1 (= R2)', 58, 23, 1, 1, ITASK, 0, 2, TOUT, TP) GO TO 700 624 CALL XERRWD('ODESSA - ITASK = 4 OR 5 AND TCRIT (=R1) BEHIND TCUR - 1 (=R2)', 24, 1, 0, 0, 0, 2, TCRIT, TN) + 1 (=R2)', 57, 24, 1, 0, 0, 0, 2, TCRIT, TN) GO TO 700 625 CALL XERRWD('ODESSA - ITASK = 4 OR 5 AND TCRIT (=R1) BEHIND TOUT - 1 (=R2)', 25, 1, 0, 0, 0, 2, TCRIT, TOUT) + 1 (=R2)', 57, 25, 1, 0, 0, 0, 2, TCRIT, TOUT) GO TO 700 626 CALL XERRWD('ODESSA - AT START OF PROBLEM, TOO MUCH ACCURACY', - 1 26, 1, 0, 0, 0, 0, ZERO,ZERO) + 1 47, 26, 1, 0, 0, 0, 0, ZERO,ZERO) CALL XERRWD('REQUESTED FOR PRECISION OF MACHINE. SEE TOLSF (=R1)', - 1 26, 1, 0, 0, 0, 1, TOLSF, ZERO) + 1 51, 26, 1, 0, 0, 0, 1, TOLSF, ZERO) RWORK(14) = TOLSF GO TO 700 627 CALL XERRWD 1 ('ODESSA - TROUBLE FROM ODESSA_INTDY. ITASK = I1, TOUT = R1', - 1 27, 1, 1, ITASK, 0, 1, TOUT, ZERO) + 1 57, 27, 1, 1, ITASK, 0, 1, TOUT, ZERO) GO TO 700 C ERROR STATEMENTS ASSOCIATED WITH SENSITIVITY ANALYSIS. 628 CALL XERRWD('ODESSA - NPAR (=I1) .LT. 1', - 1 28, 1, 1, NPAR, 0, 0, ZERO,ZERO) + 1 26, 28, 1, 1, NPAR, 0, 0, ZERO,ZERO) GO TO 700 629 CALL XERRWD('ODESSA - ISTATE = 3 AND NPAR CHANGED (I1 TO I2)', - 1 29, 1, 2, NP, NPAR, 0, ZERO,ZERO) + 1 47, 29, 1, 2, NP, NPAR, 0, ZERO,ZERO) GO TO 700 630 CALL XERRWD('ODESSA - MITER (=I1) ILLEGAL', - 1 30, 1, 1, MITER, 0, 0, ZERO,ZERO) + 1 28, 30, 1, 1, MITER, 0, 0, ZERO,ZERO) GO TO 700 631 CALL XERRWD('ODESSA - TROUBLE IN ODESSA_SPRIME (IERPJ)', - 1 31, 1, 0, 0, 0, 0, ZERO,ZERO) + 1 41, 31, 1, 0, 0, 0, 0, ZERO,ZERO) GO TO 700 632 CALL XERRWD('ODESSA - TROUBLE IN ODESSA_SPRIME (MITER)', - 1 32, 1, 0, 0, 0, 0, ZERO,ZERO) + 1 41, 32, 1, 0, 0, 0, 0, ZERO,ZERO) GO TO 700 633 CALL XERRWD('ODESSA - FATAL ERROR IN ODESSA_STODE (KFLAG = -3)', - 1 33, 2, 0, 0, 0, 0, ZERO,ZERO) + 1 49, 33, 2, 0, 0, 0, 0, ZERO,ZERO) GO TO 801 C - 700 IF (ILLIN .EQ. 5) GO TO 710 + 700 IF (ILLIN .EQ. 5) GO TO 710 ILLIN = ILLIN + 1 ISTATE = -3 RETURN 710 CALL XERRWD('ODESSA - REPEATED OCCURRENCES OF ILLEGAL INPUT', - 1 302, 1, 0, 0, 0, 0, ZERO,ZERO) + 1 46, 302, 1, 0, 0, 0, 0, ZERO,ZERO) C 800 CALL XERRWD('ODESSA - RUN ABORTED.. APPARENT INFINITE LOOP', - 1 303, 2, 0, 0, 0, 0, ZERO,ZERO) + 1 45, 303, 2, 0, 0, 0, 0, ZERO,ZERO) RETURN 801 CALL XERRWD('ODESSA - RUN ABORTED', - 1 304, 2, 0, 0, 0, 0, ZERO,ZERO) + 1 20, 304, 2, 0, 0, 0, 0, ZERO,ZERO) RETURN C-------------------- END OF SUBROUTINE ODESSA ------------------------- END
--- a/libcruft/odessa/odessa_intdy.f +++ b/libcruft/odessa/odessa_intdy.f @@ -61,13 +61,13 @@ RETURN C 80 CALL XERRWD('ODESSA_INTDY-- K (=I1) ILLEGAL', - 1 51, 1, 1, K, 0, 0, ZERO,ZERO) + 1 31, 51, 1, 1, K, 0, 0, ZERO,ZERO) IFLAG = -1 RETURN 90 CALL XERRWD ('ODESSA_INTDY-- T (=R1) ILLEGAL', - 1 52, 1, 0, 0, 0, 1, T, ZERO) + 1 31, 52, 1, 0, 0, 0, 1, T, ZERO) CALL XERRWD('T NOT IN INTERVAL TCUR - HU (= R1) TO TCUR (=R2)', - 1 52, 1, 0, 0, 0, 2, TP, TN) + 1 48, 52, 1, 0, 0, 0, 2, TP, TN) IFLAG = -2 RETURN C------------------ END OF SUBROUTINE ODESSA_INTDY -----------------------
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2002-10-31 John W. Eaton <jwe@bevo.che.wisc.edu> + + * mx-inlines.cc (MX_BASE_REDUCTION_OP): Also return scalar + MT_RESULT if nr == 1 && nc == 0 && dim == -1 (i.e., + sum(zeros(1,0)) returns 0, not [](1x0)). + 2002-10-30 John W. Eaton <jwe@bevo.che.wisc.edu> * Makefile.in (LINK_DEPS): Include $(FLIBS) here too.
--- a/liboctave/mx-inlines.cc +++ b/liboctave/mx-inlines.cc @@ -303,17 +303,14 @@ } \ } \ } \ - else if (nr == 0 && nc == 0) \ - { \ - retval.resize (1, 1); \ - retval.elem (0, 0) = MT_RESULT; \ - } \ + else if (nc == 0 && (nr == 0 || (nr == 1 && dim == -1))) \ + retval.resize (1, 1, MT_RESULT); \ else if (nr == 0 && (dim == 0 || dim == -1)) \ retval.resize (1, nc, MT_RESULT); \ else if (nc == 0 && dim == 1) \ retval.resize (nr, 1, MT_RESULT); \ else \ - retval.resize (nr, nc); \ + retval.resize (nr > 0, nc > 0); \ \ return retval
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2002-10-31 John W. Eaton <jwe@bevo.che.wisc.edu> + + * control/base/analdemo.m: Fix typo. + 2002-10-31 Francesco Potorti` <pot@gnu.org> * statistics/distributions/discrete_pdf.m: Fix typo.
--- a/scripts/control/base/analdemo.m +++ b/scripts/control/base/analdemo.m @@ -71,7 +71,7 @@ clc disp("Example #2, consider the continuous state space system:\n"); - a=[1, 3, -10.2; 3.7, -2, 9; n1, 3, 7] + a=[1, 3, -10.2; 3.7, -2, 9; 1, 3, 7] b=[1, 12; 6, 2; -3.8, 7] c=[1, -1.1, 7; 3, -9.8, 2] d=0
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2002-10-31 John W. Eaton <jwe@bevo.che.wisc.edu> + + * DLD-FUNCTIONS/fsolve.cc (fsolve_user_function): Print warning if + + * Makefile.in (%.oct): Depend on octave$(EXEEXT) so that octave + will be built before any .oct files. + (all): Depend on stamp-oct-links. + (octave$(EXEEXT)): Don't depend on stamp-oct-links. + + * ov-base.cc (octave_base_value::subsasgn): Handle default numeric + case here. + * ov-base-mat.cc (octave_base_matrix<MT>::subsasgn): Delete. + 2002-10-30 John W. Eaton <jwe@bevo.che.wisc.edu> * Makefile.in (OCT_LINK_DEPS): Add $(BLAS_LIBS), $(FFTW_LIBS), and
--- a/src/DLD-FUNCTIONS/fsolve.cc +++ b/src/DLD-FUNCTIONS/fsolve.cc @@ -46,6 +46,9 @@ // Global pointer for user defined function required by hybrd1. static octave_function *fsolve_fcn; +// Have we warned about imaginary values returned from user function? +static bool warned_imaginary = false; + // Is this a recursive call? static int call_depth = 0; @@ -111,8 +114,15 @@ if (fsolve_fcn) { octave_value_list tmp = fsolve_fcn->do_multi_index_op (1, args); + if (tmp.length () > 0 && tmp(0).is_defined ()) { + if (! warned_imaginary && tmp(0).is_complex_type ()) + { + warning ("fsolve: ignoring imaginary part returned from user-supplied function"); + warned_imaginary = true; + } + retval = ColumnVector (tmp(0).vector_value ()); if (error_state || retval.length () <= 0) @@ -162,6 +172,8 @@ { octave_value_list retval; + warned_imaginary = false; + unwind_protect::begin_frame ("Ffsolve"); unwind_protect_int (call_depth);
--- a/src/Makefile.in +++ b/src/Makefile.in @@ -31,10 +31,10 @@ ifeq ($(ENABLE_DYNAMIC_LINKING), true) ifdef CXXPICFLAG - %.oct : pic/%.o + %.oct : pic/%.o octave$(EXEEXT) $(SH_LD) $(SH_LDFLAGS) -o $@ $< $(OCT_LINK_DEPS) else - %.oct : %.o + %.oct : %.o octave$(EXEEXT) $(SH_LD) $(SH_LDFLAGS) -o $@ $< $(OCT_LINK_DEPS) endif endif @@ -220,7 +220,7 @@ BINDISTFILES = octave $(OCT_FILES) endif -all: octave$(EXEEXT) DOCSTRINGS +all: octave$(EXEEXT) stamp-oct-links DOCSTRINGS .PHONY: all objects: $(OBJECTS) @@ -271,8 +271,7 @@ stamp-prereq: defaults.h oct-conf.h $(OPT_HANDLERS) touch stamp-prereq -octave$(EXEEXT): stamp-prereq $(LIBRARIES) stamp-oct-links \ - main.o $(DLD_STATIC_OBJ) +octave$(EXEEXT): stamp-prereq $(LIBRARIES) main.o $(DLD_STATIC_OBJ) $(LD_CXX) $(CPPFLAGS) $(ALL_CXXFLAGS) $(RDYNAMIC_FLAG) \ $(ALL_LDFLAGS) -o $@ \ main.o $(XERBLA) $(DLD_STATIC_OBJ) \
--- a/src/ov-base.cc +++ b/src/ov-base.cc @@ -103,8 +103,40 @@ if (is_defined ()) { - std::string nm = type_name (); - error ("can't perform indexed assignment for %s type", nm.c_str ()); + if (is_numeric_type ()) + { + switch (type[0]) + { + case '(': + { + if (type.length () == 1) + retval = numeric_assign (type, idx, rhs); + else + { + std::string nm = type_name (); + error ("in indexed assignment of %s, last rhs index must be ()", + nm.c_str ()); + } + } + break; + + case '{': + case '.': + { + std::string nm = type_name (); + error ("%s cannot be indexed with %c", nm.c_str (), type[0]); + } + break; + + default: + panic_impossible (); + } + } + else + { + std::string nm = type_name (); + error ("can't perform indexed assignment for %s type", nm.c_str ()); + } } else {
--- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2002-10-31 John W. Eaton <jwe@bevo.che.wisc.edu> + + * octave.test/arith/prod-4.m, octave.test/arith/sum-4.m: + Cover more cases for empty matrices. + 2002-10-15 Paul Kienzle <pkienzle@users.sf.net> * Makefile.in: Use @library_path_var@ instead of LD_LIBRARY_PATH.
--- a/test/octave.test/arith/prod-4.m +++ b/test/octave.test/arith/prod-4.m @@ -1,2 +1,14 @@ (all (prod ([1, 2; 3, 4], 1) == [3, 8]) - && all (prod ([1, 2; 3, 4], 2) == [2; 12])) + && all (prod ([1, 2; 3, 4], 2) == [2; 12]) + && prod (zeros (1, 0)) == 1 + && all (size (prod (zeros (1, 0), 1)) == [1, 0]) + && prod (zeros (1, 0), 2) == 1 + && prod (zeros (0, 1)) == 1 + && prod (zeros (0, 1), 1) == 1 + && all (size (prod (zeros (0, 1), 2)) == [0, 1]) + && all (size (prod (zeros (2, 0))) == [1, 0]) + && all (size (prod (zeros (2, 0), 1)) == [1, 0]) + && all (prod (zeros (2, 0), 2) == [1; 1]) + && all (prod (zeros (0, 2)) == [1, 1]) + && all (prod (zeros (0, 2), 1) == [1, 1]) + && all (size (prod (zeros (0, 2), 2)) == [0, 1]))
--- a/test/octave.test/arith/sum-4.m +++ b/test/octave.test/arith/sum-4.m @@ -1,2 +1,14 @@ (all (sum ([1, 2; 3, 4], 1) == [4, 6]) - && all (sum ([1, 2; 3, 4], 2) == [3; 7])) + && all (sum ([1, 2; 3, 4], 2) == [3; 7]) + && sum (zeros (1, 0)) == 0 + && all (size (sum (zeros (1, 0), 1)) == [1, 0]) + && sum (zeros (1, 0), 2) == 0 + && sum (zeros (0, 1)) == 0 + && sum (zeros (0, 1), 1) == 0 + && all (size (sum (zeros (0, 1), 2)) == [0, 1]) + && all (size (sum (zeros (2, 0))) == [1, 0]) + && all (size (sum (zeros (2, 0), 1)) == [1, 0]) + && all (sum (zeros (2, 0), 2) == [0; 0]) + && all (sum (zeros (0, 2)) == [0, 0]) + && all (sum (zeros (0, 2), 1) == [0, 0]) + && all (size (sum (zeros (0, 2), 2)) == [0, 1]))