* SUBROUTINE TIUS20 ALL SYSTEMS 94/12/01 C PORTABILITY : ALL SYSTEMS C 94/12/01 LU : ORIGINAL VERSION * * PURPOSE : * INITIATION OF VARIABLES AND DEFINITION OF STRUCTURE OF THE SPARSE * HESSIAN MATRIX FOR THE GENERAL OBJECTIVE FUNCTION. * * PARAMETERS : * IU N NUMBER OF VARIABLES. * IU M NUMBER OF ELEMENTS OF THE SPARSE HESSIAN MATRIX. * RO X(N) VECTOR OF VARIABLES. * IO IH(N+1) POINTERS OF THE DIAGONAL ELEMENTS OF THE HESSIAN MATRIX. * IO JH(M) INDICES OF THE NONZERO ELEMENTS OF THE HESSIAN MATRIX IN * THE PACKED ROW. * RO FMIN LOWER BOUND FOR THE OBJECTIVE FUNCTION. * RO XMAX MAXIMUM STEPSIZE. * II NEXT NUMBER OF THE TEST PROBLEM. * IO IERR ERROR INDICATOR. * SUBROUTINE TIUS20(N,M,X,IH,JH,FMIN,XMAX,NEXT,IERR) INTEGER N,M,NEXT,IERR INTEGER IH(*),JH(*) DOUBLE PRECISION X(N),FMIN,XMAX INTEGER I,J,K,L,K1,K2,M1 FMIN=0.0D 0 XMAX=1.0D 3 IERR=0 1 GOTO (10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170, & 170), NEXT 10 IF(N.LT.2) GO TO 999 N=N-MOD(N,2) DO 11 I=1,N IF(MOD(I,2).EQ.1) THEN X(I)=-1.2D 0 ELSE X(I)=1.0D 0 END IF 11 CONTINUE DO 12 I=1,N-1 J=2*(I-1)+1 IH(I)=J JH(J)=I JH(J+1)=I+1 12 CONTINUE J=2*(N-1)+1 IH(N)=J JH(J)=N IH(N+1)=2*N M=2*N-1 RETURN 20 IF(N.LT.8) GO TO 999 N=N-MOD(N,2) DO 21 I=1,N IF(MOD(I,2).EQ.1) THEN X(I)=-2.0D 0 ELSE X(I)= 1.0D 0 END IF 21 CONTINUE DO 22 I=1,N-1 J=2*I-1 IH(I)=J JH(J)=I JH(J+1)=I+1 IF(MOD(I,2).EQ.0) JH(J+1)=JH(J+1)+1 22 CONTINUE J=2*N-1 IH(N)=J JH(J)=N M=J IH(N+1)=J+1 XMAX=1.0D 1 RETURN 30 IF(N.LT.4) GO TO 999 N=N-MOD(N,2) DO 31 I=1,N IF(MOD(I,4).EQ.1) THEN X(I)=3.0D 0 ELSE IF(MOD(I,4).EQ.2) THEN X(I)=-1.0D 0 ELSE IF(MOD(I,4).EQ.3) THEN X(I)=0.0D 0 ELSE X(I)=1.0D 0 END IF 31 CONTINUE IH(1)=1 IH(2)=4 JH(1)=1 JH(2)=2 JH(3)=4 JH(4)=2 JH(5)=3 K=5 DO 33 I=3,N-3,2 IH(I)=IH(I-2)+5 J=IH(I) DO 32 L=J,J+4 JH(L)=JH(L-5)+2 K=K+1 32 CONTINUE IH(I+1)=IH(I-1)+5 33 CONTINUE IH(N-1)=IH(N-3)+5 IH(N)=IH(N-2)+4 IH(N+1)=IH(N)+1 JH(K+1)=JH(K) JH(K+2)=JH(K)+1 JH(K+3)=JH(K+2) M=IH(N) RETURN 40 IF(N.LT.4) GO TO 999 N=N-MOD(N,2) DO 41 I=1,N X(I)=2.0D 0 IF (MOD(I,4).EQ.1) X(I)=1.0D 0 41 CONTINUE DO 42 I=1,N-1 IH(I)=2*I-1 J=IH(I) JH(J)=I JH(J+1)=I+1 42 CONTINUE IH(N)=2*N-1 JH(J+2)=JH(J+1) IH(N+1)=2*N M=IH(N) RETURN 50 IF (N.LT.3) GO TO 999 DO 51 I=1,N X(I)=-1.0D 0 51 CONTINUE 52 DO 53 I=1,N-2 J=1+3*(I-1) IH(I)=J JH(J)=I JH(J+1)=I+1 JH(J+2)=I+2 53 CONTINUE J=3*(N-2)+1 IH(N-1)=J JH(J)=N-1 JH(J+1)=N J=IH(N-1)+2 IH(N)=J JH(J)=N IH(N+1)=IH(N)+1 M=3*N-3 RETURN 60 IF (N.LT.7) GO TO 999 N=N-1+MOD(N,2) DO 61 I=1,N X(I)=3.0D 0 61 CONTINUE DO 62 I=1,N-6 J=7*(I-1)+1 IH(I)=J JH(J)=I JH(J+1)=I+1 JH(J+2)=I+2 JH(J+3)=I+3 JH(J+4)=I+4 JH(J+5)=I+5 JH(J+6)=I+6 62 CONTINUE J=7*(N-6)+1 IH(N-5)=J JH(J)=N-5 JH(J+1)=N-4 JH(J+2)=N-3 JH(J+3)=N-2 JH(J+4)=N-1 JH(J+5)=N IH(N-4)=J+6 JH(J+6)=N-4 JH(J+7)=N-3 JH(J+8)=N-2 JH(J+9)=N-1 JH(J+10)=N IH(N-3)=J+11 JH(J+11)=N-3 JH(J+12)=N-2 JH(J+13)=N-1 JH(J+14)=N IH(N-2)=J+15 JH(J+15)=N-2 JH(J+16)=N-1 JH(J+17)=N IH(N-1)=J+18 JH(J+18)=N-1 JH(J+19)=N IH(N)=J+20 JH(J+20)=N IH(N+1)=J+21 M=J+20 XMAX=1.0D 1 RETURN 70 IF(N.LT.2) GO TO 999 DO 71 I=1,N X(I)=1.0D 0 71 CONTINUE GO TO 52 80 IF(N.LT.5) GO TO 999 N=N-MOD(N,5) DO 81 I=1,N IF(MOD(I,2).EQ.1) THEN X(I)=-1.0D 0 ELSE X(I)= 2.0D 0 END IF 81 CONTINUE IH(1)=1 K=1 DO 83 I=1,N,5 M1=I K1=I K2=I+4 DO 84 M=1,5 DO 85 J=K1,K2 JH(K)=J K=K+1 85 CONTINUE K1=K1+1 M1=M1+1 IH(M1)=6-M+IH(M1-1) 84 CONTINUE 83 CONTINUE M=IH(N) XMAX=2.0D 0 RETURN 90 IF(N.LT.2) GO TO 999 N=N-MOD(N,2) DO 91 I=1,N X(I)=-1.0D 0 91 CONTINUE J=0 DO 92 I=1,N-1,2 IH(I)=J+1 IH(I+1)=J+3 JH(J+1)=I JH(J+2)=I+1 JH(J+3)=I+1 J=J+3 92 CONTINUE M=J IH(N+1)=M+1 XMAX=1.0D 1 RETURN 100 IF(N.LT.2) GO TO 999 N=N-MOD(N,2) DO 101 I=2,N,2 X(I-1)=-1.0D 0 X(I)=1.0D 0 101 CONTINUE J=0 DO 102 I=1,N-1,2 IH(I)=J+1 IH(I+1)=J+3 JH(J+1)=I JH(J+2)=I+1 JH(J+3)=I+1 J=J+3 102 CONTINUE M=J IH(N+1)=M+1 XMAX=1.0D 1 RETURN 110 IF (N.LT.5) GO TO 999 N=N-MOD(N-2,3) DO 111 I=1,N IF (MOD(I,3).EQ.1) X(I)=2.0D 0 IF (MOD(I,3).EQ.2) X(I)=1.5D 0 IF (MOD(I,3).EQ.0) X(I)=0.5D 0 111 CONTINUE 112 J=1 DO 113 I=1,N-2 IH(I)=J JH(J)=I J=J+1 IF (MOD(I,3).EQ.1) THEN JH(J)=I+1 J=J+1 END IF 113 CONTINUE JH(J)=N-1 JH(J+1)=N IH(N-1)=J IH(N)=J+1 M=J+1 IH(N+1)=M+1 RETURN 120 IF (N.LT.5) GO TO 999 N=N-MOD(N-1,4) DO 121 I=1,N IF (MOD(I,4).EQ.1) X(I)= 2.0D 0 IF (MOD(I,4).EQ.2) X(I)= 1.5D 0 IF (MOD(I,4).EQ.3) X(I)=-1.0D 0 IF (MOD(I,4).EQ.0) X(I)= 0.5D 0 121 CONTINUE 122 J=1 DO 123 I=1,N-1 IH(I)=J JH(J)=I JH(J+1)=I+1 J=J+2 123 CONTINUE JH(J)=N IH(N)=J M=J IH(N+1)=M+1 RETURN 130 IF (N.LT.5) GO TO 999 N=N-MOD(N-2,3) DO 131 I=1,N IF (MOD(I,3).EQ.1) X(I)= 3.0D 0 IF (MOD(I,3).EQ.2) X(I)= 5.0D 0 IF (MOD(I,3).EQ.0) X(I)=-3.0D 0 131 CONTINUE JH(1)=1 JH(2)=2 JH(3)=3 JH(4)=3 IH(1)=1 IH(2)=2 IH(3)=4 J=5 DO 132 I=4,N-1 IH(I)=J JH(J)=I J=J+1 IF (MOD(I,3).NE.0) THEN JH(J)=I+1 J=J+1 END IF 132 CONTINUE JH(J)=N IH(N)=J M=J IH(N+1)=M+1 RETURN 140 IF (N.LT.5) GO TO 999 N=N-MOD(N-2,3) DO 141 I=1,N IF (MOD(I,3).EQ.1) X(I)= 1.0D 1 IF (MOD(I,3).EQ.2) X(I)= 7.0D 0 IF (MOD(I,3).EQ.0) X(I)=-3.0D 0 141 CONTINUE GO TO 112 150 IF (N.LT.5) GO TO 999 N=N-MOD(N-1,4) DO 151 I=1,N IF (MOD(I,4).EQ.1) X(I)= 3.5D 1 IF (MOD(I,4).EQ.2) X(I)= 1.1D 1 IF (MOD(I,4).EQ.3) X(I)= 5.0D 0 IF (MOD(I,4).EQ.0) X(I)=-5.0D 0 151 CONTINUE GO TO 122 160 IF (N.LT.5) GO TO 999 N=N-MOD(N-1,4) DO 161 I=1,N IF (MOD(I,4).EQ.1) X(I)= 2.5D 0 IF (MOD(I,4).EQ.2) X(I)= 0.5D 0 IF (MOD(I,4).EQ.3) X(I)= 2.0D 0 IF (MOD(I,4).EQ.0) X(I)=-1.0D 0 161 CONTINUE 162 J=1 DO 163 I=1,N-1 IH(I)=J JH(J)=I J=J+1 IF (MOD(I,4).EQ.1.OR.MOD(I,4).EQ.2) THEN JH(J)=I+1 J=J+1 END IF 163 CONTINUE JH(J)=N IH(N)=J M=J IH(N+1)=M+1 RETURN 170 IF (N.LT.5) GO TO 999 N=N-MOD(N-1,4) DO 171 I=1,N X(I)=2.0D 0 171 CONTINUE GO TO 162 999 IERR=1 RETURN END * SUBROUTINE TINS20 ALL SYSTEMS 94/12/01 C PORTABILITY : ALL SYSTEMS C 94/12/01 LU : ORIGINAL VERSION * * PURPOSE : * DEFINITION OF STRUCTURE OF THE SPARSE JACOBIAN MATRIX FOR * CONSTRAINTS. * * PARAMETERS : * IU N NUMBER OF VARIABLES. * IU NC NUMBER OF CONSTRAINTS. * IU MC NUMBER OF ELEMENTS OF THE SPARSE JACOBIAN MATRIX. * IO IC(NC+1) POINTERS OF FIRST IN THE ROW ELEMENTS IN THE * SPARSE JACOBIAN MATRIX. * IO JC(MC) COLUMN INDICES OF NONZERO ELEMENTS IN THE SPARSE * JACOBIAN MATRIX. * II NEXT NUMBER OF THE TEST PROBLEM. * SUBROUTINE TINS20(N,NC,MC,IC,JC,NEXT) INTEGER N,NC,MC,NEXT INTEGER IC(*),JC(*) INTEGER I,J 1 GOTO (10,20,30,10,50,60,70,10,90,10,110,120,130,140,150,160,160, & 160), NEXT 10 NC=N-2 MC=0 IC(1)=1 DO 13 I=2,N-1 MC=MC+1 JC(MC)=I-1 MC=MC+1 JC(MC)=I MC=MC+1 JC(MC)=I+1 IC(I)=MC+1 13 CONTINUE RETURN 20 NC=N-7 MC=0 IC(1)=1 DO 24 I=1,NC DO 23 J=1,7 MC=MC+1 JC(MC)=I+J-1 23 CONTINUE IC(I+1)=MC+1 24 CONTINUE RETURN 30 NC=2 MC=0 J=1 IC(1)=1 DO 34 I=1,N,N-1 IF(I.GT.1) THEN MC=MC+1 JC(MC)=I-1 END IF MC=MC+1 JC(MC)=I IF(I.LT.N) THEN MC=MC+1 JC(MC)=I+1 END IF J=J+1 IC(J)=MC+1 34 CONTINUE RETURN 50 NC=N-4 MC=0 IC(1)=1 DO 53 I=3,N-2 MC=MC+1 JC(MC)=I-2 MC=MC+1 JC(MC)=I-1 MC=MC+1 JC(MC)=I MC=MC+1 JC(MC)=I+1 MC=MC+1 JC(MC)=I+2 IC(I-1)=MC+1 53 CONTINUE RETURN 60 NC=N/2 MC=0 J=1 IC(1)=1 DO 63 I=1,N IF (MOD(I,2).EQ.0) THEN MC=MC+3 JC(MC-2)=I-1 JC(MC-1)=I JC(MC)=I+1 J=J+1 IC(J)=MC+1 END IF 63 CONTINUE RETURN 70 NC=4 MC=0 J=1 IC(1)=1 DO 73 I=1,N IF(I.GT.2.AND.I.LT.N-1) GO TO 73 IF(I.GT.2) THEN MC=MC+1 JC(MC)=I-2 END IF IF(I.GT.1) THEN MC=MC+1 JC(MC)=I-1 END IF MC=MC+1 JC(MC)=I IF(I.LT.N) THEN MC=MC+1 JC(MC)=I+1 END IF IF(I.LT.N-1) THEN MC=MC+1 JC(MC)=I+2 END IF J=J+1 IC(J)=MC+1 73 CONTINUE RETURN 90 NC=6 MC=0 J=1 IC(1)=1 DO 93 I=1,N IF(I.GT.3.AND.I.LT.N-2) GO TO 93 IF(I.GT.3) THEN MC=MC+1 JC(MC)=I-3 END IF IF(I.GT.2) THEN MC=MC+1 JC(MC)=I-2 END IF IF(I.GT.1) THEN MC=MC+1 JC(MC)=I-1 END IF MC=MC+1 JC(MC)=I IF(I.LT.N) THEN MC=MC+1 JC(MC)=I+1 END IF IF(I.LT.N-1) THEN MC=MC+1 JC(MC)=I+2 END IF IF(I.LT.N-2) THEN MC=MC+1 JC(MC)=I+3 END IF J=J+1 IC(J)=MC+1 93 CONTINUE RETURN 110 NC=2*(N-2)/3 MC=1 DO 113 I=1,NC/2 J=(I-1)*3 IC(2*I-1)=MC IC(2*I)=MC+3 JC(MC)=J+1 JC(MC+1)=J+4 JC(MC+2)=J+5 JC(MC+3)=J+2 JC(MC+4)=J+3 JC(MC+5)=J+4 MC=MC+6 113 CONTINUE IC(NC+1)=MC MC=MC-1 RETURN 120 NC=3*(N-1)/4 MC=1 DO 123 I=1,NC/3 J=(I-1)*4 IC(3*I-2)=MC IC(3*I-1)=MC+3 IC(3*I)=MC+6 JC(MC)=J+1 JC(MC+1)=J+2 JC(MC+2)=J+3 JC(MC+3)=J+2 JC(MC+4)=J+3 JC(MC+5)=J+4 JC(MC+6)=J+1 JC(MC+7)=J+5 MC=MC+8 123 CONTINUE IC(NC+1)=MC MC=MC-1 RETURN 130 NC=2*(N-2)/3 MC=1 DO 133 I=1,NC/2 J=(I-1)*3 IC(2*I-1)=MC IC(2*I)=MC+5 JC(MC)=J+1 JC(MC+1)=J+2 JC(MC+2)=J+3 JC(MC+3)=J+4 JC(MC+4)=J+5 JC(MC+5)=J+3 JC(MC+6)=J+4 JC(MC+7)=J+5 MC=MC+8 133 CONTINUE IC(NC+1)=MC MC=MC-1 RETURN 140 NC=2*(N-2)/3 MC=1 DO 143 I=1,NC/2 J=(I-1)*3 IC(2*I-1)=MC IC(2*I)=MC+4 JC(MC)=J+1 JC(MC+1)=J+2 JC(MC+2)=J+3 JC(MC+3)=J+4 JC(MC+4)=J+3 JC(MC+5)=J+5 MC=MC+6 143 CONTINUE IC(NC+1)=MC MC=MC-1 RETURN 150 NC=3*(N-1)/4 MC=1 DO 153 I=1,NC/3 J=(I-1)*4 IC(3*I-2)=MC IC(3*I-1)=MC+3 IC(3*I)=MC+6 JC(MC)=J+1 JC(MC+1)=J+2 JC(MC+2)=J+3 JC(MC+3)=J+2 JC(MC+4)=J+3 JC(MC+5)=J+4 JC(MC+6)=J+3 JC(MC+7)=J+4 JC(MC+8)=J+5 MC=MC+9 153 CONTINUE IC(NC+1)=MC MC=MC-1 RETURN 160 NC=3*(N-1)/4 MC=1 DO 163 I=1,NC/3 J=(I-1)*4 IC(3*I-2)=MC IC(3*I-1)=MC+2 IC(3*I)=MC+5 JC(MC)=J+1 JC(MC+1)=J+2 JC(MC+2)=J+3 JC(MC+3)=J+4 JC(MC+4)=J+5 JC(MC+5)=J+2 JC(MC+6)=J+5 MC=MC+7 163 CONTINUE IC(NC+1)=MC MC=MC-1 RETURN END * SUBROUTINE TFFU20 ALL SYSTEMS 94/12/01 C PORTABILITY : ALL SYSTEMS C 94/12/01 TU : ORIGINAL VERSION * * PURPOSE : * VALUE OF THE GENERAL OBJECTIVE FUNCTION. * * PARAMETERS : * II N NUMBER OF VARIABLES. * RI X(N) VECTOR OF VARIABLES. * RO F VALUE OF THE GENERAL OBJECTIVE FUNCTION AT THE POINT X. * II NEXT NUMBER OF THE SELECTED TEST PROBLEM. * SUBROUTINE TFFU20(N,X,F,NEXT) INTEGER N,NEXT DOUBLE PRECISION X(*),F DOUBLE PRECISION A,B,C,D,P,Q,R,U,V INTEGER I,J,K F=0.0D 0 GOTO (10,20,30,40,50,60,70,80,90,100,110,120,130,110,120,160,170, & 160), NEXT 10 DO 11 J=2,N A=X(J-1)**2-X(J) B=X(J-1)-1.0D 0 F=F+1.0D 2*A**2+B**2 11 CONTINUE RETURN 20 DO 21 J=2,N-2,2 A=X(J-1)**2-X(J) B=X(J-1)-1.0D 0 C=X(J+1)**2-X(J+2) D=X(J+1)-1.0D 0 U=X(J)+X(J+2)-2.0D 0 V=X(J)-X(J+2) F=F+1.0D 2*A**2+B**2+9.0D 1*C**2+D**2+ & 1.0D 1*U**2+0.1D 0*V**2 21 CONTINUE RETURN 30 DO 31 J=2,N-2,2 A=X(J-1)+1.0D 1*X(J) B=X(J+1)-X(J+2) C=X(J)-2.0D 0*X(J+1) D=X(J-1)-X(J+2) F=F+A**2+5.0D 0*B**2+C**4+1.0D 1*D**4 31 CONTINUE RETURN 40 DO 41 J=2,N-2,2 A=EXP(X(J-1)) B=A-X(J) D=X(J)-X(J+1) P=X(J+1)-X(J+2) Q=SIN(P)/COS(P) U=X(J-1) V=X(J+2)-1.0D 0 F=F+B**4+1.0D 2*D**6+Q**4+U**8+V**2 41 CONTINUE RETURN 50 P=7.0D 0/3.0D 0 DO 51 J=1,N A=(3.0D 0-2.0D 0*X(J))*X(J)+1.0D 0 IF (J.GT.1) A=A-X(J-1) IF (J.LT.N) A=A-X(J+1) F=F+ABS(A)**P 51 CONTINUE RETURN 60 P=7.0D 0/3.0D 0 DO 62 J=1,N A=(2.0D 0+5.0D 0*X(J)**2)*X(J)+1.0D 0 DO 61 I=MAX(1,J-5),MIN(N,J+1) A=A+X(I)*(1.0D 0+X(I)) 61 CONTINUE F=F+ABS(A)**P 62 CONTINUE RETURN 70 DO 72 J=1,N A=DBLE(J)*(1.0D 0-COS(X(J))) IF(J.GT.1) A=A+DBLE(J)*SIN(X(J-1)) IF(J.LT.N) A=A-DBLE(J)*SIN(X(J+1)) F=F+A 72 CONTINUE RETURN 80 P=-0.2008D-2 Q=-0.1900D-2 R=-0.0261D-2 DO 82 I=0,N-5,5 A=1.0D 0 B=0.0D 0 DO 81 J=1,5 A=A*X(I+J) B=B+X(I+J)**2 81 CONTINUE A=EXP(A) B=B-1.0D 1-P C=X(I+2)*X(I+3)-5.0D 0*X(I+4)*X(I+5)-Q D=X(I+1)**3+X(I+2)**3+1.0D 0-R F=F+A+1.0D 1*(B**2+C**2+D**2) 82 CONTINUE RETURN 90 C=0.0D 0 DO 91 J=2,N,2 A=X(J-1)-3.0D 0 B=X(J-1)-X(J) F=F+1.0D-4*A**2-B+EXP(2.0D 1*B) 91 CONTINUE RETURN 100 DO 101 J=2,N,2 A=X(J)**2 B=X(J-1)**2 C=A+1.0D 0 D=B+1.0D 0 F=F+B**C+A**D 101 CONTINUE RETURN 110 K=(N-2)/3 DO 111 I=1,K J=(I-1)*3 F=F+(X(J+1)-X(J+2))**2+(X(J+3)-1.0D 0)**2+(X(J+4)-1.0D 0)**4+ & (X(J+5)-1.0D 0)**6 111 CONTINUE RETURN 120 K=(N-1)/4 DO 121 I=1,K J=(I-1)*4 F=F+(X(J+1)-X(J+2))**2+(X(J+2)-X(J+3))**2+(X(J+3)-X(J+4))**4+ & (X(J+4)-X(J+5))**4 121 CONTINUE RETURN 130 K=(N-2)/3 DO 131 I=1,K J=(I-1)*3 F=F+(X(J+1)-1.0D 0)**2+(X(J+2)-X(J+3))**2+(X(J+4)-X(J+5))**4 131 CONTINUE RETURN 160 K=(N-1)/4 DO 161 I=1,K J=(I-1)*4 F=F+(X(J+1)-X(J+2))**4+(X(J+2)+X(J+3)-2.0D 0)**2+ & (X(J+4)-1.0D 0)**2+(X(J+5)-1.0D 0)**2 161 CONTINUE RETURN 170 K=(N-1)/4 DO 171 I=1,K J=(I-1)*4 F=F+(4.0D 0*X(J+1)-X(J+2))**2+(X(J+2)+X(J+3)-2.0D 0)**4+ & (X(J+4)-1.0D 0)**2+(X(J+5)-1.0D 0)**2 171 CONTINUE RETURN END * SUBROUTINE TFGU20 ALL SYSTEMS 94/12/01 C PORTABILITY : ALL SYSTEMS C 94/12/01 TU : ORIGINAL VERSION * * PURPOSE : * GRADIENT OF THE GENERAL OBJECTIVE FUNCTION. * * PARAMETERS : * II N NUMBER OF VARIABLES. * RI X(N) VECTOR OF VARIABLES. * RO G(N) GRADIENT OF THE GENERAL OBJECTIVE FUNCTION AT THE POINT X. * II NEXT NUMBER OF THE SELECTED TEST PROBLEM. * SUBROUTINE TFGU20(N,X,G,NEXT) INTEGER N,NEXT DOUBLE PRECISION X(*),G(*) DOUBLE PRECISION A,B,C,D,P,Q,R,U,V INTEGER I,J,K DO 1 I=1,N G(I)=0.0D 0 1 CONTINUE GOTO (10,20,30,40,50,60,70,80,90,100,110,120,130,110,120,160,170, & 160), NEXT 10 DO 11 J=2,N A=X(J-1)**2-X(J) B=X(J-1)-1.0D 0 G(J-1)=G(J-1)+4.0D 2*X(J-1)*A+2.0D 0*B G(J)=G(J)-2.0D 2*A 11 CONTINUE RETURN 20 DO 21 J=2,N-2,2 A=X(J-1)**2-X(J) B=X(J-1)-1.0D 0 C=X(J+1)**2-X(J+2) D=X(J+1)-1.0D 0 U=X(J)+X(J+2)-2.0D 0 V=X(J)-X(J+2) G(J-1)=G(J-1)+4.0D 2*X(J-1)*A+2.0D 0*B G(J)=G(J)-2.0D 2*A+2.0D 1*U+0.2D 0*V G(J+1)=G(J+1)+3.6D 2*X(J+1)*C+2.0D 0*D G(J+2)=G(J+2)-1.8D 2*C+2.0D 1*U-0.2D 0*V 21 CONTINUE RETURN 30 DO 31 J=2,N-2,2 A=X(J-1)+1.0D 1*X(J) B=X(J+1)-X(J+2) C=X(J)-2.0D 0*X(J+1) D=X(J-1)-X(J+2) G(J-1)=G(J-1)+2.0D 0*A+4.0D 1*D**3 G(J)=G(J)+2.0D 1*A+4.0D 0*C**3 G(J+1)=G(J+1)-8.0D 0*C**3+1.0D 1*B G(J+2)=G(J+2)-4.0D 1*D**3-1.0D 1*B 31 CONTINUE RETURN 40 DO 41 J=2,N-2,2 A=EXP(X(J-1)) B=A-X(J) B=4.0D 0*B**3 D=X(J)-X(J+1) D=6.0D 2*D**5 P=X(J+1)-X(J+2) C=COS(P) Q=SIN(P)/COS(P) Q=4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INAL VERSION * * PURPOSE : * VALUES OF CONSTRAINT FUNCTIONS IN THE EQUALITY CONSTRAINED * OPTIMIZATION. * * PARAMETERS : * II N NUMBER OF VARIABLES. * II KC INDEX OF THE GIVEN CONSTRAINT. * RI X(N) VECTOR OF VARIABLES. * RO FC VALUE OF THE KC-TH CONSTRAINT FUNCTION AT THE POINT X. * II NEXT NUMBER OF THE SELECTED TEST PROBLEM. * SUBROUTINE TCFU20(N,KC,X,FC,NEXT) INTEGER I,N,K,KC,NEXT DOUBLE PRECISION X(*),FC DOUBLE PRECISION U,V GOTO (40,60,45,70,80,50,85,180,90,200,110,120,130,140,150,160, & 170,170),NEXT 40 K=KC+1 FC=3.0D 0*X(K)**3+2.0D 0*X(K+1)-5.0D 0+ & SIN(X(K)-X(K+1))*SIN(X(K)+X(K+1))+4.0D 0*X(K)- & X(K-1)*EXP(X(K-1)-X(K))-3.0D 0 RETURN 45 IF (KC.EQ.1) THEN K=1 FC=3.0D 0*X(K)**3+2.0D 0*X(K+1)-5.0D 0+ & SIN(X(K)-X(K+1))*SIN(X(K)+X(K+1)) ELSE K=N FC=4.0D 0*X(K)-X(K-1)*EXP(X(K-1)-X(K))-3.0D 0 END IF RETURN 50 K=2*KC FC=4.0D 0*X(K)-(X(K-1)-X(K+1))*EXP(X(K-1)-X(K)-X(K+1))- & 3.0D 0 RETURN 60 K=KC+5 FC=(2.0D 0+5.0D 0*X(K)**2)*X(K)+1.0D 0 DO 61 I=K-5,K+1 FC=FC+X(I)*(1.0D 0+X(I)) 61 CONTINUE RETURN 70 K=KC+1 FC=8.0D 0*X(K)*(X(K)**2-X(K-1))-2.0D 0*(1.0D 0-X(K))+ & 4.0D 0*(X(K)-X(K+1)**2) RETURN 80 K=KC+2 FC=8.0D 0*X(K)*(X(K)**2-X(K-1))-2.0D 0*(1.0D 0-X(K))+ & 4.0D 0*(X(K)-X(K+1)**2)+X(K-1)**2-X(K-2)+X(K+1)- & X(K+2)**2 RETURN 85 IF (KC.EQ.1) TH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+X(K-2)**2-X(K-3) ELSE K=N FC=8.0D 0*X(K)*(X(K)**2-X(K-1))-2.0D 0*(1.0D 0-X(K)) & +X(K-1)**2-X(K-2)+X(K-2)**2-X(K-3) END IF RETURN 180 U=1.0D 0/DBLE(N+1) K=KC+1 V=DBLE(K)*U FC=2.0D 0*X(K)+0.5D 0*U*U*(X(K)+V+1.0D 0)**3-X(K-1)-X(K+1) RETURN 200 K=KC+1 FC=(3.0D 0-2.0D 0*X(K))*X(K)+1.0D 0-X(K-1)-2.0D 0*X(K+1) RETURN 110 K=(KC-1)/2*3 IF (MOD(KC,2).EQ.1) THEN FC=X(K+1)**2*X(K+4)+SIN(X(K+4)-X(K+5))-1.0D 0 ELSE FC=X(K+2)+X(K+3)**4*X(K+4)**2-2.0D 0 END IF RETURN 120 K=(KC-1)/3*4 IF (MOD(KC,3).EQ.1) THEN FC=X(K+1)+X(K+2)**2+X(K+3)**3-3.0D 0 ELSE IF (MOD(KC,3).EQ.2) THEN FC=X(K+2)-X(K+3)**2+X(K+4)-1.0D 0 ELSE FC=X(K+1)*X(K+5)-1.0D 0 END IF RETURN 130 K=(KC-1)/2*3 IF (MOD(KC,2).EQ.1) THEN FC=X(K+1)+X(K+2)**2+X(K+3)+X(K+4)+X(K+5)-5.0D 0 ELSE FC=X(K+3)**2-2.0D 0*(X(K+4)+X(K+5))+3.0D 0 END IF RETURN 140 K=(KC-1)/2*3 IF (MOD(KC,2).EQ.1) THEN FC=X(K+1)**2+X(K+2)+X(K+3)+4.0D 0*X(K+4)-7.0D 0 ELSE FC=X(K+3)**2+5.0D 0*X(K+5)-6.0D 0 END IF RETURN 150 K=(KC-1)/3*4 IF (MOD(KC,3).EQ.1) THEN FC=X(K+1)**2+2.0D 0*X(K+2)+3.0D 0*X(K+3)-6.0D 0 ELSE IF (MOD(KC,3).EQ.2) THEN FC=X(K+2)**2+2.0D 0*X(K+3)+3.0D 0*X(K+4)-6.0D 0 ELSE FC=X(K+3)**2+2.0D 0*X(K+4)+3.0D 0*X(K+5)-6.0D 0 END IF RETURN 160 K=(KC-1)/3*4 IF (MOD(KC,3).EQ.1) THEN FC=X(K+1)**2+3.0D 0*X(K+2)-4.0D 0 ELSE IF (MOD(KC,3).EQ.2) THEN FC=X(K+3)**2+X(K+4)-2.0D 0*X(K+5) ELSE FC=X(K+2)**2-X(K+5) END IF RETURN 170 K=(KC-1)/3*4 IF (MOD(KC,3).EQ.1) THEN FC=X(K+1)**2+3.0D 0*X(K+2) ELSE IF (MOD(KC,3).EQ.2) THEN FC=X(K+3)**2+X(K+4)-2.0D 0*X(K+5) ELSE FC=X(K+2)**2-X(K+5) END IF RETURN END * SUBROUTINE TCGU20 ALL SYSTEMS 94/12/01 C PORTABILITY : ALL SYSTEMS C 94/12/01 LU : ORIGINAL VERSION * * PURPOSE : * GRADIENTS OF CONSTRAINT FUNCTIONS IN THE EQUALITY CONSTRAINED * OPTIMIZATION. * * PARAMETERS : * II N NUMBER OF VARIABLES. * II KC INDEX OF THE GIVEN CONSTRAINT. * RI X(N) VECTOR OF VARIABLES. * RO GC(NC) GRADIENT OF THE KC-TH CONSTRAINT FUNCTION AT THE POINT X. * II NEXT NUMBER OF THE SELECTED TEST PROBLEM. * SUBROUTINE TCGU20(N,KC,X,GC,NEXT) INTEGER I,N,K,KC,NEXT DOUBLE PRECISION X(*),GC(*) DOUBLE PRECISION U,V,W,EX,D1S,D2S GOTO (40,60,45,70,80,50,85,180,90,200,110,120,130,140,150,160, & 160,160),NEXT 40 K=KC+1 D1S=COS(X(K)-X(K+1))*SIN(X(K)+X(K+1)) D2S=SIN(X(K)-X(K+1))*COS(X(K)+X(K+1)) EX=EXP(X(K-1)-X(K)) GC(K-1)=-EX-X(K-1)*EX GC(K)=9.0D 0*X(K)**2+D1S+D2S+4.0D 0+X(K-1)*EX GC(K+1)=2.0D 0-D1S+D2S RETURN 45 IF (KC.EQ.1) THEN K=1 D1S=COS(X(K)-X(K+1))*SIN(X(K)+X(K+1)) D2S=SIN(X(K)-X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)=2.0D 0*X(K+1) GC(K+2)=2.0D 0 GC(K+3)=3.0D 0 ELSE IF (MOD(KC,3).EQ.2) THEN GC(K+2)=2.0D 0*X(K+2) GC(K+3)=2.0D 0 GC(K+4)=3.0D 0 ELSE GC(K+3)=2.0D 0*X(K+3) GC(K+4)=2.0D 0 GC(K+5)=3.0D 0 END IF RETURN 160 K=(KC-1)/3*4 IF (MOD(KC,3).EQ.1) THEN GC(K+1)=2.0D 0*X(K+1) GC(K+2)=3.0D 0 ELSE IF (MOD(KC,3).EQ.2) THEN GC(K+3)=2.0D 0*X(K+3) GC(K+4)=1.0D 0 GC(K+5)=-2.0D 0 ELSE GC(K+2)=2.0D 0*X(K+2) GC(K+5)=-1.0D 0 END IF RETURN END * SUBROUTINE TYTIM1 MS DOS 91/12/01 C PORTABILITY : MS DOS / MS FORTRAN v.5.0 C 91/12/01 SI : ORIGINAL VERSION * * PURPOSE : * GET TIME IN 100TH OF SEC. * SUBROUTINE TYTIM1(ITIME) INTEGER ITIME REAL*4 TIME CALL CPU_TIME(TIME) ITIME=1.0D2*TIME END * SUBROUTINE TYTIM2 ALL SYSTEMS 91/12/01 C PORTABILITY : ALL SYSTEMS C 91/12/01 SI : ORIGINAL VERSION * * PURPOSE : * PRINT TIME ELAPSED. * SUBROUTINE TYTIM2(ITIME) INTEGER ITIME INTEGER IHR,IT,IMIN,ISEC CALL TYTIM1(IT) IT=IT-ITIME IHR=IT/(60*60*100) IT=IT-IHR*60*60*100 IMIN=IT/(60*100) IT=IT-IMIN*60*100 ISEC=IT/100 IT=IT-ISEC*100 WRITE(6,10) IHR,IMIN,ISEC,IT 10 FORMAT(' TIME=',I2,':',I2.2,':',I2.2,'.',I2.2) END 