************************************************************************ C PROGRAM TGACU C C TEST PROGRAM FOR THE SUBROUTINE PGACU C INTEGER NF,NA,MA,IAG(6001),JAG(15000),IPAR(7),IDER,ISPAS,IPRNT, & ITERM DOUBLE PRECISION X(1000),AF(6000),RPAR(9),F,GMAX INTEGER NEXT,IERR,I,ITIME INTEGER NITER,NFVAL,NGVAL,NSUCC,NITCG COMMON /PROB/ NEXT INTEGER NRES,NDEC,NIN,NIT,NFV,NFG,NFH COMMON /STAT/ NRES,NDEC,NIN,NIT,NFV,NFG,NFH NITER=0 NFVAL=0 NGVAL=0 NSUCC=0 NITCG=0 CALL TYTIM1(ITIME) C C LOOP FOR 22 TEST PROBLEMS C DO 3 NEXT=1,22 C C CHOICE OF INTEGER AND REAL PARAMETERS C DO 1 I=1,7 IPAR(I)=0 1 CONTINUE DO 2 I=1,9 RPAR(I)=0.0D 0 2 CONTINUE IDER=1 ISPAS=2 IPRNT=1 C C PROBLEM DIMENSION C NF=1000 NA=6000 C C INITIATION OF X AND CHOICE OF RPAR(1) AND RPAR(6) C CALL TIUB15(NF,NA,MA,X,IAG,JAG,RPAR(6),RPAR(1),NEXT,IERR) IF (IERR.NE.0) GO TO 3 RPAR(1)=0.0D0 IF (NEXT.EQ.7) RPAR(1)=1.0D1 C C SOLUTION C CALL PGACU(NF,NA,MA,X,AF,IAG,JAG,IPAR,RPAR,F,GMAX,IDER,ISPAS, & IPRNT,ITERM) NITER=NITER+NIT NFVAL=NFVAL+NFV NGVAL=NGVAL+NFG NITCG=NITCG+NIN IF (ITERM.GT.0.AND.ITERM.LT.9) NSUCC=NSUCC+1 3 CONTINUE WRITE(6,10) NITER,NFVAL,NGVAL,NITCG,NSUCC 10 FORMAT(' NITER =',I5,3X,' NFVAL =',I5,3X,' NGVAL =',I5,3X, & ' NITCG =',I5,3X,' NSUCC =',I5) CALL TYTIM2(ITIME) STOP END C C USER SUPPLIED SUBROUTINE (CALCULATION OF FA) C SUBROUTINE FUN(NF,KA,X,FA) INTEGER NF,KA DOUBLE PRECISION X(*),FA INTEGER NEXT COMMON /PROB/ NEXT C C FUNCTION EVALUATION C CALL TAFU15(NF,KA,X,FA,NEXT) RETURN END C C USER SUPPLIED SUBROUTINE (CALCULATION OF GA) C SUBROUTINE DFUN(NF,KA,X,GA) INTEGER NF,KA DOUBLE PRECISION X(*),GA(*) INTEGER NEXT COMMON /PROB/ NEXT C C GRADIENT EVALUATION C CALL TAGU15(NF,KA,X,GA,NEXT) RETURN END C C EMPTY SUBROUTINES C SUBROUTINE OBJ(NF,X,FF) INTEGER NF DOUBLE PRECISION X(*),FF NF=1 FF=X(1) END SUBROUTINE DOBJ(NF,X,GF) INTEGER NF DOUBLE PRECISION X(*),GF(*) NF=1 GF(1)=X(1) RETURN END ************************************************************************ C PROGRAM TGACS C C TEST PROGRAM FOR THE SUBROUTINE PGACS C INTEGER NF,NA,MA,IX(1000),IAG(6001),JAG(15000),IPAR(7),IDER, & ISPAS,IPRNT,ITERM DOUBLE PRECISION X(1000),XL(1000),XU(1000),AF(6000),RPAR(9), & F,GMAX INTEGER NEXT,IERR,I,ITIME INTEGER NITER,NFVAL,NGVAL,NSUCC,NITCG COMMON /PROB/ NEXT INTEGER NRES,NDEC,NIN,NIT,NFV,NFG,NFH COMMON /STAT/ NRES,NDEC,NIN,NIT,NFV,NFG,NFH NITER=0 NFVAL=0 NGVAL=0 NSUCC=0 NITCG=0 CALL TYTIM1(ITIME) C C LOOP FOR 22 TEST PROBLEMS C DO 3 NEXT=1,22 C C CHOICE OF INTEGER AND REAL PARAMETERS C DO 1 I=1,7 IPAR(I)=0 1 CONTINUE IPAR(5)= 1 DO 2 I=1,9 RPAR(I)=0.0D 0 2 CONTINUE IDER=1 ISPAS=2 IPRNT=1 C C PROBLEM DIMENSION C NF=1000 NA=6000 C C INITIATION OF X AND CHOICE OF RPAR(1) AND RPAR(6) C CALL TIUB15(NF,NA,MA,X,IAG,JAG,RPAR(6),RPAR(1),NEXT,IERR) IF (IERR.NE.0) GO TO 3 CALL MXVINS(NF,3,IX) CALL MXVSET(NF,-1.0D 0,XL) CALL MXVSET(NF, 1.0D 0,XU) RPAR(1)=0.0D 0 IF (NEXT.EQ. 2) RPAR(1)=1.0D 3 IF (NEXT.EQ. 5) RPAR(1)=1.0D 1 IF (NEXT.EQ.12) RPAR(1)=3.0D 1 IF (NEXT.EQ.17) RPAR(1)=3.0D 0 IF (NEXT.EQ.18) RPAR(1)=1.0D 1 IF (NEXT.EQ.21) RPAR(1)=2.0D 1 C C SOLUTION C CALL PGACS(NF,NA,MA,X,IX,XL,XU,AF,IAG,JAG,IPAR,RPAR,F,GMAX,IDER, & ISPAS,IPRNT,ITERM) NITER=NITER+NIT NFVAL=NFVAL+NFV NGVAL=NGVAL+NFG NITCG=NITCG+NIN IF (ITERM.GT.0.AND.ITERM.LT.9) NSUCC=NSUCC+1 3 CONTINUE WRITE(6,10) NITER,NFVAL,NGVAL,NITCG,NSUCC 10 FORMAT(' NITER =',I5,3X,' NFVAL =',I5,3X,' NGVAL =',I5,3X, & ' NITCG =',I5,3X,' NSUCC =',I5) CALL TYTIM2(ITIME) STOP END C C USER SUPPLIED SUBROUTINE (CALCULATION OF FA) C SUBROUTINE FUN(NF,KA,X,FA) INTEGER NF,KA DOUBLE PRECISION X(*),FA INTEGER NEXT COMMON /PROB/ NEXT C C FUNCTION EVALUATION C CALL TAFU15(NF,KA,X,FA,NEXT) RETURN END C C USER SUPPLIED SUBROUTINE (CALCULATION OF GA) C SUBROUTINE DFUN(NF,KA,X,GA) INTEGER NF,KA DOUBLE PRECISION X(*),GA(*) INTEGER NEXT COMMON /PROB/ NEXT C C GRADIENT EVALUATION C CALL TAGU15(NF,KA,X,GA,NEXT) RETURN END C C EMPTY SUBROUTINES C SUBROUTINE OBJ(NF,X,FF) INTEGER NF DOUBLE PRECISION X(*),FF NF=1 FF=X(1) END SUBROUTINE DOBJ(NF,X,GF) INTEGER NF DOUBLE PRECISION X(*),GF(*) NF=1 GF(1)=X(1) RETURN END 