function hb_io_test10 ( ) %*****************************************************************************80 % %% HB_IO_TEST10 tests HB_FILE_WRITE; % ncol = 32; neltvl = 0; nnzero = 126; nrhs = 1; 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 = [ ... 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, ... 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, ... 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, ... 31.0, 32.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 ]'; indcrd = 8; indfmt = '(16I5)'; key = 'RUA_32'; mxtype = 'RUA'; output_file = 'rua_32_file.txt'; ptrcrd = 3; ptrfmt = '(16I5)'; rhscrd = 12; rhsfmt = '(10F7.1)'; rhsind = 0; rhsptr = 0; rhsval = [ ... 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 ]'; 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, 'HB_IO_TEST10\n' ); fprintf ( 1, ' HB_FILE_WRITE writes an HB file.\n' ); fprintf ( 1, '\n' ); fprintf ( 1, ' Writing the file "%s".\n', output_file ); output_unit = fopen ( output_file, 'wt' ); if ( output_unit < 0 ) fprintf ( 1, '\n' ); fprintf ( 1, 'HB_IO_TEST10 - 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