* G05PXF Example Program Text * Mark 22 Release. NAG Copyright 2006. * .. Parameters .. INTEGER NOUT PARAMETER (NOUT=6) INTEGER N, M, LDA PARAMETER (N=4,M=4,LDA=10) INTEGER MSEED, MSTATE PARAMETER (MSEED=1,MSTATE=633) * .. Local Scalars .. INTEGER GENID, I, IFAIL, J, LSEED, LSTATE, SUBID * .. Local Arrays .. DOUBLE PRECISION A(LDA,N) INTEGER SEED(MSEED), STATE(MSTATE) * .. External Subroutines .. EXTERNAL G05KFF, G05PXF * .. Executable Statements .. WRITE (NOUT,*) 'G05PXF Example Program Results' WRITE (NOUT,*) * Initialize the seed SEED(1) = 1762543 * GENID and SUBID identify the base generator GENID = 1 SUBID = 1 * Initialize the generator to a repeatable sequence LSTATE = MSTATE LSEED = MSEED IFAIL = 1 CALL G05KFF(GENID,SUBID,SEED,LSEED,STATE,LSTATE,IFAIL) IF (IFAIL.NE.0) THEN WRITE (NOUT,99998) IFAIL GO TO 40 END IF * Generate the random orthogonal matrix IFAIL = 1 CALL G05PXF('Right','Initialize',M,N,STATE,A,LDA,IFAIL) IF (IFAIL.NE.0) THEN WRITE (NOUT,99997) IFAIL GO TO 40 END IF * Display the results DO 20 I = 1, M WRITE (NOUT,99999) (A(I,J),J=1,N) 20 CONTINUE * 40 CONTINUE * 99999 FORMAT (1X,4F9.3) 99998 FORMAT (1X,' ** G05KFF returned with IFAIL = ',I5) 99997 FORMAT (1X,' ** G05KPXF returned with IFAIL = ',I5) END