*DECK SRMGEN SUBROUTINE SRMGEN (NELTMX, FACTOR, IERR, N, NELT, ISYM, IA, JA, A, $ F, SOLN, DSUM, ITMP, IDIAG) C***BEGIN PROLOGUE SRMGEN C***SUBSIDIARY C***PURPOSE This routine generates a "Random" symmetric or C non-symmetric matrix of size N for use in the SLAP C Quick Checks. C***LIBRARY SLATEC (SLAP) C***TYPE SINGLE PRECISION (SRMGEN-S, DRMGEN-D) C***AUTHOR Seager, Mark K., (LLNL) C seager@llnl.gov C Lawrence Livermore National Laboratory C PO BOX 808, L-300 C Livermore, CA 94550 C (510) 423-3141 C***DESCRIPTION C C *Usage: C INTEGER NELTMX, IERR, N, NELT, ISYM, C INTEGER IA(NELTMX), JA(NELTMX), ITMP(N), IDIAG(N) C REAL FACTOR, A(NELTMX), F(N), SOLN(N), DSUM(N) C C CALL SRMGEN( NELTMX, FACTOR, IERR, N, NELT, ISYM, C $ IA, JA, A, F, SOLN, DSUM, ITMP, IDIAG ) C C *Arguments: C C NELTMX :IN Integer. C Maximum number of non-zeros that can be created by this C routine for storage in the IA, JA, A arrays, see below. C FACTOR :IN Real. C Non-zeros in the upper triangle are set to FACTOR times C the corresponding entry in the lower triangle when a non- C symmetric matrix is requested (See ISYM, below). C IERR :OUT Integer. C Return error flag. C IERR = 0 => everything went OK. C = 1 => Ran out of space trying to create matrix. C Set NELTMX to something larger and retry. C N :IN Integer. C Size of the linear system to generate (number of unknowns). C NELT :OUT Integer. C Number of non-zeros stored in the IA, JA, A arrays, see below. C ISYM :IN Integer. C Flag to indicate the type of matrix to generate: C ISYM = 0 => Non-Symmetric Matrix (See FACTOR, above). C = 1 => Symmetric Matrix. C IA :OUT Integer IA(NELTMX). C Stores the row indices for the non-zeros. C JA :OUT Integer JA(NELTMX). C Stores the column indices for the non-zeros. C A :OUT Real A(NELTMX). C Stores the values of the non-zeros. C F :OUT Real F(N). C The right hand side of the linear system. Obtained by C multiplying the matrix times SOLN, see below. C SOLN :OUT Real SOLN(N). C The true solution to the linear system. Each component is C chosen at random (0.0