C ALGORITHM 805, COLLECTED ALGORITHMS FROM ACM. C THIS WORK PUBLISHED IN TRANSACTIONS ON MATHEMATICAL SOFTWARE, C VOL. 26,NO. 3, September, 2000, P. 415--435. #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # C/ # C/Sp/ # C/Sp/Drivers/ # C/Sp/Drivers/convertmtx.c # C/Sp/Drivers/convertsdd.c # C/Sp/Drivers/data1 # C/Sp/Drivers/data2 # C/Sp/Drivers/data3 # C/Sp/Drivers/data4 # C/Sp/Drivers/data5 # C/Sp/Drivers/decomp.c # C/Sp/Drivers/res1 # C/Sp/Drivers/res1_1 # C/Sp/Drivers/res2 # C/Sp/Drivers/res2_1 # C/Sp/Drivers/res3 # C/Sp/Drivers/res3_1 # C/Sp/Drivers/res4 # C/Sp/Drivers/res4_1 # C/Sp/Drivers/res5 # C/Sp/Drivers/res5_1 # C/Sp/Src/ # C/Sp/Src/qsortopt.h # C/Sp/Src/sdd.c # C/Sp/Src/sdd.h # Doc/ # Doc/Makefile # Doc/test1.gif # Doc/umcp-cs-tr-4012.ps # Matlab/ # Matlab/Src/ # Matlab/Src/mtxread.m # Matlab/Src/mtxwrite.m # Matlab/Src/sdd.m # Matlab/Src/sddfun.m # Matlab/Src/sddtensor.m # Matlab/Src/sddweight.m # Matlab/Src/sddweightfun.m # Matlab/Src/testdata/ # Matlab/Src/testdata/bfw62a.mtx # Matlab/Src/testdata/impcol_c.mtx # Matlab/Src/testdata/test1.mtx # Matlab/Src/testdata/watson2.mtx # Matlab/Src/testdata/west0132.mtx # This archive created: Mon Feb 12 16:31:38 2001 export PATH; PATH=/bin:$PATH if test ! -d 'C' then mkdir 'C' fi cd 'C' if test ! -d 'Sp' then mkdir 'Sp' fi cd 'Sp' if test ! -d 'Drivers' then mkdir 'Drivers' fi cd 'Drivers' if test -f 'convertmtx.c' then echo shar: will not over-write existing file "'convertmtx.c'" else cat << "SHAR_EOF" > 'convertmtx.c' /*---------------------------------------------------------------------- SDDPACK: Software for the Semidiscrete Decomposition. Copyright (c) 1999 Tamara G. Kolda and Dianne P. O'Leary. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. PROGRAM: convertmtx DESCRIPTION: Converts a text matrix (in MatrixMarket coordinate, real, general format) to SDDPACK binary format and vice versa. USAGE: convertmtx [options] infile outfile OPTIONS: -b Convert from binary to text. -t Convert from text to binary. (DEFAULT) FILE FORMATS: Text files should be in MatrixMarket coordinate, real, general format. The header lines (beginning with '%') are NOT checked and need not be present. The output files will be in binary format. EXTERNAL SUBROUTINES: read_matrix, write_matrix (from sdd.c) PROGRAM DEPENDENCIES: convertmtx.c sdd.o sdd.h BUG REPORTS: Email Tamara.Kolda@na-net.ornl.gov. ----------------------------------------------------------------------*/ #include #include #include #include "sdd.h" /* sparse matrix */ #define INDATA 't' /* default input data type ('t' = text) */ void usage(char*); int main (int argc, char *argv[]) { int i; /* counter */ char *infile; /* input file name */ char *outfile; /* output file name */ char indata = INDATA; /* input file type: [t]ext or [b]inary */ matrix *A = NULL; /* pointer to sparse matrix */ /* Parse command line */ if (argc < 3) { usage(argv[0]); exit(-1); } infile = argv[argc - 2]; outfile = argv[argc - 1]; i = 1; while (i < argc - 2) { if (argv[i][0] != '-') { usage(argv[0]); exit(-1); } switch (argv[i][1]) { case 'b': indata = 'b'; break; case 't': indata = 't'; break; default: usage(argv[0]); exit(-1); break; } /* switch */ i++; } /* while */ /* Echo selections to standard output */ fprintf(stdout, "*** output from %s ***\n", argv[0]); fprintf(stdout, "Input File : %s\n", infile); fprintf(stdout, "Output File : %s\n", outfile); /* Call appropriate conversion routines */ switch(indata) { case 'b': /* Convert binary matrix to text */ if ((A = read_matrix(infile, 1)) == NULL) { fprintf(stderr, "Error reading matrix.\n"); exit(-1); } write_matrix(A, outfile, 0); break; case 't': default: /* Convert text matrix to binary */ if ((A = read_matrix(infile, 0)) == NULL) { fprintf(stderr, "Error reading matrix.\n"); exit(-1); } write_matrix(A, outfile, 1); break; } /* switch */ /* Free memory and exit */ free_matrix(A); return(0); } /* main */ /*----------------------------------------------------------------------*/ void usage(char *name) { fprintf(stderr, "\n"); fprintf(stderr, "Usage: %s [options] infile outfile\n", name); fprintf(stderr, "Converts a matrix text file to binary or vice versa.\n"); fprintf(stderr, "Options: -b Convert from binary to text\n"); fprintf(stderr, " -t Convert from text to binary (DEFAULT)\n"); fprintf(stderr, "\n"); return; } /* usage */ SHAR_EOF fi # end of overwriting check if test -f 'convertsdd.c' then echo shar: will not over-write existing file "'convertsdd.c'" else cat << "SHAR_EOF" > 'convertsdd.c' /*---------------------------------------------------------------------- SDDPACK: Software for the Semidiscrete Decomposition. Copyright (c) 1999 Tamara G. Kolda and Dianne P. O'Leary. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. PROGRAM: convertsdd DESCRIPTION: Converts a text sdd to SDDPACK binary format and vice versa. USAGE: convertsdd [options] infile outfile OPTIONS: -b Convert from binary to text. -t Convert from text to binary. (DEFAULT) EXTERNAL SUBROUTINES: read_sdd, write_sdd (from sdd.c) PROGRAM DEPENDENCIES: convertmtx.c sdd.o sdd.h BUG REPORTS: Email Tamara.Kolda@na-net.ornl.gov. ----------------------------------------------------------------------*/ #include #include #include #include "sdd.h" /* sdd header file */ #define INDATA 't' /* default input data type ('t' = text) */ void usage(char*); int main (int argc, char *argv[]) { int i; /* counter */ char *infile; /* input file name */ char *outfile; /* output file name */ char indata = INDATA; /* input file type: [t]ext or [b]inary */ sdd *A = NULL; /* pointer to sparse matrix */ /* Parse command line */ if (argc < 3) { usage(argv[0]); exit(-1); } infile = argv[argc - 2]; outfile = argv[argc - 1]; i = 1; while (i < argc - 2) { if (argv[i][0] != '-') { usage(argv[0]); exit(-1); } switch (argv[i][1]) { case 'b': indata = 'b'; break; case 't': indata = 't'; break; default: usage(argv[0]); exit(-1); break; } /* switch */ i++; } /* while */ /* Echo selections to standard output */ fprintf(stdout, "*** output from %s ***\n", argv[0]); fprintf(stdout, "Input File : %s\n", infile); fprintf(stdout, "Output File : %s\n", outfile); /* Call appropriate conversion routines */ switch(indata) { case 'b': /* Convert binary matrix to text */ if ((A = read_sdd(infile, 1)) == NULL) { fprintf(stderr, "Error reading SDD.\n"); exit(-1); } write_sdd(A, outfile, 0, NULL); break; case 't': default: /* Convert text matrix to binary */ if ((A = read_sdd(infile, 0)) == NULL) { fprintf(stderr, "Error reading SDD.\n"); exit(-1); } write_sdd(A, outfile, 1, NULL); break; } /* switch */ /* Free memory and exit */ free_sdd(A); return(0); } /* main */ /*----------------------------------------------------------------------*/ void usage(char *name) { fprintf(stderr, "\n"); fprintf(stderr, "Usage: %s [options] infile outfile\n", name); fprintf(stderr, "Converts an SDD text file to binary or vice versa.\n"); fprintf(stderr, "Options: -b Convert from binary to text\n"); fprintf(stderr, " -t Convert from text to binary (DEFAULT)\n"); fprintf(stderr, "\n"); return; } /* usage */ SHAR_EOF fi # end of overwriting check if test -f 'data1' then echo shar: will not over-write existing file "'data1'" else cat << "SHAR_EOF" > 'data1' %% MatrixMarket matrix coordinate real general % %SDDPACK: Software for the Semidiscrete Decomposition. %Copyright (c) 1999 Tamara G. Kolda and Dianne P. O'Leary. % % This program is free software; you can redistribute it and/or modify it % under the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your option) % any later version. % % This program is distributed in the hope that it will be useful, but % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License % for more details. % % You should have received a copy of the GNU General Public License along % with this program; if not, write to the Free Software Foundation, Inc., 59 % Temple Place - Suite 330, Boston, MA 02111-1307, USA. % 5 5 25 1 1 5.827917e-01 2 1 4.234963e-01 3 1 5.155118e-01 4 1 3.339515e-01 5 1 4.329066e-01 1 2 2.259499e-01 2 2 5.798069e-01 3 2 7.603650e-01 4 2 5.298231e-01 5 2 6.405265e-01 1 3 2.090694e-01 2 3 3.798184e-01 3 3 7.833286e-01 4 3 6.808458e-01 5 3 4.610951e-01 1 4 5.678287e-01 2 4 7.942107e-01 3 4 5.918259e-02 4 4 6.028691e-01 5 4 5.026880e-02 1 5 4.153749e-01 2 5 3.049987e-01 3 5 8.743672e-01 4 5 1.500950e-02 5 5 7.679504e-01 SHAR_EOF fi # end of overwriting check if test -f 'data2' then echo shar: will not over-write existing file "'data2'" else cat << "SHAR_EOF" > 'data2' %%MatrixMarket matrix coordinate real general 132 132 414 19 1 1.0000000000000e+00 24 1 -1.2222090000000e-01 20 2 1.0000000000000e+00 24 2 -1.9902570000000e-01 21 3 1.3000000000000e+02 22 3 -2.4337670000000e+00 22 4 1.0000000000000e+00 23 4 -1.6346070000000e+00 23 5 1.6346070000000e+00 24 5 -7.6368810000000e-01 25 6 -1.1383520000000e+00 34 6 5.1484020000000e-02 26 7 -4.0000000000000e-01 34 7 1.8090720000000e-02 27 8 -6.0000000000000e-01 34 8 2.7136090000000e-02 28 9 -4.3624160000000e-01 29 9 -7.6804250000000e-01 30 9 -1.4302790000000e-01 29 10 1.0000000000000e+00 34 10 -5.4506720000000e-02 30 11 1.0000000000000e+00 34 11 -8.6781480000000e-02 31 12 5.4400920000000e+00 33 12 -7.4232720000000e-01 32 13 3.0929180000000e-01 33 13 -2.3332580000000e-01 33 14 1.4756530000000e+00 34 14 -4.8909260000000e-01 2 15 4.8176470000000e+01 6 15 -1.0000000000000e+00 8 15 -3.3474840000000e-05 3 16 8.3500000000000e+01 7 16 -1.0000000000000e+00 9 16 -4.1365390000000e-05 4 17 9.6651380000000e+01 6 17 2.5000000000000e+00 8 17 3.3474840000000e-05 5 18 1.6827060000000e+02 7 18 2.5000000000000e+00 9 18 4.1365390000000e-05 6 19 1.0000000000000e+00 11 19 -9.8400230000000e-02 7 20 1.0000000000000e+00 11 20 -4.9895230000000e-01 8 21 1.0104550000000e+00 12 21 -4.0000000000000e-01 9 22 1.0059780000000e+00 12 22 -6.0000000000000e-01 10 23 1.0000000000000e+00 11 23 -4.0264750000000e-01 11 24 1.0000000000000e+00 13 24 -1.0000000000000e+00 23 24 1.5000000000000e+00 33 24 5.0000000000000e-01 12 25 1.0000000000000e+00 14 25 -3.1622000000000e+05 17 25 -1.2323690000000e+04 18 25 -1.0000000000000e+00 23 25 -4.3103150000000e+04 32 25 2.1599430000000e+04 13 26 7.3590410000000e+00 15 26 2.4500370000000e-03 14 27 1.0808590000000e+03 15 27 -1.4973280000000e-01 15 28 9.8129710000000e-02 16 28 7.3828160000000e+01 23 28 -1.3645490000000e-01 16 29 -2.1599430000000e+04 18 29 8.1911820000000e-01 31 29 -2.1599430000000e+04 32 29 -1.7692490000000e+04 17 30 1.0000000000000e+00 23 30 2.8801920000000e-01 33 30 -1.0698550000000e+00 18 31 8.4220650000000e-05 23 31 2.5068860000000e+00 33 31 8.3562870000000e-01 24 32 1.0000000000000e+00 41 32 1.0000000000000e+00 34 33 1.0000000000000e+00 1 34 1.0000000000000e+00 11 34 -2.3342530000000e+00 12 34 -4.1119570000000e-05 24 34 -2.7530730000000e+00 27 34 1.0000000000000e+00 34 34 4.1030700000000e-01 36 34 0.0000000000000e+00 38 34 -1.0000000000000e+00 37 35 5.8124340000000e-02 38 35 9.5326020000000e-04 41 35 2.7248650000000e-01 39 36 9.5933880000000e-01 100 36 1.0000000000000e+00 101 36 1.0000000000000e+00 102 36 1.0000000000000e+00 103 36 1.0000000000000e+00 108 36 -4.1612680000000e-03 111 36 2.5000000000000e+00 112 36 3.3271980000000e+00 114 36 1.0000000000000e+00 115 36 -5.7792120000000e-01 117 36 -6.0739530000000e-01 118 36 -4.7904230000000e-01 119 36 -2.5841990000000e+01 126 36 4.1850350000000e-01 127 36 -2.5488460000000e-01 128 36 -6.6331220000000e-01 129 36 1.0000000000000e+00 41 37 -2.7248650000000e-01 122 37 1.0000000000000e+00 132 38 1.0000000000000e+00 35 39 1.0000000000000e+00 37 39 5.9077600000000e-02 53 39 -9.9416020000000e-01 54 39 -9.8958400000000e-01 99 39 1.0000000000000e+00 109 39 -1.9881190000000e+00 110 39 -3.3143100000000e-05 122 39 1.0251850000000e+00 124 39 1.0000000000000e+00 132 39 1.0076120000000e+00 36 40 1.0000000000000e+00 38 40 5.9077600000000e-02 53 40 -1.3560780000000e+00 54 40 -1.6351060000000e+00 99 40 1.0000000000000e+00 109 40 -2.7244220000000e+00 110 40 -4.1130080000000e-05 122 40 -5.9537640000000e-01 125 40 1.0000000000000e+00 132 40 4.3773870000000e-01 37 41 3.4187570000000e-01 38 41 5.9904670000000e-01 41 41 7.2751350000000e-01 39 42 -9.5933880000000e-01 59 42 -7.6304510000000e+01 60 42 -2.0237220000000e+02 66 42 1.0000000000000e+00 67 42 1.0000000000000e+00 68 42 1.0000000000000e+00 69 42 1.0000000000000e+00 74 42 -4.1612680000000e-03 77 42 2.5000000000000e+00 78 42 3.8228080000000e+00 80 42 1.0000000000000e+00 81 42 -6.6400680000000e-01 83 42 -6.0739530000000e-01 84 42 -4.7904230000000e-01 85 42 -2.5841990000000e+01 92 42 4.1850350000000e-01 93 42 -2.5488460000000e-01 94 42 -6.6331220000000e-01 95 42 1.0000000000000e+00 40 43 -3.1623550000000e-01 63 43 1.0000000000000e+00 64 43 1.0000000000000e+00 77 43 -1.0000000000000e+00 78 43 -3.8228080000000e+00 80 43 -1.0000000000000e+00 89 43 1.0000000000000e+00 41 44 -7.2751350000000e-01 88 44 1.0000000000000e+00 98 45 1.0000000000000e+00 35 46 -2.7078260000000e+00 37 46 9.4092240000000e-01 42 46 -1.0000000000000e+00 43 46 -1.0000000000000e+00 46 46 1.0000000000000e+00 47 46 1.0000000000000e+00 65 46 1.0000000000000e+00 75 46 -1.4693280000000e+00 76 46 -3.3143100000000e-05 88 46 6.1155710000000e+00 90 46 1.0000000000000e+00 98 46 5.5166850000000e-01 36 47 -2.5344380000000e-02 38 47 9.4092240000000e-01 42 47 -1.0000000000000e+00 43 47 -1.0000000000000e+00 46 47 1.0000000000000e+00 47 47 1.0000000000000e+00 65 47 1.0000000000000e+00 75 47 -2.3028540000000e+00 76 47 -4.1130080000000e-05 88 47 -3.5516210000000e+00 91 47 1.0000000000000e+00 98 47 4.3137260000000e-01 35 48 -9.8386430000000e-01 63 48 1.0000000000000e+00 36 49 -6.3665900000000e-01 64 49 3.9456480000000e+01 48 50 -1.0000000000000e+00 63 50 -1.0000000000000e+00 49 51 -1.0000000000000e+00 64 51 -1.0000000000000e+00 57 52 -1.0000000000000e+00 63 52 1.0267620000000e+00 58 53 -1.0000000000000e+00 64 53 1.0491850000000e+00 61 54 -1.0000000000000e+00 63 54 -1.0000000000000e+00 62 55 -1.0000000000000e+00 64 55 -1.0000000000000e+00 42 56 -1.0000000000000e+00 44 56 -1.0000000000000e+00 46 56 3.6334100000000e-01 47 56 3.6334100000000e-01 43 57 -1.0000000000000e+00 45 57 -1.0000000000000e+00 46 57 6.3665900000000e-01 47 57 6.3665900000000e-01 44 58 1.0000000000000e+00 46 58 -1.0000000000000e+00 45 59 1.0000000000000e+00 47 59 -1.0000000000000e+00 46 60 1.0000000000000e+00 48 60 1.0000000000000e+00 47 61 1.0000000000000e+00 49 61 1.0000000000000e+00 50 62 1.0088340000000e-02 51 62 9.7292370000000e-01 52 62 -1.0000000000000e+00 51 63 9.6971490000000e-01 55 63 3.2984260000000e+01 56 63 2.6579110000000e+01 52 64 1.0032980000000e+00 55 64 3.0244770000000e+02 56 64 3.6563660000000e+02 53 65 1.0000000000000e+00 55 65 1.9958500000000e+00 54 66 1.0000000000000e+00 56 66 2.2039080000000e+00 55 67 3.2984260000000e+01 57 67 9.7393570000000e-01 56 68 2.6579110000000e+01 58 68 9.5312110000000e-01 59 69 1.1755400000000e+02 61 69 1.2482660000000e+01 60 70 1.0656400000000e+02 62 70 7.7897140000000e+00 83 71 1.0000000000000e+00 88 71 -1.4740210000000e-01 84 72 1.0000000000000e+00 88 72 -2.7889010000000e-01 85 73 1.2471400000000e+02 86 73 -2.4130120000000e+00 86 74 1.0000000000000e+00 87 74 -1.6229990000000e+00 87 75 1.6229990000000e+00 88 75 -1.0391340000000e+00 117 76 1.0000000000000e+00 122 76 -6.6909760000000e-02 118 77 1.0000000000000e+00 122 77 -1.1848950000000e-03 119 78 1.2471400000000e+02 120 78 -2.4130120000000e+00 120 79 1.0000000000000e+00 121 79 -2.8021250000000e-02 121 80 2.8021250000000e-02 122 80 -9.6438800000000e-04 89 81 -1.0000000000000e+00 98 81 4.6668060000000e-02 90 82 -3.6785130000000e-01 98 82 1.7166910000000e-02 91 83 -6.3665900000000e-01 98 83 2.9711640000000e-02 92 84 -4.1850350000000e-01 93 84 -7.3626770000000e-01 94 84 -1.3819200000000e-01 93 85 1.0000000000000e+00 98 85 -5.3293930000000e-02 94 86 1.0000000000000e+00 98 86 -9.8343170000000e-02 95 87 5.4101270000000e+00 97 87 -6.6839170000000e-01 96 88 2.9706250000000e-01 97 88 -2.2282420000000e-01 97 89 1.3912160000000e+00 98 89 -5.2552180000000e-01 123 90 -1.0000000000000e+00 132 90 7.8613690000000e-02 124 91 -9.8386430000000e-01 132 91 7.7345200000000e-02 125 92 -6.6587120000000e-02 132 92 5.2346590000000e-03 126 93 -4.1850350000000e-01 127 93 -7.3626770000000e-01 128 93 -1.3819200000000e-01 127 94 1.0000000000000e+00 132 94 -2.4309560000000e-01 128 95 1.0000000000000e+00 132 95 -4.1985990000000e-03 129 96 1.0000000000000e+00 131 96 -3.8528080000000e-01 130 97 9.9670190000000e-01 131 97 -3.8528080000000e-01 131 98 4.6339540000000e-02 132 98 -9.4552380000000e-03 66 99 4.6258220000000e+01 70 99 -1.0000000000000e+00 72 99 -3.3504290000000e-05 67 100 8.0145450000000e+01 71 100 -1.0000000000000e+00 73 100 -4.1386390000000e-05 68 101 9.2762080000000e+01 70 101 2.5000000000000e+00 72 101 3.3504290000000e-05 69 102 1.6146920000000e+02 71 102 2.5000000000000e+00 73 102 4.1386390000000e-05 70 103 1.0000000000000e+00 75 103 -7.8738550000000e-02 71 104 1.0000000000000e+00 75 104 -5.4487130000000e-01 72 105 1.0108980000000e+00 76 105 -3.6334100000000e-01 73 106 1.0062320000000e+00 76 106 -6.3665900000000e-01 74 107 1.0000000000000e+00 75 107 -3.7639010000000e-01 75 108 1.0000000000000e+00 77 108 -1.0000000000000e+00 87 108 1.5000000000000e+00 97 108 5.0000000000000e-01 76 109 1.0000000000000e+00 78 109 -1.0000000000000e+05 81 109 -1.1579740000000e+04 82 109 -1.0000000000000e+00 87 109 -4.2455680000000e+04 96 109 2.1850270000000e+04 77 110 2.0347790000000e+01 79 110 7.2696120000000e-04 78 111 1.0369100000000e+03 79 111 -5.3591620000000e-02 79 112 3.6676120000000e-02 80 112 2.2656770000000e+02 87 112 -1.2354450000000e-01 80 113 -2.1850270000000e+04 82 113 8.3529410000000e-01 95 113 -2.1850270000000e+04 96 113 -1.8251400000000e+04 81 114 1.0000000000000e+00 87 114 2.7785690000000e-01 97 114 -1.1295070000000e+00 82 115 8.3994100000000e-05 87 115 2.4703360000000e+00 97 115 8.2344550000000e-01 100 116 4.6258220000000e+01 104 116 -1.0000000000000e+00 106 116 -3.3504290000000e-05 101 117 8.0145450000000e+01 105 117 -1.0000000000000e+00 107 117 -4.1386390000000e-05 102 118 9.2762080000000e+01 104 118 2.5000000000000e+00 106 118 3.3504290000000e-05 103 119 1.6146920000000e+02 105 119 2.5000000000000e+00 107 119 4.1386390000000e-05 53 120 -9.7811870000000e-01 104 120 1.0000000000000e+00 109 120 -9.5661940000000e-01 54 121 -2.6383630000000e-02 105 121 1.0000000000000e+00 109 121 -5.7991920000000e-04 55 122 -3.3299800000000e+03 106 122 1.0108980000000e+00 110 122 -9.8386430000000e-01 56 123 -2.6833370000000e+03 107 123 1.0062320000000e+00 110 123 -1.6135730000000e-02 53 124 -2.1881310000000e-02 54 124 -9.7361640000000e-01 108 124 1.0000000000000e+00 109 124 -4.2800700000000e-02 55 125 -1.0000000000000e+00 56 125 -1.0000000000000e+00 109 125 1.0000000000000e+00 111 125 -1.0000000000000e+00 121 125 1.7589250000000e-02 131 125 5.8630830000000e-03 50 126 -1.0000000000000e+00 55 126 3.3170810000000e+03 56 126 3.3170810000000e+03 110 126 1.0000000000000e+00 112 126 -1.0000000000000e+05 115 126 -1.1579740000000e+04 116 126 -1.0000000000000e+00 121 126 -8.4218760000000e+02 130 126 9.9124310000000e+01 111 127 3.3715330000000e+01 113 127 9.6971490000000e-01 112 128 1.0369100000000e+03 113 128 -1.0088280000000e+00 51 129 -9.9670190000000e-01 55 129 -3.2856500000000e+01 56 129 -3.2856500000000e+01 113 129 9.2033500000000e-01 114 129 1.0278300000000e+00 121 129 -3.8528080000000e-01 50 130 3.2980620000000e-03 114 130 -9.9124310000000e+01 116 130 3.2980620000000e-03 129 130 -9.9124310000000e+01 130 130 -3.2691810000000e-01 55 131 -2.5847380000000e+00 56 131 -3.1247550000000e+00 115 131 1.0000000000000e+00 121 131 2.7076350000000e-02 131 131 -1.5217690000000e-02 116 132 1.0121610000000e-02 121 132 5.3419970000000e+00 131 132 1.7806660000000e+00 SHAR_EOF fi # end of overwriting check if test -f 'data3' then echo shar: will not over-write existing file "'data3'" else cat << "SHAR_EOF" > 'data3' %%MatrixMarket matrix coordinate real general 66 67 409 1 1 1.0000000000000e+00 1 2 2.0004000000000e+00 2 2 1.0000000000000e+00 5 2 -1.3986000000000e-05 6 2 -1.0000000000000e-04 7 2 -3.0211000000000e-04 30 2 -1.0000000000000e+00 37 2 -5.6619000000000e-16 40 2 -5.6740000000000e-18 41 2 -1.0000000000000e+00 42 2 0.0000000000000e+00 43 2 -5.8531000000000e-39 46 2 -5.8656000000000e-41 48 2 0.0000000000000e+00 49 2 -2.2549000000000e-27 52 2 -2.2597000000000e-29 54 2 0.0000000000000e+00 3 3 2.0003000000000e+00 12 3 -1.9569000000000e-04 17 3 -1.0000000000000e+00 59 3 -1.0000000000000e+00 4 4 1.0000000000000e+00 35 4 -1.0000000000000e+00 1 5 -1.3986000000000e-05 5 5 3.0000000000000e+00 16 5 -1.0000000000000e+00 22 5 -1.0000000000000e+00 24 5 -1.0000000000000e+00 1 6 -1.0000000000000e-04 6 6 1.0001000000000e+00 53 6 -1.0000000000000e+00 1 7 -3.0211000000000e-04 7 7 3.3364000000000e-01 47 7 -3.3333000000000e-01 8 8 2.6667000000000e+00 46 8 -3.3333000000000e-01 48 8 -3.3333000000000e-01 52 8 -1.0000000000000e+00 60 8 -1.0000000000000e+00 9 9 3.5000000000000e+00 18 9 -1.0000000000000e+00 40 9 -1.0000000000000e+00 54 9 -1.0000000000000e+00 66 9 -5.0000000000000e-01 10 10 3.5001000000000e+00 29 10 -1.0000000000000e+00 34 10 -1.0000000000000e+00 58 10 -1.0000000000000e+00 64 10 -5.0000000000000e-01 11 11 3.0000000000000e+00 28 11 -1.0000000000000e+00 36 11 -1.0000000000000e+00 42 11 -1.0000000000000e+00 3 12 -1.9569000000000e-04 12 12 5.0020000000000e-01 65 12 -5.0000000000000e-01 13 13 1.0000000000000e+00 16 13 -1.0108000000000e-01 18 13 -1.0000000000000e+00 14 14 1.0000000000000e+00 15 14 1.0892000000000e-01 16 14 -1.0000000000000e+00 17 14 -1.1036000000000e-01 18 14 0.0000000000000e+00 14 15 -1.0086000000000e-01 15 15 1.0000000000000e+00 16 15 0.0000000000000e+00 17 15 -1.0074000000000e-01 18 15 -1.0000000000000e+00 5 16 -1.0000000000000e+00 13 16 -3.3132000000000e-01 14 16 -1.0000000000000e+00 15 16 0.0000000000000e+00 16 16 2.0000000000000e+00 17 16 0.0000000000000e+00 18 16 0.0000000000000e+00 3 17 -1.0000000000000e+00 14 17 -1.4450000000000e-01 15 17 -1.0892000000000e-01 16 17 0.0000000000000e+00 17 17 1.0000000000000e+00 9 18 -1.0000000000000e+00 13 18 -1.0000000000000e+00 14 18 0.0000000000000e+00 15 18 -1.0000000000000e+00 16 18 0.0000000000000e+00 18 18 3.0000000000000e+00 19 19 1.0000000000000e+00 22 19 -3.8251000000000e-17 24 19 -1.0000000000000e+00 20 20 1.0000000000000e+00 21 20 3.7196000000000e-03 22 20 -1.0000000000000e+00 23 20 -3.7690000000000e-03 24 20 0.0000000000000e+00 20 21 -3.8309000000000e-15 21 21 1.0000000000000e+00 22 21 0.0000000000000e+00 23 21 -3.8266000000000e-15 24 21 -1.0000000000000e+00 5 22 -1.0000000000000e+00 19 22 -1.2538000000000e-19 20 22 -1.0000000000000e+00 21 22 0.0000000000000e+00 22 22 2.0000000000000e+00 23 22 0.0000000000000e+00 24 22 0.0000000000000e+00 20 23 -4.9349000000000e-05 21 23 -3.7196000000000e-03 22 23 0.0000000000000e+00 23 23 1.0038000000000e+00 5 24 -1.0000000000000e+00 19 24 -1.0000000000000e+00 20 24 0.0000000000000e+00 21 24 -1.0000000000000e+00 22 24 0.0000000000000e+00 24 24 3.0000000000000e+00 25 25 1.0000000000000e+00 28 25 -5.8077000000000e-18 30 25 -1.0000000000000e+00 26 26 1.0003000000000e+00 27 26 2.5397000000000e-02 28 26 -1.0000000000000e+00 29 26 -2.5734000000000e-02 30 26 0.0000000000000e+00 26 27 -5.9429000000000e-16 27 27 1.0000000000000e+00 28 27 0.0000000000000e+00 29 27 -5.9362000000000e-16 30 27 -1.0000000000000e+00 11 28 -1.0000000000000e+00 25 28 -1.9037000000000e-20 26 28 -1.0000000000000e+00 27 28 0.0000000000000e+00 28 28 2.0000000000000e+00 29 28 0.0000000000000e+00 30 28 0.0000000000000e+00 10 29 -1.0000000000000e+00 26 29 -3.3695000000000e-04 27 29 -2.5397000000000e-02 28 29 0.0000000000000e+00 29 29 1.0257000000000e+00 1 30 -1.0000000000000e+00 25 30 -1.0000000000000e+00 26 30 0.0000000000000e+00 27 30 -1.0000000000000e+00 28 30 0.0000000000000e+00 30 30 3.0000000000000e+00 31 31 1.0000000000000e+00 34 31 -5.5792000000000e-30 36 31 -1.0000000000000e+00 32 32 1.0001000000000e+00 33 32 5.0271000000000e-03 34 32 -1.0000000000000e+00 35 32 -5.0937000000000e-03 36 32 0.0000000000000e+00 32 33 -5.5954000000000e-28 33 33 1.0000000000000e+00 34 33 0.0000000000000e+00 35 33 -5.5890000000000e-28 36 33 -1.0000000000000e+00 10 34 -1.0000000000000e+00 31 34 -1.8288000000000e-32 32 34 -1.0000000000000e+00 33 34 0.0000000000000e+00 34 34 2.0000000000000e+00 35 34 0.0000000000000e+00 36 34 0.0000000000000e+00 4 35 -1.0000000000000e+00 32 35 -6.6695000000000e-05 33 35 -5.0271000000000e-03 34 35 0.0000000000000e+00 35 35 1.0051000000000e+00 11 36 -1.0000000000000e+00 31 36 -1.0000000000000e+00 32 36 0.0000000000000e+00 33 36 -1.0000000000000e+00 34 36 0.0000000000000e+00 36 36 3.0000000000000e+00 1 37 9.5148000000000e-06 37 37 1.0000000000000e+00 40 37 -9.5461000000000e-06 42 37 -1.0000000000000e+00 38 38 1.0010000000000e+00 39 38 4.4185000000000e-03 40 38 -1.0000000000000e+00 41 38 -5.4581000000000e-03 42 38 0.0000000000000e+00 38 39 -9.5569000000000e-04 39 39 1.0019000000000e+00 40 39 0.0000000000000e+00 41 39 -9.5461000000000e-04 42 39 -1.0000000000000e+00 1 40 -9.5148000000000e-06 9 40 -1.0000000000000e+00 37 40 -3.1291000000000e-08 38 40 -1.0000000000000e+00 39 40 0.0000000000000e+00 40 40 2.0000000000000e+00 41 40 0.0000000000000e+00 42 40 0.0000000000000e+00 1 41 -1.0000000000000e+00 38 41 -8.3965000000000e-05 39 41 -6.3288000000000e-03 40 41 0.0000000000000e+00 41 41 1.0064000000000e+00 1 42 0.0000000000000e+00 11 42 -1.0000000000000e+00 37 42 -1.0000000000000e+00 38 42 0.0000000000000e+00 39 42 -1.0000000000000e+00 40 42 0.0000000000000e+00 42 42 3.0000000000000e+00 1 43 1.1697000000000e-16 43 43 3.0000000000000e+00 46 43 -1.1735000000000e-16 48 43 -3.0000000000000e+00 44 44 3.0001000000000e+00 45 44 8.7049000000000e-03 46 44 -3.0000000000000e+00 47 44 -8.8204000000000e-03 48 44 0.0000000000000e+00 44 45 -1.1743000000000e-14 45 45 3.0000000000000e+00 46 45 0.0000000000000e+00 47 45 -1.1730000000000e-14 48 45 -3.0000000000000e+00 1 46 -1.1697000000000e-16 8 46 -3.3333000000000e-01 43 46 -3.8467000000000e-19 44 46 -3.0000000000000e+00 45 46 0.0000000000000e+00 46 46 3.3333000000000e+00 47 46 0.0000000000000e+00 48 46 0.0000000000000e+00 7 47 -3.3333000000000e-01 44 47 -1.1549000000000e-04 45 47 -8.7049000000000e-03 46 47 0.0000000000000e+00 47 47 3.4215000000000e-01 1 48 0.0000000000000e+00 8 48 -3.3333000000000e-01 43 48 -3.0000000000000e+00 44 48 0.0000000000000e+00 45 48 -3.0000000000000e+00 46 48 0.0000000000000e+00 48 48 6.3333000000000e+00 1 49 4.4884000000000e-05 49 49 1.0000000000000e+00 52 49 -4.5032000000000e-05 54 49 -1.0000000000000e+00 50 50 1.0046000000000e+00 51 50 -1.6055000000000e-03 52 50 -1.0000000000000e+00 53 50 -2.9571000000000e-03 54 50 0.0000000000000e+00 50 51 -4.4655000000000e-03 51 51 1.0089000000000e+00 52 51 0.0000000000000e+00 53 51 -4.4605000000000e-03 54 51 -1.0000000000000e+00 1 52 -4.4884000000000e-05 8 52 -1.0000000000000e+00 49 52 -1.4761000000000e-07 50 52 -1.0000000000000e+00 51 52 0.0000000000000e+00 52 52 2.0000000000000e+00 53 52 0.0000000000000e+00 54 52 0.0000000000000e+00 6 53 -1.0000000000000e+00 50 53 -9.7121000000000e-05 51 53 -7.3204000000000e-03 52 53 0.0000000000000e+00 53 53 1.0074000000000e+00 1 54 0.0000000000000e+00 9 54 -1.0000000000000e+00 49 54 -1.0000000000000e+00 50 54 0.0000000000000e+00 51 54 -1.0000000000000e+00 52 54 0.0000000000000e+00 54 54 3.0000000000000e+00 55 55 1.0000000000000e+00 58 55 -1.6704000000000e-06 60 55 -1.0000000000000e+00 56 56 1.0004000000000e+00 57 56 1.4365000000000e-02 58 56 -1.0000000000000e+00 59 56 -1.4729000000000e-02 60 56 0.0000000000000e+00 56 57 -1.6904000000000e-04 57 57 1.0003000000000e+00 58 57 0.0000000000000e+00 59 57 -1.6885000000000e-04 60 57 -1.0000000000000e+00 10 58 -1.0000000000000e+00 55 58 -5.4754000000000e-09 56 58 -1.0000000000000e+00 57 58 0.0000000000000e+00 58 58 2.0000000000000e+00 59 58 0.0000000000000e+00 60 58 0.0000000000000e+00 3 59 -1.0000000000000e+00 56 59 -1.9507000000000e-04 57 59 -1.4703000000000e-02 58 59 0.0000000000000e+00 59 59 1.0149000000000e+00 8 60 -1.0000000000000e+00 55 60 -1.0000000000000e+00 56 60 0.0000000000000e+00 57 60 -1.0000000000000e+00 58 60 0.0000000000000e+00 60 60 3.0000000000000e+00 61 61 2.0000000000000e+00 64 61 -2.7743000000000e-18 66 61 -2.0000000000000e+00 62 62 2.0000000000000e+00 63 62 5.8959000000000e-04 64 62 -2.0000000000000e+00 65 62 -5.9741000000000e-04 66 62 0.0000000000000e+00 62 63 -2.7693000000000e-16 63 63 2.0000000000000e+00 64 63 0.0000000000000e+00 65 63 -2.7662000000000e-16 66 63 -2.0000000000000e+00 10 64 -5.0000000000000e-01 61 64 -9.0940000000000e-21 62 64 -2.0000000000000e+00 63 64 0.0000000000000e+00 64 64 2.5000000000000e+00 65 64 0.0000000000000e+00 66 64 0.0000000000000e+00 12 65 -5.0000000000000e-01 62 65 -7.8222000000000e-06 63 65 -5.8959000000000e-04 64 65 0.0000000000000e+00 65 65 5.0060000000000e-01 9 66 -5.0000000000000e-01 61 66 -2.0000000000000e+00 62 66 0.0000000000000e+00 63 66 -2.0000000000000e+00 64 66 0.0000000000000e+00 66 66 4.5000000000000e+00 1 67 -7.4744000000000e-05 2 67 0.0000000000000e+00 3 67 -5.8509000000000e-05 4 67 -5.9078000000000e-05 5 67 -6.1258000000000e-06 6 67 -6.7040000000000e-05 7 67 -6.7243000000000e-05 8 67 -5.9854000000000e-05 9 67 -6.7245000000000e-05 10 67 -6.6855000000000e-05 11 67 -7.4108000000000e-05 12 67 -5.9967000000000e-05 13 67 -6.7614000000000e-05 14 67 -6.7727000000000e-06 15 67 -6.7516000000000e-05 16 67 -6.1301000000000e-06 17 67 -5.8647000000000e-05 18 67 -6.6928000000000e-05 19 67 -6.5000000000000e-06 20 67 1.0802000000000e-05 21 67 -6.1168000000000e-06 22 67 -6.2299000000000e-06 23 67 -1.6932000000000e-05 24 67 -6.4862000000000e-06 25 67 -7.4418000000000e-05 26 67 4.2251000000000e-05 27 67 -7.4409000000000e-05 28 67 -7.4256000000000e-05 29 67 -1.8210000000000e-04 30 67 -7.4677000000000e-05 31 67 -7.3732000000000e-05 32 67 -4.3757000000000e-05 33 67 -7.3775000000000e-05 34 67 -6.6427000000000e-05 35 67 -8.2175000000000e-05 36 67 -7.4068000000000e-05 37 67 -7.3876000000000e-05 38 67 -9.5965000000000e-05 39 67 -7.4055000000000e-05 40 67 -6.6817000000000e-05 41 67 -4.5976000000000e-05 42 67 -7.3796000000000e-05 43 67 -6.0336000000000e-05 44 67 -9.9605000000000e-05 45 67 -6.0427000000000e-05 46 67 -5.9656000000000e-05 47 67 -2.7089000000000e-05 48 67 -5.9856000000000e-05 49 67 -6.6691000000000e-05 50 67 -9.3205000000000e-05 51 67 -6.7776000000000e-05 52 67 -6.0128000000000e-05 53 67 -3.4280000000000e-05 54 67 -6.7297000000000e-05 55 67 -5.9707000000000e-05 56 67 1.1090000000000e-06 57 67 -5.9694000000000e-05 58 67 -6.6005000000000e-05 59 67 -1.2630000000000e-04 60 67 -6.0269000000000e-05 61 67 -6.7210000000000e-05 62 67 -6.3387000000000e-05 63 67 -6.7014000000000e-05 64 67 -6.6835000000000e-05 65 67 -6.2644000000000e-05 66 67 -6.6979000000000e-05 SHAR_EOF fi # end of overwriting check if test -f 'data4' then echo shar: will not over-write existing file "'data4'" else cat << "SHAR_EOF" > 'data4' %%MatrixMarket matrix coordinate real general 137 137 411 2 1 1.0000000000000e+00 9 1 -1.0000000000000e+00 10 1 1.0000000000000e+00 17 1 1.0000000000000e+00 3 2 1.0000000000000e+00 9 2 -1.0000000000000e+00 11 2 1.0000000000000e+00 18 2 1.0000000000000e+00 4 3 1.0000000000000e+00 9 3 -1.0000000000000e+00 12 3 1.0000000000000e+00 19 3 1.0000000000000e+00 5 4 1.0000000000000e+00 9 4 -1.0000000000000e+00 13 4 1.0000000000000e+00 20 4 1.0000000000000e+00 6 5 1.0000000000000e+00 9 5 -1.0000000000000e+00 14 5 1.0000000000000e+00 21 5 1.0000000000000e+00 7 6 1.0000000000000e+00 9 6 -1.0000000000000e+00 15 6 1.0000000000000e+00 22 6 1.0000000000000e+00 8 7 1.0000000000000e+00 9 7 -1.0000000000000e+00 16 7 1.0000000000000e+00 23 7 1.0000000000000e+00 10 8 -1.0000000000000e+01 11 9 -1.0000000000000e+01 12 10 -1.0000000000000e+01 13 11 -1.0000000000000e+01 14 12 -1.0000000000000e+01 15 13 -1.0000000000000e+01 16 14 -1.0000000000000e+01 9 15 1.0000000000000e+00 10 15 -5.0000000000000e-01 11 15 -5.0000000000000e-01 12 15 -5.0000000000000e-01 13 15 -5.0000000000000e-01 14 15 -5.0000000000000e-01 15 15 -5.0000000000000e-01 16 15 -5.0000000000000e-01 1 16 -1.2000000000000e+02 17 17 1.0000000000000e+00 33 17 1.0000000000000e+00 40 17 -1.0000000000000e+00 41 17 1.0000000000000e+00 18 18 1.0000000000000e+00 34 18 1.0000000000000e+00 40 18 -1.0000000000000e+00 42 18 1.0000000000000e+00 19 19 1.0000000000000e+00 35 19 1.0000000000000e+00 40 19 -1.0000000000000e+00 43 19 1.0000000000000e+00 20 20 1.0000000000000e+00 36 20 1.0000000000000e+00 40 20 -1.0000000000000e+00 44 20 1.0000000000000e+00 21 21 1.0000000000000e+00 37 21 1.0000000000000e+00 40 21 -1.0000000000000e+00 45 21 1.0000000000000e+00 22 22 1.0000000000000e+00 38 22 1.0000000000000e+00 40 22 -1.0000000000000e+00 46 22 1.0000000000000e+00 23 23 1.0000000000000e+00 39 23 1.0000000000000e+00 40 23 -1.0000000000000e+00 47 23 1.0000000000000e+00 17 24 -1.0000000000000e+00 24 24 -1.0000000000000e+00 25 24 -1.0000000000000e+00 108 24 -1.0000000000000e+00 115 24 1.0000000000000e+00 18 25 -1.0000000000000e+00 24 25 -1.0000000000000e+00 26 25 -1.0000000000000e+00 109 25 -1.0000000000000e+00 116 25 1.0000000000000e+00 19 26 -1.0000000000000e+00 24 26 -1.0000000000000e+00 27 26 -1.0000000000000e+00 110 26 0.0000000000000e+00 117 26 1.0000000000000e+00 20 27 -1.0000000000000e+00 24 27 -1.0000000000000e+00 28 27 -1.0000000000000e+00 111 27 0.0000000000000e+00 118 27 1.0000000000000e+00 21 28 -1.0000000000000e+00 24 28 -1.0000000000000e+00 29 28 -1.0000000000000e+00 112 28 0.0000000000000e+00 119 28 1.0000000000000e+00 22 29 -1.0000000000000e+00 24 29 -1.0000000000000e+00 30 29 -1.0000000000000e+00 113 29 0.0000000000000e+00 120 29 1.0000000000000e+00 23 30 -1.0000000000000e+00 24 30 -1.0000000000000e+00 31 30 -1.0000000000000e+00 114 30 0.0000000000000e+00 121 30 1.0000000000000e+00 24 31 1.0000000000000e+00 25 31 5.0000000000000e-01 26 31 5.0000000000000e-01 27 31 5.0000000000000e-01 28 31 5.0000000000000e-01 29 31 5.0000000000000e-01 30 31 5.0000000000000e-01 31 31 5.0000000000000e-01 25 32 1.0000000000000e+01 26 33 1.0000000000000e+01 27 34 1.0000000000000e+01 28 35 1.0000000000000e+01 29 36 1.0000000000000e+01 30 37 1.0000000000000e+01 31 38 1.0000000000000e+01 33 39 -1.0000000000000e+00 48 39 1.0000000000000e+00 55 39 -1.0000000000000e+00 62 39 -1.0000000000000e+00 64 39 -1.0000000000000e+00 34 40 -1.0000000000000e+00 49 40 1.0000000000000e+00 56 40 -1.0000000000000e+00 62 40 -1.0000000000000e+00 65 40 -1.0000000000000e+00 32 41 -1.0000000000000e+00 35 41 -1.0000000000000e+00 50 41 1.0000000000000e+00 57 41 -1.0000000000000e+00 62 41 -1.0000000000000e+00 66 41 -1.0000000000000e+00 36 42 -1.0000000000000e+00 51 42 1.0000000000000e+00 58 42 -1.0000000000000e+00 62 42 -1.0000000000000e+00 67 42 -1.0000000000000e+00 37 43 -1.0000000000000e+00 52 43 1.0000000000000e+00 59 43 -1.0000000000000e+00 62 43 -1.0000000000000e+00 68 43 -1.0000000000000e+00 38 44 -1.0000000000000e+00 53 44 1.0000000000000e+00 60 44 -1.0000000000000e+00 62 44 -1.0000000000000e+00 69 44 -1.0000000000000e+00 39 45 -1.0000000000000e+00 54 45 1.0000000000000e+00 61 45 -1.0000000000000e+00 62 45 -1.0000000000000e+00 70 45 -1.0000000000000e+00 41 46 -1.0000000000000e+01 42 47 -1.0000000000000e+01 43 48 -1.0000000000000e+01 44 49 -1.0000000000000e+01 45 50 -1.0000000000000e+01 46 51 -1.0000000000000e+01 47 52 -1.0000000000000e+01 40 53 1.0000000000000e+00 41 53 -5.0000000000000e-01 42 53 -5.0000000000000e-01 43 53 -5.0000000000000e-01 44 53 -5.0000000000000e-01 45 53 -5.0000000000000e-01 46 53 -5.0000000000000e-01 47 53 -5.0000000000000e-01 32 54 -1.0000000000000e+01 48 55 -1.0000000000000e+00 55 55 1.0000000000000e+00 85 55 -1.0000000000000e+00 93 55 -1.0000000000000e+00 101 55 -1.0000000000000e+00 49 56 -1.0000000000000e+00 56 56 1.0000000000000e+00 86 56 -1.0000000000000e+00 93 56 -1.0000000000000e+00 102 56 -1.0000000000000e+00 50 57 -9.9000000000000e-01 57 57 1.0000000000000e+00 87 57 -1.0000000000000e+00 93 57 -1.0000000000000e+00 103 57 -1.0000000000000e+00 51 58 0.0000000000000e+00 58 58 1.0000000000000e+00 88 58 -1.0000000000000e+00 93 58 -1.0000000000000e+00 104 58 -1.0000000000000e+00 52 59 0.0000000000000e+00 59 59 1.0000000000000e+00 89 59 -1.0000000000000e+00 93 59 -1.0000000000000e+00 105 59 -1.0000000000000e+00 53 60 -1.0000000000000e+00 60 60 1.0000000000000e+00 90 60 -1.0000000000000e+00 93 60 -1.0000000000000e+00 106 60 -1.0000000000000e+00 54 61 0.0000000000000e+00 61 61 1.0000000000000e+00 91 61 -1.0000000000000e+00 93 61 -1.0000000000000e+00 107 61 -1.0000000000000e+00 55 62 -1.0000000000000e+00 63 62 -1.0000000000000e+00 71 62 -1.0000000000000e+00 56 63 -1.0000000000000e+00 63 63 -1.0000000000000e+00 72 63 -1.0000000000000e+00 57 64 -1.0000000000000e+00 63 64 -1.0000000000000e+00 73 64 -1.0000000000000e+00 58 65 -1.0000000000000e+00 63 65 -1.0000000000000e+00 74 65 -1.0000000000000e+00 59 66 -1.0000000000000e+00 63 66 -1.0000000000000e+00 75 66 -1.0000000000000e+00 60 67 -1.0000000000000e+00 63 67 -1.0000000000000e+00 76 67 -1.0000000000000e+00 61 68 -1.0000000000000e+00 63 68 -1.0000000000000e+00 77 68 -1.0000000000000e+00 62 69 1.0000000000000e+00 64 69 5.0000000000000e-01 65 69 5.0000000000000e-01 66 69 5.0000000000000e-01 67 69 5.0000000000000e-01 68 69 5.0000000000000e-01 69 69 5.0000000000000e-01 70 69 5.0000000000000e-01 63 70 1.0000000000000e+00 71 70 5.0000000000000e-01 72 70 5.0000000000000e-01 73 70 5.0000000000000e-01 74 70 5.0000000000000e-01 75 70 5.0000000000000e-01 76 70 5.0000000000000e-01 77 70 5.0000000000000e-01 64 71 1.0000000000000e+01 65 72 1.0000000000000e+01 66 73 1.0000000000000e+01 67 74 1.0000000000000e+01 68 75 1.0000000000000e+01 69 76 1.0000000000000e+01 70 77 1.0000000000000e+01 71 78 1.0000000000000e+01 72 79 1.0000000000000e+01 73 80 1.0000000000000e+01 74 81 1.0000000000000e+01 75 82 1.0000000000000e+01 76 83 1.0000000000000e+01 77 84 1.0000000000000e+01 78 85 -1.0000000000000e+00 85 85 1.0000000000000e+00 115 85 -1.0000000000000e+00 123 85 -1.0000000000000e+00 131 85 -1.0000000000000e+00 79 86 -1.0000000000000e+00 86 86 1.0000000000000e+00 116 86 -1.0000000000000e+00 123 86 -1.0000000000000e+00 132 86 -1.0000000000000e+00 80 87 -5.0000000000000e-02 87 87 1.0000000000000e+00 117 87 -1.0000000000000e+00 123 87 -1.0000000000000e+00 133 87 -1.0000000000000e+00 81 88 0.0000000000000e+00 88 88 1.0000000000000e+00 118 88 -1.0000000000000e+00 123 88 -1.0000000000000e+00 134 88 -1.0000000000000e+00 82 89 0.0000000000000e+00 89 89 1.0000000000000e+00 119 89 -1.0000000000000e+00 123 89 -1.0000000000000e+00 135 89 -1.0000000000000e+00 83 90 -9.9000000000000e-01 90 90 1.0000000000000e+00 120 90 -1.0000000000000e+00 123 90 -1.0000000000000e+00 136 90 -1.0000000000000e+00 84 91 0.0000000000000e+00 91 91 1.0000000000000e+00 121 91 -1.0000000000000e+00 123 91 -1.0000000000000e+00 137 91 -1.0000000000000e+00 78 92 1.0000000000000e+00 85 92 -1.0000000000000e+00 92 92 -1.0000000000000e+00 94 92 -1.0000000000000e+00 79 93 1.0000000000000e+00 86 93 -1.0000000000000e+00 92 93 -1.0000000000000e+00 95 93 -1.0000000000000e+00 80 94 1.0000000000000e+00 87 94 -1.0000000000000e+00 92 94 -1.0000000000000e+00 96 94 -1.0000000000000e+00 81 95 1.0000000000000e+00 88 95 -1.0000000000000e+00 92 95 -1.0000000000000e+00 97 95 -1.0000000000000e+00 82 96 1.0000000000000e+00 89 96 -1.0000000000000e+00 92 96 -1.0000000000000e+00 98 96 -1.0000000000000e+00 83 97 1.0000000000000e+00 90 97 -1.0000000000000e+00 92 97 -1.0000000000000e+00 99 97 -1.0000000000000e+00 84 98 1.0000000000000e+00 91 98 -1.0000000000000e+00 92 98 -1.0000000000000e+00 100 98 -1.0000000000000e+00 92 99 1.0000000000000e+00 94 99 5.0000000000000e-01 95 99 5.0000000000000e-01 96 99 5.0000000000000e-01 97 99 5.0000000000000e-01 98 99 5.0000000000000e-01 99 99 5.0000000000000e-01 100 99 5.0000000000000e-01 93 100 1.0000000000000e+00 101 100 5.0000000000000e-01 102 100 5.0000000000000e-01 103 100 5.0000000000000e-01 104 100 5.0000000000000e-01 105 100 5.0000000000000e-01 106 100 5.0000000000000e-01 107 100 5.0000000000000e-01 94 101 1.0000000000000e+01 95 102 1.0000000000000e+01 96 103 1.0000000000000e+01 97 104 1.0000000000000e+01 98 105 1.0000000000000e+01 99 106 1.0000000000000e+01 100 107 1.0000000000000e+01 101 108 1.0000000000000e+01 102 109 1.0000000000000e+01 103 110 1.0000000000000e+01 104 111 1.0000000000000e+01 105 112 1.0000000000000e+01 106 113 1.0000000000000e+01 107 114 1.0000000000000e+01 108 115 1.0000000000000e+00 115 115 -1.0000000000000e+00 122 115 -1.0000000000000e+00 124 115 -1.0000000000000e+00 109 116 1.0000000000000e+00 116 116 -1.0000000000000e+00 122 116 -1.0000000000000e+00 125 116 -1.0000000000000e+00 110 117 1.0000000000000e+00 117 117 -1.0000000000000e+00 122 117 -1.0000000000000e+00 126 117 -1.0000000000000e+00 111 118 1.0000000000000e+00 118 118 -1.0000000000000e+00 122 118 -1.0000000000000e+00 127 118 -1.0000000000000e+00 112 119 1.0000000000000e+00 119 119 -1.0000000000000e+00 122 119 -1.0000000000000e+00 128 119 -1.0000000000000e+00 113 120 1.0000000000000e+00 120 120 -1.0000000000000e+00 122 120 -1.0000000000000e+00 129 120 -1.0000000000000e+00 114 121 1.0000000000000e+00 121 121 -1.0000000000000e+00 122 121 -1.0000000000000e+00 130 121 -1.0000000000000e+00 122 122 1.0000000000000e+00 124 122 5.0000000000000e-01 125 122 5.0000000000000e-01 126 122 5.0000000000000e-01 127 122 5.0000000000000e-01 128 122 5.0000000000000e-01 129 122 5.0000000000000e-01 130 122 5.0000000000000e-01 123 123 1.0000000000000e+00 131 123 5.0000000000000e-01 132 123 5.0000000000000e-01 133 123 5.0000000000000e-01 134 123 5.0000000000000e-01 135 123 5.0000000000000e-01 136 123 5.0000000000000e-01 137 123 5.0000000000000e-01 124 124 1.0000000000000e+01 125 125 1.0000000000000e+01 126 126 1.0000000000000e+01 127 127 1.0000000000000e+01 128 128 1.0000000000000e+01 129 129 1.0000000000000e+01 130 130 1.0000000000000e+01 131 131 1.0000000000000e+01 132 132 1.0000000000000e+01 133 133 1.0000000000000e+01 134 134 1.0000000000000e+01 135 135 1.0000000000000e+01 136 136 1.0000000000000e+01 137 137 1.0000000000000e+01 SHAR_EOF fi # end of overwriting check if test -f 'data5' then echo shar: will not over-write existing file "'data5'" else cat << "SHAR_EOF" > 'data5' %%MatrixMarket matrix coordinate real general 62 62 450 1 1 7.6107080000000e-01 4 1 1.5781500000000e-01 18 1 -2.4489800000000e-01 20 1 1.3286800000000e-02 22 1 -6.0468600000000e-01 24 1 1.3286800000000e-02 25 1 -2.4489800000000e-01 2 2 7.6107080000000e-01 3 2 1.2909240000000e-01 6 2 7.8907500000000e-02 15 2 -3.0234300000000e-01 19 2 -4.8979600000000e-01 21 2 1.3286800000000e-02 29 2 -3.0234300000000e-01 30 2 1.3286800000000e-02 2 3 1.2909240000000e-01 3 3 1.5221400000000e+00 5 3 1.2909240000000e-01 6 3 2.3349520000000e-01 7 3 3.8466680000000e-01 16 3 1.3286800000000e-02 19 3 -4.8979600000000e-01 21 3 -6.0468600000000e-01 26 3 -4.8979600000000e-01 28 3 1.3286800000000e-02 29 3 1.3286800000000e-02 32 3 9.2069420000000e-01 34 3 -6.0468600000000e-01 36 3 1.3286800000000e-02 1 4 1.5781500000000e-01 4 4 1.5221400000000e+00 8 4 1.5781500000000e-01 17 4 1.3286800000000e-02 20 4 -4.8979600000000e-01 22 4 -6.0468600000000e-01 25 4 1.3286800000000e-02 27 4 -4.8979600000000e-01 33 4 1.3286800000000e-02 35 4 -6.0468600000000e-01 37 4 1.3286800000000e-02 3 5 1.2909240000000e-01 5 5 7.6107090000000e-01 7 5 2.3349520000000e-01 9 5 3.0575930000000e-01 23 5 1.3286800000000e-02 26 5 -4.8979600000000e-01 28 5 -3.0234300000000e-01 34 5 1.3286800000000e-02 38 5 9.2069420000000e-01 40 5 -3.0234300000000e-01 2 6 7.8907500000000e-02 3 6 6.6434200000000e-03 6 6 1.6339700000000e+00 7 6 1.2527530000000e-01 10 6 1.8850680000000e-01 19 6 1.3286800000000e-02 29 6 -3.0234300000000e-01 32 6 -4.7452800000000e-01 34 6 1.3286800000000e-02 41 6 -7.4074100000000e-01 42 6 1.3286800000000e-02 3 7 1.5781500000000e-01 5 7 6.6434200000000e-03 6 7 -8.9839500000000e-03 7 7 3.6707200000000e+00 9 7 1.2527530000000e-01 10 7 6.6434200000000e-03 11 7 3.7701370000000e-01 26 7 1.3286800000000e-02 30 7 1.3286800000000e-02 32 7 6.2509500000000e-02 34 7 -6.0468600000000e-01 38 7 -4.7452800000000e-01 40 7 1.3286800000000e-02 41 7 1.3286800000000e-02 44 7 1.3286800000000e-02 46 7 -1.4814800000000e+00 48 7 1.3286800000000e-02 4 8 1.5781500000000e-01 6 8 -1.2083300000000e-01 8 8 2.7123900000000e+00 9 8 1.2083330000000e-01 12 8 3.7701370000000e-01 27 8 1.3286800000000e-02 31 8 1.3286800000000e-02 32 8 4.8333330000000e-01 33 8 -8.4489800000000e-01 35 8 -6.0468600000000e-01 38 8 -4.8333300000000e-01 39 8 -8.4489800000000e-01 45 8 1.3286800000000e-02 47 8 -1.4814800000000e+00 49 8 1.3286800000000e-02 5 9 7.8907500000000e-02 7 9 -8.9839500000000e-03 9 9 2.0367500000000e+00 11 9 6.6434200000000e-03 13 9 1.8850680000000e-01 36 9 1.3286800000000e-02 38 9 6.2509500000000e-02 40 9 -3.0234300000000e-01 46 9 1.3286800000000e-02 50 9 1.3286800000000e-02 52 9 -7.4074100000000e-01 6 10 2.8109940000000e-01 7 10 9.9236000000000e-02 10 10 1.9513200000000e+00 11 10 3.0664330000000e-01 32 10 3.8365720000000e-01 41 10 -7.4074100000000e-01 44 10 -1.2000000000000e+00 46 10 1.3286800000000e-02 53 10 -7.4074100000000e-01 54 10 1.3286800000000e-02 7 11 4.6960630000000e-01 9 11 9.9236000000000e-02 10 11 3.0664330000000e-01 11 11 3.9026400000000e+00 13 11 3.0664330000000e-01 38 11 3.8365720000000e-01 42 11 1.3286800000000e-02 44 11 -1.2000000000000e+00 46 11 -1.4814800000000e+00 50 11 -1.2000000000000e+00 52 11 1.3286800000000e-02 53 11 1.3286800000000e-02 57 11 -1.4814800000000e+00 59 11 1.3286800000000e-02 8 12 3.7701370000000e-01 12 12 3.9026400000000e+00 14 12 3.7701370000000e-01 39 12 1.3286800000000e-02 43 12 1.3286800000000e-02 45 12 -1.2000000000000e+00 47 12 -1.4814800000000e+00 51 12 -1.2000000000000e+00 56 12 1.3286800000000e-02 58 12 -1.4814800000000e+00 60 12 1.3286800000000e-02 9 13 1.8850680000000e-01 11 13 3.0664330000000e-01 13 13 1.9513200000000e+00 48 13 1.3286800000000e-02 50 13 -1.2000000000000e+00 52 13 -7.4074100000000e-01 57 13 1.3286800000000e-02 62 13 -7.4074100000000e-01 12 14 3.7701370000000e-01 14 14 1.9513200000000e+00 51 14 1.3286800000000e-02 55 14 1.3286800000000e-02 56 14 -6.0000000000000e-01 58 14 -1.4814800000000e+00 61 14 -6.0000000000000e-01 2 15 -3.0234300000000e-01 15 15 9.8818740000000e-01 16 15 -5.4294300000000e-01 3 16 1.3286800000000e-02 15 16 -5.4294300000000e-01 16 16 1.9763700000000e+00 19 16 -6.5783400000000e-01 21 16 -5.4294300000000e-01 4 17 1.3286800000000e-02 17 17 1.9763700000000e+00 18 17 -6.5783400000000e-01 20 17 -6.5783400000000e-01 22 17 -5.4294300000000e-01 1 18 -2.4489800000000e-01 17 18 -6.5783400000000e-01 18 18 9.8818740000000e-01 2 19 -4.8979600000000e-01 3 19 -4.8979600000000e-01 6 19 1.3286800000000e-02 16 19 -6.5783400000000e-01 19 19 1.9763700000000e+00 21 19 -5.3147400000000e-02 29 19 -5.3147400000000e-02 30 19 -6.5783400000000e-01 1 20 1.3286800000000e-02 4 20 -4.8979600000000e-01 17 20 -6.5783400000000e-01 20 20 1.9763700000000e+00 22 20 -5.3147400000000e-02 31 20 -6.5783400000000e-01 2 21 1.3286800000000e-02 3 21 -6.0468600000000e-01 16 21 -5.4294300000000e-01 19 21 -5.3147400000000e-02 21 21 1.9763700000000e+00 23 21 -5.4294300000000e-01 1 22 -6.0468600000000e-01 4 22 -6.0468600000000e-01 17 22 -5.4294300000000e-01 20 22 -5.3147400000000e-02 22 22 1.9763700000000e+00 24 22 -5.4294300000000e-01 25 22 -5.3147400000000e-02 5 23 1.3286800000000e-02 21 23 -5.4294300000000e-01 23 23 1.9763700000000e+00 26 23 -6.5783400000000e-01 28 23 -5.4294300000000e-01 1 24 1.3286800000000e-02 22 24 -5.4294300000000e-01 24 24 1.9763700000000e+00 25 24 -6.5783400000000e-01 27 24 -6.5783400000000e-01 1 25 -2.4489800000000e-01 4 25 1.3286800000000e-02 22 25 -5.3147400000000e-02 24 25 -6.5783400000000e-01 25 25 9.8818740000000e-01 3 26 -4.8979600000000e-01 5 26 -4.8979600000000e-01 7 26 1.3286800000000e-02 23 26 -6.5783400000000e-01 26 26 1.9763700000000e+00 28 26 -5.3147400000000e-02 34 26 -5.3147400000000e-02 36 26 -6.5783400000000e-01 4 27 -4.8979600000000e-01 8 27 1.3286800000000e-02 24 27 -6.5783400000000e-01 27 27 1.9763700000000e+00 35 27 -5.3147400000000e-02 37 27 -6.5783400000000e-01 3 28 1.3286800000000e-02 5 28 -3.0234300000000e-01 23 28 -5.4294300000000e-01 26 28 -5.3147400000000e-02 28 28 9.8818740000000e-01 2 29 -3.0234300000000e-01 3 29 1.3286800000000e-02 6 29 -3.0234300000000e-01 19 29 -5.3147400000000e-02 29 29 9.8818740000000e-01 30 29 -5.4294300000000e-01 2 30 1.3286800000000e-02 6 30 -9.0740700000000e-01 7 30 1.3286800000000e-02 19 30 -6.5783400000000e-01 29 30 -5.4294300000000e-01 30 30 1.9763700000000e+00 32 30 -2.4726500000000e+00 34 30 -5.4294300000000e-01 8 31 1.3286800000000e-02 20 31 -6.5783400000000e-01 31 31 1.9763700000000e+00 33 31 -6.5783400000000e-01 35 31 -5.4294300000000e-01 3 32 1.3286800000000e-02 6 32 6.2509500000000e-02 7 32 -4.7452800000000e-01 10 32 1.3286800000000e-02 30 32 -6.5783400000000e-01 32 32 6.1189300000000e+00 34 32 -5.3147400000000e-02 41 32 -5.3147400000000e-02 42 32 -1.5346300000000e+00 4 33 1.3286800000000e-02 6 33 4.8333330000000e-01 7 33 -4.8333300000000e-01 8 33 -8.4489800000000e-01 31 33 -6.5783400000000e-01 33 33 3.5633700000000e+00 35 33 -5.3147400000000e-02 43 33 -1.5346300000000e+00 3 34 -6.0468600000000e-01 5 34 1.3286800000000e-02 6 34 1.3286800000000e-02 7 34 -1.5120900000000e+00 26 34 -5.3147400000000e-02 30 34 -5.4294300000000e-01 32 34 -1.8679600000000e+00 34 34 1.9763700000000e+00 36 34 -5.4294300000000e-01 4 35 -6.0468600000000e-01 8 35 -6.0468600000000e-01 27 35 -5.3147400000000e-02 31 35 -5.4294300000000e-01 33 35 -5.3147400000000e-02 35 35 1.9763700000000e+00 37 35 -5.4294300000000e-01 3 36 1.3286800000000e-02 7 36 -9.0740700000000e-01 9 36 1.3286800000000e-02 26 36 -6.5783400000000e-01 34 36 -5.4294300000000e-01 36 36 1.9763700000000e+00 38 36 -2.4726500000000e+00 40 36 -5.4294300000000e-01 4 37 1.3286800000000e-02 27 37 -6.5783400000000e-01 35 37 -5.4294300000000e-01 37 37 1.9763700000000e+00 39 37 -6.5783400000000e-01 5 38 1.3286800000000e-02 7 38 6.2509500000000e-02 9 38 -4.7452800000000e-01 11 38 1.3286800000000e-02 36 38 -6.5783400000000e-01 38 38 6.1189300000000e+00 40 38 -5.3147400000000e-02 46 38 -5.3147400000000e-02 48 38 -1.5346300000000e+00 7 39 4.8333330000000e-01 8 39 -8.4489800000000e-01 9 39 -4.8333300000000e-01 12 39 1.3286800000000e-02 37 39 -6.5783400000000e-01 39 39 3.5633700000000e+00 47 39 -5.3147400000000e-02 49 39 -1.5346300000000e+00 5 40 -3.0234300000000e-01 7 40 1.3286800000000e-02 9 40 -1.2097500000000e+00 36 40 -5.4294300000000e-01 38 40 -1.8679600000000e+00 40 40 9.8818740000000e-01 6 41 -1.1111100000000e+00 7 41 1.3286800000000e-02 10 41 -7.4074100000000e-01 32 41 -7.9388800000000e-01 41 41 2.5751900000000e+00 42 41 -1.2531500000000e+00 6 42 1.3286800000000e-02 7 42 -3.7037000000000e-01 11 42 1.3286800000000e-02 32 42 -2.2753700000000e+00 41 42 -1.2531500000000e+00 42 42 5.1503700000000e+00 44 42 -1.5346300000000e+00 46 42 -1.2531500000000e+00 12 43 1.3286800000000e-02 33 43 -1.5346300000000e+00 43 43 5.1503700000000e+00 45 43 -1.5346300000000e+00 47 43 -1.2531500000000e+00 7 44 1.3286800000000e-02 10 44 -1.2000000000000e+00 11 44 -1.2000000000000e+00 42 44 -1.5346300000000e+00 44 44 5.1503700000000e+00 46 44 -5.3147400000000e-02 53 44 -5.3147400000000e-02 54 44 -1.5346300000000e+00 8 45 1.3286800000000e-02 12 45 -1.2000000000000e+00 43 45 -1.5346300000000e+00 45 45 5.1503700000000e+00 47 45 -5.3147400000000e-02 55 45 -1.5346300000000e+00 7 46 -1.8518500000000e+00 9 46 1.3286800000000e-02 10 46 1.3286800000000e-02 11 46 -1.4814800000000e+00 38 46 -7.9388800000000e-01 42 46 -1.2531500000000e+00 44 46 -5.3147400000000e-02 46 46 5.1503700000000e+00 48 46 -1.2531500000000e+00 8 47 -1.4814800000000e+00 12 47 -1.4814800000000e+00 39 47 -5.3147400000000e-02 43 47 -1.2531500000000e+00 45 47 -5.3147400000000e-02 47 47 5.1503700000000e+00 49 47 -1.2531500000000e+00 7 48 1.3286800000000e-02 9 48 -3.7037000000000e-01 13 48 1.3286800000000e-02 38 48 -2.2753700000000e+00 46 48 -1.2531500000000e+00 48 48 5.1503700000000e+00 50 48 -1.5346300000000e+00 52 48 -1.2531500000000e+00 8 49 1.3286800000000e-02 39 49 -1.5346300000000e+00 47 49 -1.2531500000000e+00 49 49 5.1503700000000e+00 51 49 -1.5346300000000e+00 9 50 1.3286800000000e-02 11 50 -1.2000000000000e+00 13 50 -1.2000000000000e+00 48 50 -1.5346300000000e+00 50 50 5.1503700000000e+00 52 50 -5.3147400000000e-02 57 50 -5.3147400000000e-02 59 50 -1.5346300000000e+00 12 51 -1.2000000000000e+00 14 51 1.3286800000000e-02 49 51 -1.5346300000000e+00 51 51 5.1503700000000e+00 58 51 -5.3147400000000e-02 60 51 -1.5346300000000e+00 9 52 -7.4074100000000e-01 11 52 1.3286800000000e-02 13 52 -7.4074100000000e-01 48 52 -1.2531500000000e+00 50 52 -5.3147400000000e-02 52 52 2.5751900000000e+00 10 53 -7.4074100000000e-01 11 53 1.3286800000000e-02 44 53 -5.3147400000000e-02 53 53 2.5751900000000e+00 54 53 -1.2531500000000e+00 10 54 1.3286800000000e-02 44 54 -1.5346300000000e+00 53 54 -1.2531500000000e+00 54 54 5.1503700000000e+00 57 54 -1.2531500000000e+00 14 55 1.3286800000000e-02 45 55 -1.5346300000000e+00 55 55 5.1503700000000e+00 56 55 -1.5346300000000e+00 58 55 -1.2531500000000e+00 12 56 1.3286800000000e-02 14 56 -6.0000000000000e-01 55 56 -1.5346300000000e+00 56 56 2.5751900000000e+00 58 56 -5.3147400000000e-02 11 57 -1.4814800000000e+00 13 57 1.3286800000000e-02 50 57 -5.3147400000000e-02 54 57 -1.2531500000000e+00 57 57 5.1503700000000e+00 59 57 -1.2531500000000e+00 12 58 -1.4814800000000e+00 14 58 -1.4814800000000e+00 51 58 -5.3147400000000e-02 55 58 -1.2531500000000e+00 56 58 -5.3147400000000e-02 58 58 5.1503700000000e+00 60 58 -1.2531500000000e+00 11 59 1.3286800000000e-02 50 59 -1.5346300000000e+00 57 59 -1.2531500000000e+00 59 59 5.1503700000000e+00 62 59 -1.2531500000000e+00 12 60 1.3286800000000e-02 51 60 -1.5346300000000e+00 58 60 -1.2531500000000e+00 60 60 5.1503700000000e+00 61 60 -1.5346300000000e+00 14 61 -6.0000000000000e-01 60 61 -1.5346300000000e+00 61 61 2.5751900000000e+00 13 62 -7.4074100000000e-01 59 62 -1.2531500000000e+00 62 62 2.5751900000000e+00 SHAR_EOF fi # end of overwriting check if test -f 'decomp.c' then echo shar: will not over-write existing file "'decomp.c'" else cat << "SHAR_EOF" > 'decomp.c' /*---------------------------------------------------------------------- SDDPACK: Software for the Semidiscrete Decomposition. Copyright (c) 1999 Tamara G. Kolda and Dianne P. O'Leary. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. PROGRAM: decomp DESCRIPTION: Computes (or expands) the Semidiscrete Decomposition (SDD) of a sparse matrix. USAGE: decomp [options] infile outfile OPTIONS: -k terms Desired number of terms in SDD (Default: 100) -a accuarcy Desired SDD accuracy (Default: 0) -t tolerance Tolerance for inner iterations (Default: 0.01) -i its Max inner iterations (Default: 100) -y choice Initialization for inner loop... 1 = Threshold (Default) 2 = Cycling 3 = Ones 4 = Periodic Ones -e filename Expand existing SDD -b I/O in binary format FILE FORMATS: EXTERNAL SUBROUTINES: read_sparse, free_sparse, read_sdd, compute_sdd, write_sdd, free_sdd - sdd.c PROGRAM DEPENDENCIES: decomp.c, sdd.h, sdd.o BUG REPORTS: Email Tamara.Kolda@na-net.ornl.gov. ----------------------------------------------------------------------*/ #include #include #include #include "sdd.h" /* semidiscrete decomposition */ #define TERMS 100 /* default number of terms */ #define ACCR 0.0 /* default desired accuarcy */ #define TOL 0.01 /* default tolerance */ #define ITS 100 /* default max inner its */ #define YINIT 1 /* default initialization choice */ #define BFLAG 0 /* default I/O in binary format? */ void usage(char *); int main(int argc, char* argv[]) { int i; /* counter */ int terms = TERMS; /* number of terms in SDD */ float accr = ACCR; /* desired accuary of SDD */ float tol = TOL; /* tolerance */ int its = ITS; /* max its for inner iteration */ int yinit = YINIT; /* choice for initialization */ int bflag = BFLAG; /* I/O in binary format? */ char *matrixf; /* matrix file name */ matrix *A; /* matrix */ char *decompf; /* sdd file name */ sdd *S; /* sdd */ char *edecompf = NULL; /* existing sdd file name */ int eterms = 0; /* no. of terms in existing sdd */ sdd *E = NULL; /* existing sdd */ char note[MAXLINE]; /* note for sdd file */ /* Parse command line */ if (argc < 3) { usage(argv[0]); return(-1); } matrixf = argv[argc-2]; decompf = argv[argc-1]; i = 1; while (i < argc - 2) { if (argv[i][0] != '-') { usage(argv[0]); return(-1); } switch (argv[i][1]) { case 'e': edecompf = argv[++i]; break; case 'k': terms = atoi(argv[++i]); break; case 'a': accr = atof(argv[++i]); break; case 't': tol = atof(argv[++i]); break; case 'i': its = atoi(argv[++i]); break; case 'y': yinit = atoi(argv[++i]); break; case 'b': bflag = 1; break; default: usage(argv[0]); return(-1); } i++; } /* Output values being used */ fprintf(stdout, "*** output from %s ***\n", argv[0]); fprintf(stdout, "matrix file : %s\n", matrixf); fprintf(stdout, "SDD file : %s\n", decompf); fprintf(stdout, "existing SDD file : "); if (edecompf) fprintf(stdout, "%s\n", edecompf); else fprintf(stdout, "\n"); fprintf(stdout, "terms : %d\n", terms); fprintf(stdout, "accuracy : %f\n", accr); fprintf(stdout, "tolerance : %f\n", tol); fprintf(stdout, "max inner its : %d\n", its); fprintf(stdout, "y init choice : %d\n", yinit); fprintf(stdout, "input type : "); if (bflag) fprintf(stdout, "binary\n"); else fprintf(stdout, "text\n"); /* Create note for SDD file */ if (!bflag) { if (edecompf) sprintf(note, "Matrix: %s Old SDD: %s Terms: %d Accr: %.2e Tol: %.2e InnIts: %d Init: %d", matrixf, edecompf, terms, accr, tol, its, yinit); else sprintf(note, "Matrix: %s Terms: %d Accr: %.2e Tol: %.2e InnIts: %d Init: %d", matrixf, terms, accr, tol, its, yinit); } /* Read matrix matrix */ if ((A = read_matrix(matrixf, bflag)) == NULL) { fprintf(stderr, "Error reading sparse matrix.\n"); return (-1); } /* Read exisiting SDD if one exists */ if (edecompf) { if ((E = read_sdd(edecompf, bflag)) == NULL) { fprintf(stderr, "Error reading existing SDD from file.\n"); return (-1); } eterms = E->k; } /* Compute SDD */ S = compute_sdd(A, E, eterms, terms, accr, its, tol, yinit); /* Save SDD */ write_sdd(S, decompf, bflag, note); /* Free memory and exit */ free_matrix(A); free_sdd(S); return (0); } /* main */ /*----------------------------------------------------------------------*/ void usage(char *name) { fprintf(stderr, "\n"); fprintf(stderr, "USAGE: decomp [options] infile outfile\n"); fprintf(stderr, "Computes Semidiscrete Decomposition (SDD).\n"); fprintf(stderr, "OPTIONS: -k terms Terms in SDD (Default: 100)\n"); fprintf(stderr, " -a accuarcy Desired residual norm (Default: 0)\n"); fprintf(stderr, " -t tol Tolerance (Default: 0.01)\n"); fprintf(stderr, " -i its Max inner iterations (Default: 100)\n"); fprintf(stderr, " -y (1|2|3|4) Initialization Choice\n"); fprintf(stderr, " 1 = Threshold (Default)\n"); fprintf(stderr, " 2 = Cycling\n"); fprintf(stderr, " 3 = All Ones\n"); fprintf(stderr, " 4 = Periodic Ones\n"); fprintf(stderr, " -e filename Expand exisiting SDD\n"); fprintf(stderr, " -b I/O in binary format\n"); fprintf(stderr, "\n"); return; } /* usage */ SHAR_EOF fi # end of overwriting check if test -f 'res1' then echo shar: will not over-write existing file "'res1'" else cat << "SHAR_EOF" > 'res1' *** output from decomp *** matrix file : data1 SDD file : res1_1 existing SDD file : terms : 10 accuracy : 0.000000 tolerance : 0.010000 max inner its : 100 y init choice : 1 input type : text Iteration Residual Improvement Inner Total Number Squared (beta) Its InnerIts --------- -------- ----------- ----- -------- 1 2 1.41e+00 5.75170e+00 3 3 2 4 5.57e-01 8.51472e-01 3 6 3 7 2.19e-01 3.38517e-01 3 9 4 10 1.33e-01 8.60342e-02 2 11 5 11 1.02e-01 3.10079e-02 2 13 6 12 5.00e-02 5.18036e-02 4 17 7 17 2.60e-02 2.40155e-02 2 19 8 19 1.33e-02 1.26359e-02 3 22 9 22 7.27e-03 6.06216e-03 2 24 10 23 5.02e-03 2.25306e-03 2 26 -- SDD information -- final residual norm : 7.0859e-02 final relative residual norm: 0.026 total outer iterations : 10 average inner iterations : 2.600 average init iterations : 2.300 SHAR_EOF fi # end of overwriting check if test -f 'res1_1' then echo shar: will not over-write existing file "'res1_1'" else cat << "SHAR_EOF" > 'res1_1' %% Semidiscrete Decomposition (SDD) %% Matrix: data1 Terms: 10 Accr: 0.00e+00 Tol: 1.00e-02 InnIts: 100 Init: 1 10 5 5 4.7965389490127563476562500e-01 3.2624220848083496093750000e-01 1.9394071400165557861328125e-01 8.4672987461090087890625000e-02 1.0166592150926589965820312e-01 5.8767084032297134399414062e-02 3.8742337375879287719726562e-02 3.2449815422296524047851562e-02 5.5055230855941772460937500e-02 2.3733202368021011352539062e-02 1 1 1 1 1 0 1 -1 1 -1 -1 0 1 1 0 -1 1 1 -1 0 1 -1 0 -1 0 1 1 -1 -1 1 -1 -1 1 0 1 0 -1 -1 1 0 0 0 0 0 1 1 -1 -1 -1 0 1 1 1 1 1 0 0 0 1 -1 0 1 1 -1 0 0 1 0 1 1 1 0 0 0 0 0 1 -1 -1 0 0 1 1 -1 -1 -1 0 -1 1 -1 -1 1 0 0 0 0 0 1 0 0 SHAR_EOF fi # end of overwriting check if test -f 'res2' then echo shar: will not over-write existing file "'res2'" else cat << "SHAR_EOF" > 'res2' *** output from decomp *** matrix file : data2 SDD file : res2_1 existing SDD file : terms : 10 accuracy : 0.000000 tolerance : 0.010000 max inner its : 100 y init choice : 1 input type : text Iteration Residual Improvement Inner Total Number Squared (beta) Its InnerIts --------- -------- ----------- ----- -------- 1 25 2.76e+10 9.99951e+10 2 2 2 29 2.64e+10 1.23592e+09 2 4 3 109 1.62e+10 1.01468e+10 2 6 4 113 1.49e+10 1.27935e+09 2 8 5 126 4.94e+09 1.00000e+10 2 10 6 157 2.85e+09 2.09321e+09 2 12 7 241 7.47e+08 2.10117e+09 2 14 8 245 6.13e+08 1.34090e+08 4 18 9 254 4.79e+08 1.34090e+08 4 22 10 255 4.52e+08 2.66598e+07 3 25 -- SDD information -- final residual norm : 2.1262e+04 final relative residual norm: 0.060 total outer iterations : 10 average inner iterations : 2.500 average init iterations : 25.500 SHAR_EOF fi # end of overwriting check if test -f 'res2_1' then echo shar: will not over-write existing file "'res2_1'" else cat << "SHAR_EOF" > 'res2_1' %% Semidiscrete Decomposition (SDD) %% Matrix: data2 Terms: 10 Accr: 0.00e+00 Tol: 1.00e-02 InnIts: 100 Init: 1 10 132 132 3.1622000000000000000000000e+05 2.0297117187500000000000000e+04 7.1227843750000000000000000e+04 2.0650646484375000000000000e+04 1.0000000000000000000000000e+05 3.2351289062500000000000000e+04 2.6464863281250000000000000e+04 1.1579740234375000000000000e+04 1.1579740234375000000000000e+04 2.1079133300781250000000000e+03 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 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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EOF fi # end of overwriting check if test -f 'res3' then echo shar: will not over-write existing file "'res3'" else cat << "SHAR_EOF" > 'res3' *** output from decomp *** matrix file : data3 SDD file : res3_1 existing SDD file : terms : 10 accuracy : 0.000000 tolerance : 0.010000 max inner its : 100 y init choice : 1 input type : text Iteration Residual Improvement Inner Total Number Squared (beta) Its InnerIts --------- -------- ----------- ----- -------- 1 2 4.48e+02 1.22514e+01 3 3 2 5 4.39e+02 9.00000e+00 2 5 3 8 4.24e+02 1.51235e+01 2 7 4 9 4.12e+02 1.22500e+01 2 9 5 10 4.00e+02 1.22507e+01 2 11 6 11 3.91e+02 9.00000e+00 2 13 7 16 3.84e+02 6.25000e+00 3 16 8 18 3.75e+02 9.00000e+00 2 18 9 22 3.69e+02 6.25000e+00 3 21 10 24 3.60e+02 9.00000e+00 2 23 -- SDD information -- final residual norm : 1.8979e+01 final relative residual norm: 0.884 total outer iterations : 10 average inner iterations : 2.300 average init iterations : 2.400 SHAR_EOF fi # end of overwriting check if test -f 'res3_1' then echo shar: will not over-write existing file "'res3_1'" else cat << "SHAR_EOF" > 'res3_1' %% Semidiscrete Decomposition (SDD) %% Matrix: data3 Terms: 10 Accr: 0.00e+00 Tol: 1.00e-02 InnIts: 100 Init: 1 10 66 67 1.7501000165939331054687500e+00 3.0000000000000000000000000e+00 1.2963000535964965820312500e+00 3.5000000000000000000000000e+00 3.5000998973846435546875000e+00 3.0000000000000000000000000e+00 1.2500000000000000000000000e+00 3.0000000000000000000000000e+00 1.2500000000000000000000000e+00 3.0000000000000000000000000e+00 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 -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 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 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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 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 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 0 0 0 0 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 SHAR_EOF fi # end of overwriting check if test -f 'res4' then echo shar: will not over-write existing file "'res4'" else cat << "SHAR_EOF" > 'res4' *** output from decomp *** matrix file : data4 SDD file : res4_1 existing SDD file : terms : 10 accuracy : 0.000000 tolerance : 0.010000 max inner its : 100 y init choice : 1 input type : text Iteration Residual Improvement Inner Total Number Squared (beta) Its InnerIts --------- -------- ----------- ----- -------- 1 16 6.69e+03 1.44000e+04 2 2 2 32 6.59e+03 1.00000e+02 2 4 3 33 6.49e+03 1.00000e+02 2 6 4 34 6.39e+03 1.00000e+02 2 8 5 35 6.29e+03 1.00000e+02 2 10 6 36 6.19e+03 1.00000e+02 2 12 7 37 6.09e+03 1.00000e+02 2 14 8 38 5.99e+03 1.00000e+02 2 16 9 46 5.89e+03 1.00000e+02 2 18 10 47 5.79e+03 1.00000e+02 2 20 -- SDD information -- final residual norm : 7.6070e+01 final relative residual norm: 0.524 total outer iterations : 10 average inner iterations : 2.000 average init iterations : 4.700 SHAR_EOF fi # end of overwriting check if test -f 'res4_1' then echo shar: will not over-write existing file "'res4_1'" else cat << "SHAR_EOF" > 'res4_1' %% Semidiscrete Decomposition (SDD) %% Matrix: data4 Terms: 10 Accr: 0.00e+00 Tol: 1.00e-02 InnIts: 100 Init: 1 10 137 137 1.2000000000000000000000000e+02 1.0000000000000000000000000e+01 1.0000000000000000000000000e+01 1.0000000000000000000000000e+01 1.0000000000000000000000000e+01 1.0000000000000000000000000e+01 1.0000000000000000000000000e+01 1.0000000000000000000000000e+01 1.0000000000000000000000000e+01 1.0000000000000000000000000e+01 -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 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 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 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 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 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 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 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 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 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 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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 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 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 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 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 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 SHAR_EOF fi # end of overwriting check if test -f 'res5' then echo shar: will not over-write existing file "'res5'" else cat << "SHAR_EOF" > 'res5' *** output from decomp *** matrix file : data5 SDD file : res5_1 existing SDD file : terms : 10 accuracy : 0.000000 tolerance : 0.010000 max inner its : 100 y init choice : 1 input type : text Iteration Residual Improvement Inner Total Number Squared (beta) Its InnerIts --------- -------- ----------- ----- -------- 1 7 9.02e+02 3.69325e+01 3 3 2 11 8.32e+02 6.93254e+01 3 6 3 12 7.83e+02 4.90489e+01 2 8 4 32 7.33e+02 5.00851e+01 3 11 5 33 6.99e+02 3.47098e+01 2 13 6 36 6.49e+02 5.00851e+01 4 17 7 38 6.32e+02 1.67452e+01 3 20 8 39 5.97e+02 3.47098e+01 2 22 9 41 5.73e+02 2.38037e+01 4 26 10 43 5.31e+02 4.20228e+01 4 30 -- SDD information -- final residual norm : 2.3049e+01 final relative residual norm: 0.752 total outer iterations : 10 average inner iterations : 3.000 average init iterations : 4.300 SHAR_EOF fi # end of overwriting check if test -f 'res5_1' then echo shar: will not over-write existing file "'res5_1'" else cat << "SHAR_EOF" > 'res5_1' %% Semidiscrete Decomposition (SDD) %% Matrix: data5 Terms: 10 Accr: 0.00e+00 Tol: 1.00e-02 InnIts: 100 Init: 1 10 62 62 3.0386052131652832031250000e+00 9.2513221502304077148437500e-01 1.4006980657577514648437500e+00 3.5385417938232421875000000e+00 2.9457499980926513671875000e+00 3.5385417938232421875000000e+00 2.0460424423217773437500000e+00 2.9457499980926513671875000e+00 7.5283193588256835937500000e-01 1.0804166793823242187500000e+00 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 -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 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 1 0 -1 0 -1 0 1 0 -1 0 0 0 1 0 0 -1 0 1 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 -1 0 -1 0 0 0 -1 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 1 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 0 0 0 0 0 0 0 1 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 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 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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 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 0 0 0 0 0 0 0 0 0 0 0 -1 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 0 0 0 0 -1 0 1 0 -1 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 0 0 0 0 0 0 0 1 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 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 -1 0 0 0 0 0 0 0 0 1 -1 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 -1 0 -1 0 0 0 1 0 0 0 0 0 0 1 0 -1 0 0 SHAR_EOF fi # end of overwriting check cd .. if test ! -d 'Src' then mkdir 'Src' fi cd 'Src' if test -f 'qsortopt.h' then echo shar: will not over-write existing file "'qsortopt.h'" else cat << "SHAR_EOF" > 'qsortopt.h' /*---------------------------------------------------------------------- SDDPACK: Software for the Semidiscrete Decomposition. Copyright (c) 1999 Tamara G. Kolda and Dianne P. O'Leary. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. This next piece of code is a customized version of the GNU qsort for the data type we are sorting here. It will be used if the -DQSORTOPT flag is used in compliation. It should generally make the code faster, but may be incompatible with some machine types. To determine if this qsort will work for you, first compile without the flag, time and test the code. Then try the same thing again with the flag on. If you do not get the same answers or the code is slower, than you should not use this option. ----------------------------------------------------------------------*/ #ifdef QSORTOPT #include /* used by our optimized qsort */ /* Slightly Modified so the compare operation is in-lined. -T. Kolda */ /* Plug-compatible replacement for UNIX qsort. Copyright (C) 1989 Free Software Foundation, Inc. Written by Douglas C. Schmidt (schmidt@ics.uci.edu) This file is part of GNU CC. GNU QSORT is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU QSORT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU QSORT; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef sparc #include #endif /* Invoke the comparison function, returns either 0, < 0, or > 0. */ #define CMP(A,B) (((sdddouble_plus*)(B))->val - ((sdddouble_plus*)(A))->val) #define size (sizeof(sdddouble_plus)) /* Byte-wise swap two items of size SIZE. */ #define SWAP(A,B,SIZE) do {int sz = (SIZE); char *a = (A); char *b = (B); \ do { char _temp = *a;*a++ = *b;*b++ = _temp;} while (--sz);} while (0) /* Copy SIZE bytes from item B to item A. */ #define COPY(A,B,SIZE) {int sz = (SIZE); do { *(A)++ = *(B)++; } while (--sz); } /* This should be replaced by a standard ANSI macro. */ #ifndef BYTES_PER_WORD #define BYTES_PER_WORD (sizeof(ulong)) #endif /* The next 4 #defines implement a very fast in-line stack abstraction. */ #define STACK_SIZE (BYTES_PER_WORD * sizeof (long)) #define PUSH(LOW,HIGH) do {top->lo = LOW;top++->hi = HIGH;} while (0) #define POP(LOW,HIGH) do {LOW = (--top)->lo;HIGH = top->hi;} while (0) #define STACK_NOT_EMPTY (stack < top) /* Discontinue quicksort algorithm when partition gets below this size. This particular magic number was chosen to work best on a Sun 4/260. */ #define MAX_THRESH 4 /* Stack node declarations used to store unfulfilled partition obligations. */ typedef struct { char *lo; char *hi; } stack_node; /* Order size using quicksort. This implementation incorporates four optimizations discussed in Sedgewick: 1. Non-recursive, using an explicit stack of pointer that store the next array partition to sort. To save time, this maximum amount of space required to store an array of MAX_INT is allocated on the stack. Assuming a 32-bit integer, this needs only 32 * sizeof (stack_node) == 136 bits. Pretty cheap, actually. 2. Chose the pivot element using a median-of-three decision tree. This reduces the probability of selecting a bad pivot value and eliminates certain extraneous comparisons. 3. Only quicksorts TOTAL_ELEMS / MAX_THRESH partitions, leaving insertion sort to order the MAX_THRESH items within each partition. This is a big win, since insertion sort is faster for small, mostly sorted array segments. 4. The larger of the two sub-partitions is always pushed onto the stack first, with the algorithm then concentrating on the smaller partition. This *guarantees* no more than log (n) stack size is needed (actually O(1) in this case)! */ int qsortopt (char *base_ptr, int total_elems) { /* Allocating SIZE bytes for a pivot buffer facilitates a better algorithm below since we can do comparisons directly on the pivot. */ char *pivot_buffer = (char *) alloca (size); int max_thresh = MAX_THRESH * size; if (total_elems > MAX_THRESH) { char *lo = base_ptr; char *hi = lo + size * (total_elems - 1); stack_node stack[STACK_SIZE]; /* Largest size needed for 32-bit int!!! */ stack_node *top = stack + 1; while (STACK_NOT_EMPTY) { char *left_ptr; char *right_ptr; { char *pivot = pivot_buffer; { /* Select median value from among LO, MID, and HI. Rearrange LO and HI so the three values are sorted. This lowers the probability of picking a pathological pivot value and skips a comparison for both the LEFT_PTR and RIGHT_PTR. */ char *mid = lo + size * ((hi - lo) / size >> 1); if (CMP (mid, lo) < 0) SWAP (mid, lo, size); if (CMP (hi, mid) < 0) SWAP (mid, hi, size); else goto jump_over; if (CMP (mid, lo) < 0) SWAP (mid, lo, size); jump_over: COPY (pivot, mid, size); pivot = pivot_buffer; } left_ptr = lo + size; right_ptr = hi - size; /* Here's the famous ``collapse the walls'' section of quicksort. Gotta like those tight inner loops! They are the main reason that this algorithm runs much faster than others. */ do { while (CMP (left_ptr, pivot) < 0) left_ptr += size; while (CMP (pivot, right_ptr) < 0) right_ptr -= size; if (left_ptr < right_ptr) { SWAP (left_ptr, right_ptr, size); left_ptr += size; right_ptr -= size; } else if (left_ptr == right_ptr) { left_ptr += size; right_ptr -= size; break; } } while (left_ptr <= right_ptr); } /* Set up pointers for next iteration. First determine whether left and right partitions are below the threshold size. If so, ignore one or both. Otherwise, push the larger partition's bounds on the stack and continue sorting the smaller one. */ if ((right_ptr - lo) <= max_thresh) { if ((hi - left_ptr) <= max_thresh) /* Ignore both small partitions. */ POP (lo, hi); else /* Ignore small left partition. */ lo = left_ptr; } else if ((hi - left_ptr) <= max_thresh) /* Ignore small right partition. */ hi = right_ptr; else if ((right_ptr - lo) > (hi - left_ptr)) /* Push larger left partition indices. */ { PUSH (lo, right_ptr); lo = left_ptr; } else /* Push larger right partition indices. */ { PUSH (left_ptr, hi); hi = right_ptr; } } } /* Once the BASE_PTR array is partially sorted by quicksort the rest is completely sorted using insertion sort, since this is efficient for partitions below MAX_THRESH size. BASE_PTR points to the beginning of the array to sort, and END_PTR points at the very last element in the array (*not* one beyond it!). */ #define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) { char *end_ptr = base_ptr + size * (total_elems - 1); char *run_ptr; char *tmp_ptr = base_ptr; char *thresh = MIN (end_ptr, base_ptr + max_thresh); /* Find smallest element in first threshold and place it at the array's beginning. This is the smallest array element, and the operation speeds up insertion sort's inner loop. */ for (run_ptr = tmp_ptr + size; run_ptr <= thresh; run_ptr += size) if (CMP (run_ptr, tmp_ptr) < 0) tmp_ptr = run_ptr; if (tmp_ptr != base_ptr) SWAP (tmp_ptr, base_ptr, size); /* Insertion sort, running from left-hand-side up to `right-hand-side.' Pretty much straight out of the original GNU qsort routine. */ for (run_ptr = base_ptr + size; (tmp_ptr = run_ptr += size) <= end_ptr; ) { while (CMP (run_ptr, tmp_ptr -= size) < 0) ; if ((tmp_ptr += size) != run_ptr) { char *trav; for (trav = run_ptr + size; --trav >= run_ptr;) { char c = *trav; char *hi, *lo; for (hi = lo = trav; (lo -= size) >= tmp_ptr; hi = lo) *hi = *lo; *hi = c; } } } } return 1; } #endif SHAR_EOF fi # end of overwriting check if test -f 'sdd.c' then echo shar: will not over-write existing file "'sdd.c'" else cat << "SHAR_EOF" > 'sdd.c' /*---------------------------------------------------------------------- SDDPACK: Software for the Semidiscrete Decomposition. Copyright (c) 1999 Tamara G. Kolda and Dianne P. O'Leary. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. MODULE: sdd.o DESCRIPTION: Routines for creating and updating SDD's and sparse matrices. EXTERNAL SUBROUTINES: No external subroutines MODULE DEPENDENCIES: sdd.c sdd.h BUG REPORTS: Email Tamara.Kolda@na-net.ornl.gov. ----------------------------------------------------------------------*/ #include "sdd.h" /* header file */ /*---------------------------------------------------------------------- Internal Definitions, Macros, and Structures ----------------------------------------------------------------------*/ /* Max length of comment line in data file. */ #define MAXLINE 1000 /* Information level. Higher numbers yield more info. */ #ifndef INFO #define INFO 10 #endif /* Sets every bit in the first y bytes pointed to by x to zero or one respectively. */ #define bzero(x, y) memset(x, 0, y) #define bone(x, y) memset(x, 0xff, y) /* Structure for reading in and sorting matrix entries from MatrixMarket formatted file. */ typedef struct entry_struct { int i, j; /* indicies */ float val; /* entry */ } entry; /*---------------------------------------------------------------------- Internal Function Declarations ----------------------------------------------------------------------*/ /* Internal svector functions */ int numwords(int); void free_svector(svector*); svector* create_svector(svector*, int); void write_svector(svector*, FILE*, int); svector* read_svector(int, FILE*, int); int svcount(svector*); /* Initialization functions */ sdddouble *init_threshold(svector*, matrix*, sdd*, sddfloat, int*); void init_cycle(svector*, int); void init_ones(svector*); void init_pones(svector*); /* Internal smatrix functions */ void free_smatrix(smatrix*); smatrix* create_smatrix(smatrix*, int, int, int); void write_smatrix(smatrix*, FILE*, int); smatrix* read_smatrix(int, int, FILE*, int); void expand_smatrix(smatrix*, svector*); void smxv(smatrix*, int, sdddouble*, int, sdddouble*); /* Internal dmatrix functions */ void free_dmatrix(dmatrix*); dmatrix* create_dmatrix(dmatrix*, int, int); void write_dmatrix(dmatrix*, FILE*, int); dmatrix* read_dmatrix(int, FILE*, int); void expand_dmatrix(dmatrix*, sddfloat); /* Internal SDD functions */ sdd* create_sdd(sdd*, int, int, int, int); void expand_sdd(sdd*, sddfloat, svector*, svector*); void sddxsv(sdddouble*, sdd*, svector*, int); /* Internal sparse matrix (matrix) functions */ double fnormsq(matrix*); /* Internal functions the combine objects */ void matrixxsv(sdddouble*, matrix*, svector*, int); sdddouble_plus subproblem(matrix*, sdd*, svector*, svector*, int, sdddouble*); /* Internal utility functions */ int comparentry(const entry *a, const entry *b) { if (a->j == b->j) return (a->i > b->i ? 1 : -1); else return (a->j > b->j ? 1 : -1); } #ifdef QSORTOPT /* use optimized GNU qsort */ #include "qsortopt.h" #else /* use system-provided qsort */ int compar(const sdddouble_plus *a, const sdddouble_plus *b) { return(a->val > b->val ? -1 : 1); } #endif /*------------------------------------------------------------------------ Functions for S-Vectors ------------------------------------------------------------------------*/ int numwords(int x) { /* Returns the number of words needed to store x bits. On error, returns 0. */ int i; if (x < 0) return (0); /* error */ i = x >> IDXSHIFT; /* whole words */ if (x & IDXMASK) i ++; /* partial word */ return (i); } /* numwords */ /*------------------------------------------------------------------------*/ void free_svector(svector *x) { /* Frees the memory used by x. Does nothing if x is NULL. */ if (x == NULL) { fprintf(stderr, "Warning: Trying to free null svector.\n"); return; } free(x->val); free(x->sgn); free(x); return; } /* free_svector */ /*------------------------------------------------------------------------*/ svector* create_svector(svector *x, int m) { /* Creates an svector that holds m svalues. If x is non-null, the first min(x->m, m) entries are preserved. On error, returns NULL. */ int nwrds = numwords(m); if (x == NULL) { /* create new svector */ if ((x = (svector*) calloc(1, sizeof(svector))) == NULL) { fprintf(stderr, "Error allocating space for svector.\n"); return (NULL); } x->m = m; if (((x->val = (ulong*) calloc(nwrds, sizeof(ulong))) == NULL) || ((x->sgn = (ulong*) calloc(nwrds, sizeof(ulong))) == NULL)) { fprintf(stderr, "Error allocating space for svector components.\n"); return (NULL); } } /* if - create new svector */ else { /* enlarge or shrink previous svector */ x->m = m; if (((x->val = (ulong*) realloc(x->val, nwrds * sizeof(ulong))) == NULL) || ((x->sgn = (ulong*) realloc(x->sgn, nwrds * sizeof(ulong))) == NULL)) { fprintf(stderr, "Error shrinking/enlarging svector.\n"); return (NULL); } } /* else - enlarge or shrink previous svector */ return(x); } /* create_svector */ /*------------------------------------------------------------------------*/ void write_svector(svector *x, FILE *fptr, int bflag) { /* Writes x to the file pointed to by fptr in text (bflag=0) or binary (bflag=1) format. On error, does nothing. */ int i; /* counter */ ulong *valptr, *sgnptr; /* local pointers */ ulong mask; /* bit mask */ ulong val, sgn; /* current val and sgn words */ if (x == NULL) { fprintf(stderr, "Warning: Trying to write NULL svector to file.\n"); return; } if (bflag) { /* binary */ i = numwords(x->m); if (((fwrite(x->val, sizeof(ulong), i, fptr)) < i) || ((fwrite(x->sgn, sizeof(ulong), i, fptr)) < i)) { fprintf(stderr, "Error writing svector to binary file.\n"); return; } } /* if - binary */ else { /* text */ valptr = x->val; sgnptr = x->sgn; val = *valptr; sgn = *sgnptr; mask = ONE; /* Loop through each s-value in x. */ for (i = 0; i < x->m; i ++) { /* Print out the appropriate value. */ if (val & mask) { if (sgn & mask) fprintf(fptr, " -1"); else fprintf(fptr, " 1"); } else fprintf(fptr, " 0"); /* Update mask, val, and sgn. */ if (mask == MAXMASK) { mask = ONE; val = *(++valptr); sgn = *(++sgnptr); fprintf(fptr, "\n"); } else mask <<= 1; } /* i-loop */ if (mask != (ONE)) fprintf(fptr, "\n"); } /* else - text */ return; } /* write_svector */ /*------------------------------------------------------------------------*/ svector* read_svector(int m, FILE *fptr, int bflag) { /* Reads an svector from the file pointed to by fptr in text (bflag=0) or binary (bflag=1) format. Returns a pointer to the svector. On error, returns NULL. */ int i; /* counter */ svector *x; /* new svector */ int tmp; /* svalue read from file */ int idx; /* index */ ulong mask; /* bit mask */ i = numwords(m); if ((x = create_svector(NULL, m)) == NULL) return (NULL); if (bflag) { /* binary */ if (((fread(x->val, sizeof(ulong), i, fptr)) < i) || ((fread(x->sgn, sizeof(ulong), i, fptr)) < i)) { fprintf(stderr, "Error reading svector from binary file.\n"); return (NULL); } } /* if - binary */ else { /* text */ bzero(x->val, numwords(m) * sizeof(ulong)); /* set val to all zeros */ bzero(x->sgn, numwords(m) * sizeof(ulong)); /* set sgn to all zeros */ for (i = 0; i < m; i ++) { if ((fscanf(fptr, "%d", &tmp)) < 1) { fprintf(stderr, "Error reading svector from text file.\n"); return (NULL); } if (tmp != 0) { idx = i >> IDXSHIFT; /* word index */ mask = ONE << (i & IDXMASK); /* bit mask */ x->val[idx] |= mask; /* turn correct val bit to 1 */ if (tmp == -1) x->sgn[idx] |= mask; /* turn correct sgn bit to 1 */ } } /* i-loop */ } /* else - text */ return (x); } /* read_svector */ /*------------------------------------------------------------------------*/ sdddouble *init_threshold(svector *y, matrix *A, sdd *B, sddfloat rho, int *idx) { int i; /* counter */ int m, n; /* size of A */ int localidx; /* initialization index */ sdddouble *s; /* return vector */ sdddouble sqnorms = 0; /* squared norm of s */ if ((y == NULL) || (A == NULL) || (B == NULL)) { /* error */ fprintf(stderr, "Error in initialization of y.\n"); return (NULL); } /* Allocate space for s and init to zero. */ m = (A->m > A->n) ? A->m : A->n; if ((s = (sdddouble*) calloc(m, sizeof(sdddouble))) == NULL) { fprintf(stderr, "Error allocating space for s.\n"); return (NULL); } /* Set sizes. */ m = A->m; n = A->n; while (sqnorms < (rho / n)) { /* Set y */ bzero(y->val, numwords(n) * sizeof(ulong)); bzero(y->sgn, numwords(n) * sizeof(ulong)); localidx = (*idx) % n; y->val[localidx >> IDXSHIFT] |= ONE << (localidx & IDXMASK); /* Update iidx */ (*idx) ++; /* Compute s */ matrixxsv(s, A, y, 0); /* s = A * y */ sddxsv(s, B, y, 0); /* s = s - B * y */ /* Compute squared norm of s */ sqnorms = 0; for (i = 0; i < m; i ++) sqnorms += s[i] * s[i]; } /* while loop */ return (s); } /*------------------------------------------------------------------------*/ void init_cycle(svector *y, int idx) { int n; /* size of A */ int localidx; /* initialization index */ if (y == NULL) { fprintf(stderr, "Error trying to initialize NULL y-vector.\n"); return; } n = y->m; /* Set y */ bzero(y->val, numwords(n) * sizeof(ulong)); bzero(y->sgn, numwords(n) * sizeof(ulong)); localidx = idx % n; y->val[localidx >> IDXSHIFT] |= ONE << (localidx & IDXMASK); return; } /*------------------------------------------------------------------------*/ void init_ones(svector *x) { /* Initializes x so that every 100th s-value is 1, and all other values are set to 0. Does nothing on error. */ int m; /* size of x */ if (x == NULL) { fprintf(stderr, "Error trying to initialize NULL y-vector.\n"); return; } m = x->m; bone(x->val, numwords(m) * sizeof(ulong)); /* set x to all ones */ bzero(x->sgn, numwords(m) * sizeof(ulong)); /* set x to all oness */ return; } /* init_pones */ /*------------------------------------------------------------------------*/ void init_pones(svector *x) { /* Initializes x so that every 100th s-value is 1, and all other values are set to 0. Does nothing on error. */ int i; /* counter */ int m; /* size of x */ if (x == NULL) { fprintf(stderr, "Error trying to initialize NULL y-vector.\n"); return; } m = x->m; bzero(x->val, numwords(m) * sizeof(ulong)); /* set x to all zeros */ bzero(x->sgn, numwords(m) * sizeof(ulong)); /* set x to all zeros */ /* set every 100th element in x to 1 */ for (i = 0 ; i < m ; i += 100) { x->val[i >> IDXSHIFT] |= ONE << (i & IDXMASK); } return; } /* init_pones */ /*------------------------------------------------------------------------*/ int svcount(svector *x) { /* Returns the number of non-zero values in x. On error, returns zero. */ int i, j; /* counters */ int cnt; /* counter */ int nwrds; /* number of whole words used in x */ ulong val; /* temporary variable */ ulong mask; /* mask for final word */ static int *cntlookup = NULL; /* static look-up table */ if (x == NULL) return(0); /* error */ /* The array cntlookup is a lookup table of length 2^8 that, for each byte used as an index, returns the number of 1-bits in that byte. Allocate space for and compute the static look-up table cntlookup. Note that since this variable is static, we only compute the look-up table the first time this function is called. We use this table for speed. For a given byte x, cntlookup[x] = number of one bits in x. */ if (cntlookup == NULL) { if ((cntlookup = (int*) calloc(256, sizeof(int))) == NULL) { fprintf(stderr, "Error allocating space for look-up table.\n"); return(0); } for (i = 0; i < 256; i ++) { mask = i; cnt = 0; for (j = 0; j < 8; j ++) { if (mask & 1) cnt ++; mask >>= 1; } cntlookup[i] = cnt; } } nwrds = numwords(x->m); /* number of words in x */ /* compute mask for final partial word with (x->m & idxmask) 1-bits */ mask = (ONE << (x->m & IDXMASK)) - 1; if (mask) x->val[nwrds - 1] &= mask; /* Count the number of 1 bits in the whole words of val. For efficiency, we look at the val array one byte at a time (rather than one bit at a time) using the cntlookup array. The means we trade 8 right shifts, 8 AND's, and 8 adds for one right shift, one and, one add, and one array look-up. Generally, the cntlookup array should easily fit into cache memory. */ cnt = 0; for (i = 0 ; i < nwrds; i ++) { val = x->val[i]; for (j = 0 ; j < sizeof(ulong) ; j ++) { cnt += cntlookup[val & 0xff]; val >>= 8; } } return(cnt); } /* svcount */ /*------------------------------------------------------------------------ Functions for S-Matrices ------------------------------------------------------------------------*/ smatrix* create_smatrix(smatrix *A, int kmin, int kmax, int m) { /* Returns a ptr to an smatrix of maximum dimension m by kmax, and of current dimension m by kmin. If A is non-null, then the first min(A->m, m) s-values of the first kmin columns of A are preserved. On error, returns NULL. */ int k; /* counter */ if ((kmax <= 0) || (m <= 0) || (kmin < 0)) { /* error checking */ fprintf(stderr, "Error in requested size of smatrix.\n"); return (NULL); } if (kmin > kmax) { /* error checking */ fprintf(stderr, "Max k-dimension less than min dimension.\n"); return (NULL); } if (A == NULL) { /* starting from scratch */ if (kmin != 0) { /* error checking */ fprintf(stderr, "Invalid kmin dimension.\n"); return (NULL); } if ((A = (smatrix*) calloc(1, sizeof(smatrix))) == NULL) { fprintf(stderr, "Error allocating memory for smatrix.\n"); return (NULL); } A->k = 0; /* current columns in A */ A->kmax = kmax; /* max size columns in A */ A->m = m; /* number of rows in A */ /* allocate column pointers */ if ((A->col = (svector**) calloc(kmax, sizeof(svector*))) == NULL) { fprintf(stderr, "Error allocating space for smatrix columns.\n"); return (NULL); } } /* if - starting from scratch */ else { /* enlarging or shrinking A */ /* If nothing needs to be changed, just return A. */ if ((A->k == kmin) && (A->kmax == kmax) && (A->m == m)) return (A); /* If the current A has too many columns defined, delete some. */ if (kmin < A->k) { for (k = kmin; k < A->k; k ++) free_svector(A->col[k]); A->k = kmin; } /* If the current A does not have the right number of rows, re-create each column vector, adjusting to the new size. */ if (m != A->m) { for (k = 0; k < A->k; k ++) if ((A->col[k] = create_svector(A->col[k], m)) == NULL) { fprintf(stderr, "Error recreating svectors.\n"); return (NULL); } A->m = m; } /* If A does not have the right maximum number of columns, adjust that. */ if (kmax != A->kmax) { if ((A->col = (svector**) realloc(A->col, kmax * sizeof(svector*))) == NULL) { fprintf(stderr, "Error enlarging number of columns in A matrix,\n"); return (NULL); } A->kmax = kmax; } } /* else - enlarging / shrinking A */ return (A); } /* create_smatrix */ /*------------------------------------------------------------------------*/ void write_smatrix(smatrix *A, FILE *fptr, int bflag) { /* Writes the smatrix A to the file pointed to by fptr in text (flag=0) or binary (bflag=1) format. */ int k; /* counter */ /* Simply write each svector to the file in sequence. */ for (k = 0; k < A->k; k ++) write_svector(A->col[k], fptr, bflag); return; } /* write_smatrix */ /*------------------------------------------------------------------------*/ smatrix* read_smatrix(int m, int k, FILE *fptr, int bflag) { /* Read in an smatrix of size m by k from the file pointed to by fptr in text (bflag=0) or binary (bflag=1) format. Return a pointer to the new smatrix. On error, returns NULL. */ smatrix *A; /* smatrix to be read in */ /* Create the matrix */ if ((A = (smatrix*) calloc(1, sizeof(smatrix))) == NULL) { fprintf(stderr, "Error allocating memory for smatrix.\n"); return (NULL); } A->m = m; A->k = k; A->kmax = k; if ((A->col = (svector**) calloc(k, sizeof(svector*))) == NULL) { fprintf(stderr, "Error allocating memory for smatrix columns.\n"); return (NULL); } /* Read in the columns in sequence */ for (k = 0; k < A->k; k ++) if ((A->col[k] = read_svector(m, fptr, bflag)) == NULL) { fprintf(stderr, "Error reading smatrix from file.\n"); return (NULL); } return (A); } /* read_smatrix */ /*------------------------------------------------------------------------*/ void expand_smatrix(smatrix *A, svector *x) { /* Add x as the next column in A. On error, prints message. */ if (x->m != A->m) { fprintf(stderr, "Error: Size mismatch.\n"); return; } if (A->k == A->kmax) { fprintf(stderr, "Error: Smatrix is full.\n"); return; } A->col[A->k] = x; A->k ++; return; } /* expand_smatrix */ /*------------------------------------------------------------------------*/ void free_smatrix(smatrix *A) { /* Frees the memory used by A. */ int k; /* counter */ if (A == NULL) { fprintf(stderr, "Warning: Trying to free NULL smatrix.\n"); return; } if (A->col != NULL) { for (k = 0; k < A->k; k ++) free_svector(A->col[k]); free(A->col); } free(A); return; } /* free_smatrix */ /*------------------------------------------------------------------------ Functions for D-Matrices ------------------------------------------------------------------------*/ dmatrix* create_dmatrix(dmatrix *D, int kmin, int kmax) { /* Returns a ptr to a dmatrix of maximum size kmax. If D is non-null then the first kmin elements of D are preserved. On error, returns NULL. */ if ((kmin < 0) || (kmax <= 0) || (kmin > kmax)) { /* error checking */ fprintf(stderr, "Error in parameters for dmatrix.\n"); return (NULL); } if (D == NULL) { /* start from scratch */ if ((D = (dmatrix*) calloc(1, sizeof(dmatrix))) == NULL) { fprintf(stderr, "Error allocating space for dmatrix.\n"); return (NULL); } D->k = 0; D->kmax = kmax; if ((D->d = (sddfloat*) calloc(kmax, sizeof(sddfloat))) == NULL) { fprintf(stderr, "Error allocating space for dmatrix values,\n"); return (NULL); } } /* if - start from scratch */ else { /* enlarging or shrinking D */ /* Delete extra elements, if necessary. */ if (kmin > D->k) { fprintf(stderr, "Error: kmin too big for dmatrix.\n"); return (NULL); } D->k = kmin; /* Expand or shrink maximum number of elements, if necessary. */ if (D->kmax != kmax) { D->kmax = kmax; if ((D->d = (sddfloat*) realloc(D->d, kmax * sizeof(sddfloat))) == NULL) { fprintf(stderr, "Error in reallocating memory for dmatrix.\n"); return (NULL); } } } /* else - enlarge/shrink */ return (D); } /* create_dmatrix */ /*------------------------------------------------------------------------*/ void write_dmatrix(dmatrix *D, FILE *fptr, int bflag) { /* Writes D to the file pointed to by fptr in text (bflag=0) or binary (bflag=1) format. On error, prints message.*/ int k; /* counter */ if (bflag) { /* binary */ if ((fwrite(D->d, sizeof(sddfloat), D->k, fptr)) < D->k) { fprintf(stderr, "Error writing dmatrix to binary file.\n"); return; } } /* if - binary */ else { /* text */ for (k = 0; k < D->k; k ++) fprintf(fptr, "%30.25e\n", D->d[k]); } /* else - text */ return; } /* write_dmatrix */ /*------------------------------------------------------------------------*/ dmatrix* read_dmatrix(int k, FILE *fptr, int bflag) { /* Read a dmatrix of size k from the file pointed to by fptr in text format (bflag=0) or binary format (bflag=1). Return a ptr to the dmatrix. On error, returns NULL. */ int i; /* counter */ dmatrix *D; /* matrix to be read in */ if ((D = (dmatrix*) calloc(1, sizeof(dmatrix))) == NULL) { fprintf(stderr, "Error allocating space for dmatrix.\n"); return (NULL); } D->k = k; /* set current size */ D->kmax = k; /* set max size */ if ((D->d = (sddfloat*) calloc(k, sizeof(sddfloat))) == NULL) { fprintf(stderr, "Error allocating space for dmatrix entries.\n"); return (NULL); } if (bflag) { /* binary */ if ((fread(D->d, sizeof(sddfloat), k, fptr)) < k) { fprintf(stderr, "Error reading D from file.\n"); return (NULL); } } /* if - binary */ else { /* text */ for (i = 0; i < k; i ++) i