function hb_io_test04 ( )

%*****************************************************************************80
%
%% HB_IO_TEST04 tests HB_STRUCTURE_WRITE;
%
  ncol = 32;
  neltvl = 0;
  nnzero = 126;

  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 ]';
  indfmt = '(16I5)';
  mxtype = 'RUA';
  output_file = 'rua_32_structure.txt';
  ptrfmt = '(16I5)';
  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 ]';

  fprintf ( 1, '\n' );
  fprintf ( 1, 'HB_IO_TEST04\n' );
  fprintf ( 1, '  HB_STRUCTURE_WRITE writes an HB structure.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Writing the file "%s".\n', output_file );

  output_unit = fopen ( output_file, 'wt' );

  if ( output_unit < 0 )
    error ( ['Cannot open output file.'] );
  end

  hb_structure_write ( output_unit, ncol, mxtype, nnzero, neltvl, ...
    ptrfmt, indfmt, colptr, rowind );

  fclose ( output_unit );

  return
end
