Support RETURN-FROM in DEF%TR forms
[maxima.git] / share / hompack / fortran / gfunp.f
blob229ce051d9e7bf96ec5f5f59704a4a19a813ee57
1 SUBROUTINE GFUNP(N,IDEG,PDG,QDG,X,
2 $ XDGM1,XDG,PXDGM1,PXDG,G,DG)
4 C GFUNP EVALUATES THE START EQUATION "G".
6 C ON INPUT:
8 C N IS THE NUMBER OF VARIABLES.
10 C IDEG(J) IS THE DEGREE OF THE J-TH EQUATION.
12 C PDG(1,J), PDG(2,J) ARE THE REAL AND IMAGINARY PARTS
13 C OF THE POWERS OF P USED TO DEFINE G.
15 C QDG(1,J), QDG(2,J) ARE THE REAL AND IMAGINARY PARTS
16 C OF THE POWERS OF Q USED TO DEFINE G.
18 C X(1,J), X(2,J) ARE THE REAL AND IMAGINARY PARTS OF THE
19 C J-TH INDEPENDENT VARIABLE.
21 C XDGM1,XDG,PXDGM1,PXDG ARE WORKSPACE ARRAYS.
23 C ON OUTPUT:
25 C N,IDEG,PDG,QDG, AND X ARE UNCHANGED.
27 C G(1,J),G(2,J) ARE THE REAL AND IMAGINARY PARTS OF THE
28 C J-TH START EQUATION.
30 C DG(1,J),DG(2,J) ARE THE REAL AND IMAGINARY PARTS OF THE
31 C PARTIAL DERIVATIVES OF THE J-TH START EQUATION WITH RESPECT TO THE
32 C J-TH INDEPENDENT VARIABLE.
34 C SUBROUTINE: MULP.
36 C DECLARATION OF INPUT AND OUTPUT:
37 INTEGER N,IDEG
38 DOUBLE PRECISION PDG,QDG,X,XDGM1,XDG,PXDGM1,PXDG,G,DG
39 DIMENSION IDEG(N),PDG(2,N),QDG(2,N),X(2,N),
40 $ XDGM1(2,N),XDG(2,N),PXDGM1(2,N),PXDG(2,N),
41 $ G(2,N),DG(2,N)
43 C DECLARATION OF VARIABLES
44 INTEGER I,J
46 C COMPUTE THE (IDEG-1)-TH AND IDEG-TH POWER OF X
47 DO 5 J=1,N
48 CALL POWP(IDEG(J)-1,X(1,J), XDGM1(1,J))
49 CALL MULP(X(1,J),XDGM1(1,J), XDG(1,J))
50 5 CONTINUE
52 C COMPUTE THE PRODUCT OF PDG AND XDGM1
53 DO 10 J=1,N
54 CALL MULP( PDG(1,J), XDGM1(1,J), PXDGM1(1,J) )
55 10 CONTINUE
57 C COMPUTE THE PRODUCT OF PDG AND XDG
58 DO 20 J=1,N
59 CALL MULP( PDG(1,J), XDG(1,J), PXDG(1,J) )
60 20 CONTINUE
61 DO 30 J=1,N
62 DO 30 I=1,2
63 G(I,J)=PXDG(I,J) - QDG(I,J)
64 DG(I,J)= IDEG(J)*PXDGM1(I,J)
65 30 CONTINUE
66 RETURN
67 END