Support RETURN-FROM in DEF%TR forms
[maxima.git] / share / hompack / fortran / multds.f
bloba2f8ae911162d9f2b368e328ec414efeebf19b54
1 SUBROUTINE MULTDS(Y,AA,X,MAXA,NN,LENAA)
3 C This subroutine accepts a matrix, AA, in packed skyline storage form and
4 C a vector, x, and returns the product AA*x in y.
6 C Input Variables:
8 C AA -- one dimensional real array containing the NN x NN matrix in
9 C packed skyline storage form.
11 C x -- real vector of length NN to be multiplied by AA.
13 C MAXA -- integer array used for specifying information about AA.
14 C MAXA has length NN+1, and stores the indices of the
15 C diagonal elements of the matrix packed in AA. By
16 C convention, MAXA(NN+1) = LENAA + 1 .
18 C NN -- dimension of the matrix packed in AA .
20 C LENAA -- number of elements in AA.
23 C Output Variables:
25 C y -- real vector of length NN containing the product AA*x .
29 INTEGER I,II,KK,KL,KU,LENAA,NN,MAXA(NN+1)
30 DOUBLE PRECISION AA(LENAA),B,CC,X(NN),Y(NN)
31 IF(LENAA.GT.NN) GO TO 20
32 DO 10 I=1,NN
33 10 Y(I)=AA(I)*X(I)
34 RETURN
35 20 DO 40 I=1,NN
36 40 Y(I)=0.00
37 DO 100 I=1,NN
38 KL=MAXA(I)
39 KU=MAXA(I+1)-1
40 II=I+1
41 CC=X(I)
42 DO 100 KK=KL,KU
43 II=II-1
44 100 Y(II)=Y(II)+AA(KK)*CC
45 IF(NN.EQ.1) RETURN
46 DO 200 I=2,NN
47 KL=MAXA(I)+1
48 KU=MAXA(I+1)-1
49 IF(KU-KL) 200,210,210
50 210 II=I
51 B=0.00
52 DO 220 KK=KL,KU
53 II=II-1
54 220 B=B+AA(KK)*X(II)
55 Y(I)=Y(I)+B
56 200 CONTINUE
57 RETURN
58 END