************************************************************************ * PROGRAM TMINU * * TEST PROGRAM FOR THE SUBROUTINE PMINU * INTEGER NADD,NDECF,NEXT,NFG,NFH,NFV,NIT,NRED,NREM,NRES DOUBLE PRECISION F,FMIN,GMAX INTEGER I,IERR,IEXT,IPRNT,ITERM,ITIME,NA,NF DOUBLE PRECISION AF(200),RPAR(6),X(40) INTEGER IPAR(5) INTEGER NITER,NFVAL,NSUCC COMMON /PROB/NEXT COMMON /STAT/NDECF,NRES,NRED,NREM,NADD,NIT,NFV,NFG,NFH NITER=0 NFVAL=0 NSUCC=0 CALL TYTIM1(ITIME) * * LOOP FOR 25 TEST PROBLEMS * DO 30 NEXT = 1,25 * * CHOICE OF INTEGER AND REAL PARAMETERS * DO 10 I = 1,5 IPAR(I) = 0 10 CONTINUE DO 20 I = 1,6 RPAR(I) = 0.0D0 20 CONTINUE IPAR(3) = 2 IPRNT = 1 * * PROBLEM DIMENSION * NF = 20 NA = 65 * * INITIATION OF X AND CHOICE OF RPAR(1) * CALL TIUD06(NF,NA,X,FMIN,RPAR(1),NEXT,IEXT,IERR) IF (IERR.NE. 0) GO TO 30 IF (NEXT.EQ.23) RPAR(1)=1.0D 1 * * SOLUTION * CALL PMINU(NF,NA,X,AF,IPAR,RPAR,F,GMAX,IEXT,IPRNT,ITERM) NITER=NITER+NIT NFVAL=NFVAL+NFV IF (ITERM.GT.0.AND.ITERM.LT.9) NSUCC=NSUCC+1 30 CONTINUE WRITE(6,50) NITER,NFVAL,NSUCC 50 FORMAT(' NITER =',I5,3X,' NFVAL =',I5,3X,' NSUCC =',I5) CALL TYTIM2(ITIME) STOP END * * USER SUPPLIED SUBROUTINE (CALCULATION OF FA) * SUBROUTINE FUN(NF,KA,X,FA) * * FUNCTION EVALUATION * DOUBLE PRECISION FA INTEGER KA,NF DOUBLE PRECISION X(*) INTEGER NEXT EXTERNAL TAFU06 COMMON /PROB/NEXT CALL TAFU06(NF,KA,X,FA,NEXT) RETURN END * * USER SUPPLIED SUBROUTINE (CALCULATION OF GA) * SUBROUTINE DER(NF,KA,X,GA) * * GRADIENT EVALUATION * INTEGER KA,NF DOUBLE PRECISION GA(*),X(*) INTEGER NEXT EXTERNAL TAGU06 COMMON /PROB/NEXT CALL TAGU06(NF,KA,X,GA,NEXT) RETURN END * * EMPTY SUBROUTINES * SUBROUTINE FUNDER(NF,X,F,G) DOUBLE PRECISION F INTEGER NF DOUBLE PRECISION G(*),X(*) NF=1 F=X(1) G(1)=X(1) RETURN END SUBROUTINE HES(NF,X,H) INTEGER NF DOUBLE PRECISION H(*),X(*) NF=1 H(1)=X(1) RETURN END ************************************************************************ * PROGRAM TMINL * * TEST PROGRAM FOR THE SUBROUTINE PMINL * INTEGER NADD,NDECF,NEXT,NFG,NFH,NFV,NIT,NRED,NREM,NRES DOUBLE PRECISION F,FMIN,GMAX INTEGER I,IERR,IEXT,IPRNT,ITERM,ITIME,NA,NB,NC,NF DOUBLE PRECISION AF(200),CF(20),CG(300),CL(20),CU(20), + RPAR(6),X(40),XL(40),XU(40) INTEGER IC(20),IPAR(5),IX(40) INTEGER NITER,NFVAL,NSUCC COMMON /PROB/NEXT COMMON /STAT/NDECF,NRES,NRED,NREM,NADD,NIT,NFV,NFG,NFH NITER=0 NFVAL=0 NSUCC=0 CALL TYTIM1(ITIME) * * LOOP FOR 15 TEST PROBLEMS * DO 30 NEXT = 1,15 * * CHOICE OF INTEGER AND REAL PARAMETERS * DO 10 I = 1,5 IPAR(I) = 0 10 CONTINUE DO 20 I = 1,6 RPAR(I) = 0.0D 0 20 CONTINUE IPRNT = 1 * * PROBLEM DIMENSION * NF = 20 NA = 165 NB = 20 NC = 15 * * INITIATION OF X AND CHOICE OF RPAR(1) * CALL TILD22(NF,NA,NB,NC,X,IX,XL,XU,IC,CL,CU,CG,FMIN,RPAR(1), + NEXT,IEXT,IERR) IF (IERR.NE. 0) GO TO 30 IF (NEXT.EQ.11) RPAR(1) = 1.0D-3 * * SOLUTION * CALL PMINL(NF,NA,NB,NC,X,IX,XL,XU,CF,IC,CL,CU,CG,AF, + IPAR,RPAR,F,GMAX,IEXT,IPRNT,ITERM) NITER=NITER+NIT NFVAL=NFVAL+NFV IF (ITERM.GT.0.AND.ITERM.LT.9) NSUCC=NSUCC+1 30 CONTINUE WRITE(6,50) NITER,NFVAL,NSUCC 50 FORMAT(' NITER =',I5,3X,' NFVAL =',I5,3X,' NSUCC =',I5) CALL TYTIM2(ITIME) STOP END * * USER SUPPLIED SUBROUTINE (CALCULATION OF FA) * SUBROUTINE FUN(NF,KA,X,FA) * * FUNCTION EVALUATION * DOUBLE PRECISION FA INTEGER KA,NF DOUBLE PRECISION X(*) INTEGER NEXT EXTERNAL TAFU22 COMMON /PROB/NEXT CALL TAFU22(NF,KA,X,FA,NEXT) RETURN END * * USER SUPPLIED SUBROUTINE (CALCULATION OF GA) * SUBROUTINE DER(NF,KA,X,GA) * * GRADIENT EVALUATION * INTEGER KA,NF DOUBLE PRECISION GA(*),X(*) INTEGER NEXT EXTERNAL TAGU22 COMMON /PROB/NEXT CALL TAGU22(NF,KA,X,GA,NEXT) RETURN END * * EMPTY SUBROUTINES * SUBROUTINE FUNDER(NF,X,F,G) DOUBLE PRECISION F INTEGER NF DOUBLE PRECISION G(*),X(*) NF=1 F=X(1) G(1)=X(1) RETURN END SUBROUTINE HES(NF,X,H) INTEGER NF DOUBLE PRECISION H(*),X(*) NF=1 H(1)=X(1) RETURN END 