SUBROUTINE CPROD(N1,N2,LIST1,LIST2,ZZ,LDZ,XY,LDXY) C This routine extracts the sums of cross products of a subset of C the variables in a sums-of-squares-and-cross-products matrix. C It is useful for reordering variables. C Inuts: C N1 Number of rows in output sums-of-cross-products matrix C N2 Number of columns in output sums-of-cross-products matrix C LIST1 N1x1 vector of ZZ entries corresponding to rows of XY C LIST1 N2x1 vector of ZZ entries corresponding to columns of XY C ZZ Sums-of-squares-and-cross-products matrix C LDZ Leading dimension of Z C LDXY Leading dimension of XY C Output: C XY N1xN2 sums-of-cross-products matrix IMPLICIT REAL*8 (A-H,O-Z) PARAMETER(LD=100) COMMON/SCRA/V1(LD),V2(LD),A1(LD,LD),A2(LD,LD) DIMENSION LIST1(N1),LIST2(N2),ZZ(LDZ,LDZ),XY(LDXY,LDXY) DO 10 I1=1,N1 J1=LIST1(I1) DO 10 I2=1,N2 J2=LIST2(I2) 10 A1(I1,I2)=ZZ(J1,J2) DO 20 I1=1,N1 DO 20 I2=1,N2 20 XY(I1,I2)=A1(I1,I2) RETURN END