function hb_io_test12 ( )

%*****************************************************************************80
%
%% TEST12 tests HB_VECMAT_A_MEM;
%
%  Modified:
%
%    04 February 2005
%
  ncol = 32;
  neltvl = 0;
  nnzero = 126;
  nrhs = 2;
  nrhsix = 0;
  nrow = 32;

  colptr = [ ...
      1,   7,  12,  18,  22,  26,  29,  34,  39,  46, ...
     53,  58,  61,  63,  65,  68,  71,  74,  79,  82, ...
     85,  88,  90,  94,  97, 102, 106, 110, 112, 117, ...
    121, 124, 127 ]';
  exact = [ ...
    0.0,   0.0,   0.0,   0.0,   0.0,   0.0,   0.0,   0.0,   0.0,   1.0, ...
    0.0,   0.0,   0.0,   0.0,   0.0,   0.0,   0.0,   0.0,   0.0,   0.0, ...
    0.0,   0.0,   0.0,   0.0,   0.0,   0.0,   0.0,   0.0,   0.0,   0.0, ...
    0.0,   0.0;
    1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0, ...
    1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0, ...
    1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0, ...
    1.0,   1.0 ]';
  guess = [ ...
    1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0, ...
    1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0, ...
    1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0, ...
    1.0,   1.0;
    1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0, ...
    1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0, ...
    1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0,   1.0, ...
    1.0,   1.0 ]';
  indcrd = 8;
  indfmt = '(16I5)';
  key = 'RUA_32';
  mxtype = 'RUA';
  output_file = 'rua_32_xa.txt';
  ptrcrd = 3;
  ptrfmt = '(16I5)';
  rhscrd = 12;
  rhsfmt = '(10F7.1)';
  rhsind = 0;
  rhsptr = 0;
  rhstyp = 'FGX';
  rhsvec = 0;
  rowind = [ ...
    1,    2,    3,    4,    7,   26,    1,    2,    9,   21, ...
   28,    2,    3,    6,    8,    9,   29,    3,    4,    5, ...
   12,    3,    5,   23,   27,    1,    6,   16,    3,    7, ...
   14,   21,   31,    1,    8,   12,   17,   27,    7,    9, ...
   10,   13,   19,   23,   27,    1,   10,   11,   21,   23, ...
   25,   27,    2,   11,   15,   18,   29,    6,   12,   24, ...
   11,   13,    3,   14,    2,   15,   20,    4,   16,   22, ...
    4,   16,   17,    6,   10,   18,   20,   30,    1,   19, ...
   26,    8,   16,   20,    3,   21,   32,   11,   22,    2, ...
   17,   21,   23,   12,   24,   26,    6,   15,   18,   24, ...
   25,   13,   18,   22,   26,    5,   24,   26,   27,    9, ...
   28,    3,    5,   27,   29,   32,   12,   17,   23,   30, ...
   13,   14,   31,   24,   28,   32 ]';
  title = '1Real unsymmetric assembled matrix based on IBM32';
  totcrd = 36;
  valcrd = 13;
  valfmt = '(10F7.1)';
  values = [ ...
  101.0,  102.0,  103.0,  104.0,  107.0, ...
  126.0,  201.0,  202.0,  209.0,  221.0, ...
  228.0,  302.0,  303.0,  306.0,  308.0, ...
  309.0,  329.0,  403.0,  404.0,  405.0, ...
  412.0,  503.0,  505.0,  523.0,  527.0, ...
  601.0,  606.0,  616.0,  703.0,  707.0, ...
  714.0,  721.0,  731.0,  801.0,  808.0, ...
  812.0,  817.0,  827.0,  907.0,  909.0, ...
  910.0,  913.0,  919.0,  923.0,  927.0, ...
 1001.0, 1010.0, 1011.0, 1021.0, 1023.0, ...
 1025.0, 1027.0, 1102.0, 1111.0, 1115.0, ...
 1118.0, 1129.0, 1206.0, 1212.0, 1224.0, ...
 1311.0, 1313.0, 1403.0, 1414.0, 1502.0, ...
 1515.0, 1520.0, 1604.0, 1616.0, 1622.0, ...
 1704.0, 1716.0, 1717.0, 1806.0, 1810.0, ...
 1818.0, 1820.0, 1830.0, 1901.0, 1919.0, ...
 1926.0, 2008.0, 2016.0, 2020.0, 2103.0, ...
 2121.0, 2132.0, 2211.0, 2222.0, 2302.0, ...
 2317.0, 2321.0, 2323.0, 2412.0, 2424.0, ...
 2426.0, 2506.0, 2515.0, 2518.0, 2524.0, ...
 2525.0, 2613.0, 2618.0, 2622.0, 2626.0, ...
 2705.0, 2724.0, 2726.0, 2727.0, 2809.0, ...
 2828.0, 2903.0, 2905.0, 2927.0, 2929.0, ...
 2932.0, 3012.0, 3017.0, 3023.0, 3030.0, ...
 3113.0, 3114.0, 3131.0, 3224.0, 3228.0, ...
 3232.0 ]';

  fprintf ( 1, '\n' );
  fprintf ( 1, 'TEST12\n' );
  fprintf ( 1, '  HB_VECMAT_A_MEM multiplies a vector times a matrix.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  This particular version assumes:\n' );
  fprintf ( 1, '  * the matrix is in "A" format (assembled),\n' );
  fprintf ( 1, '  * the matrix and vectors can fit in memory,\n' );
  fprintf ( 1, '  * the matrix and multiplicand have been read into\n' );
  fprintf ( 1, '    memory before the routine is called.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  For this example, the first vector X is zero except\n' );
  fprintf ( 1, '  for a 1 in row 10.  This means A''*X should return\n' );
  fprintf ( 1, '  row 10 of A.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  The second vector X is all 1''s.  A''*X should be\n' );
  fprintf ( 1, '  the sum of the entries of each column.\n' );

  rhsval = hb_vecmat_a_mem ( nrow, ncol, nnzero, nrhs, colptr, rowind, ...
    values, exact );

  r8mat_print ( ncol, nrhs, rhsval,  '  The product vectors A''*X' );

  output_unit = fopen ( output_file, 'wt' );

  if ( output_unit < 0 )
    fprintf ( 1, '\n' );
    fprintf ( 1, 'TEST12 - Fatal error!\n' );
    fprintf ( 1, '  Error opening the file.\n' );
    return;
  end

  hb_file_write ( output_unit, title, key, totcrd, ptrcrd, indcrd, ...
    valcrd, rhscrd, mxtype, nrow, ncol, nnzero, neltvl, ptrfmt, indfmt, ...
    valfmt, rhsfmt, rhstyp, nrhs, nrhsix, colptr, rowind, values, ...
    rhsval, rhsptr, rhsind, rhsvec, guess, exact );

  fclose ( output_unit );

  return
end
