50 #define IS_UPPER_TRI 97
51 #define IS_LOWER_TRI 98
59 int *rowLengths,
int *rowToBlock);
69 int *I,
int *J,
double *
A,
70 int *rp,
int *cval,
double *aval);
74 #define __FUNC__ "mat_dh_print_graph_private"
77 double *aval,
int *n2o,
int *o2n,
Hash_i_dh hash,
82 bool private_n2o =
false;
83 bool private_hash =
false;
101 for (i = 0; i < m; ++i)
104 for (j = rp[row]; j < rp[row + 1]; ++j)
107 if (col < beg_row || col >= beg_row + m)
117 "beg_row= %i m= %i; nonlocal column= %i not in hash table",
139 fprintf (fp,
"%i %i %g\n", 1 + row + beg_row, 1 + col, val);
163 #define __FUNC__ "mat_dh_print_graph_private"
166 double *aval,
int *n2o,
int *o2n,
Hash_i_dh hash,
170 bool private_n2o =
false;
171 bool private_hash =
false;
174 work = (
int *)
MALLOC_DH (m *
sizeof (
int));
193 for (i = 0; i < m; ++i)
195 for (j = 0; j < m; ++j)
198 for (j = rp[row]; j < rp[row + 1]; ++j)
203 if (col >= beg_row || col < beg_row + m)
218 "beg_row= %i m= %i; nonlocal column= %i not in hash table",
231 for (j = 0; j < m; ++j)
267 #define __FUNC__ "create_nat_ordering_private"
273 tmp = *p = (
int *)
MALLOC_DH (m *
sizeof (
int));
275 for (i = 0; i < m; ++i)
282 #define __FUNC__ "destroy_nat_ordering_private"
292 #define __FUNC__ "invert_perm"
298 for (i = 0; i < m; ++i)
306 #define __FUNC__ "mat_dh_print_csr_private"
313 fprintf (fp,
"%i %i\n", m, rp[m]);
316 for (i = 0; i <= m; ++i)
317 fprintf (fp,
"%i ", rp[i]);
321 for (i = 0; i < nz; ++i)
322 fprintf (fp,
"%i ", cval[i]);
326 for (i = 0; i < nz; ++i)
327 fprintf (fp,
"%1.19e ", aval[i]);
335 #define __FUNC__ "mat_dh_read_csr_private"
338 double **avalOUT, FILE * fp)
345 items = fscanf (fp,
"%d %d", &m, &nz);
352 printf (
"mat_dh_read_csr_private:: m= %i nz= %i\n", m, nz);
356 rp = *rpOUT = (
int *)
MALLOC_DH ((m + 1) *
sizeof (int));
358 cval = *cvalOUT = (
int *)
MALLOC_DH (nz *
sizeof (
int));
360 aval = *avalOUT = (
double *)
MALLOC_DH (nz *
sizeof (
double));
364 for (i = 0; i <= m; ++i)
366 items = fscanf (fp,
"%d", &(rp[i]));
369 sprintf (
msgBuf_dh,
"failed item %i of %i in rp block", i, m + 1);
375 for (i = 0; i < nz; ++i)
377 items = fscanf (fp,
"%d", &(cval[i]));
380 sprintf (
msgBuf_dh,
"failed item %i of %i in cval block", i, m + 1);
386 for (i = 0; i < nz; ++i)
388 items = fscanf (fp,
"%lg", &(aval[i]));
391 sprintf (
msgBuf_dh,
"failed item %i of %i in aval block", i, m + 1);
401 #define __FUNC__ "mat_dh_read_triples_private"
404 int **cvalOUT,
double **avalOUT, FILE * fp)
408 int *cval, *rp, *I, *J;
417 (
"mat_dh_read_triples_private:: ignoring following header lines:\n");
419 (
"--------------------------------------------------------------\n");
420 for (i = 0; i < ignore; ++i)
426 (
"--------------------------------------------------------------\n");
427 if (fgetpos (fp, &fpos))
429 printf (
"\nmat_dh_read_triples_private::1st two non-ignored lines:\n");
431 (
"--------------------------------------------------------------\n");
432 for (i = 0; i < 2; ++i)
438 (
"--------------------------------------------------------------\n");
439 if (fsetpos (fp, &fpos))
451 items = fscanf (fp,
"%d %d %lg", &i, &j, &v);
465 printf (
"mat_dh_read_triples_private: m= %i nz= %i\n", m, nz);
471 for (i = 0; i < ignore; ++i)
479 sprintf (
msgBuf_dh,
"matrix is not square; row= %i, cols= %i", m, n);
486 rp = *rpOUT = (
int *)
MALLOC_DH ((m + 1) *
sizeof (int));
488 cval = *cvalOUT = (
int *)
MALLOC_DH (nz *
sizeof (
int));
490 aval = *avalOUT = (
double *)
MALLOC_DH (nz *
sizeof (
double));
493 I = (
int *)
MALLOC_DH (nz *
sizeof (
int));
495 J = (
int *)
MALLOC_DH (nz *
sizeof (
int));
497 A = (
double *)
MALLOC_DH (nz *
sizeof (
double));
503 items = fscanf (fp,
"%d %d %lg", &i, &j, &v);
525 printf (
"CAUTION: matrix is upper triangular; converting to full\n");
529 printf (
"CAUTION: matrix is lower triangular; converting to full\n");
553 #define __FUNC__ "convert_triples_to_scr_private"
556 int *rp,
int *cval,
double *aval)
561 rowCounts = (
int *)
MALLOC_DH ((m + 1) *
sizeof (int));
563 for (i = 0; i < m; ++i)
567 for (i = 0; i < nz; ++i)
575 for (i = 1; i <= m; ++i)
577 rp[i] = rp[i - 1] + rowCounts[i - 1];
579 memcpy (rowCounts, rp, (m + 1) *
sizeof (
int));
582 for (i = 0; i < nz; ++i)
587 int idx = rowCounts[row];
609 #define __FUNC__ "readMat"
617 makeStructurallySymmetric =
623 SET_V_ERROR (
"passed NULL filename; can't open for reading!");
626 if (!strcmp (ft,
"csr"))
632 else if (!strcmp (ft,
"trip"))
638 else if (!strcmp (ft,
"ebin"))
644 else if (!strcmp (ft,
"petsc"))
646 sprintf (
msgBuf_dh,
"must recompile Euclid using petsc mode!");
652 sprintf (
msgBuf_dh,
"unknown filetype: -ftin %s", ft);
656 if (makeStructurallySymmetric)
658 printf (
"\npadding with zeros to make structurally symmetric\n");
678 #define __FUNC__ "fix_diags_private"
683 double *aval = A->
aval;
684 bool insertDiags =
false;
687 for (i = 0; i < m; ++i)
689 bool isMissing =
true;
690 for (j = rp[i]; j < rp[i + 1]; ++j)
715 for (i = 0; i < m; ++i)
718 for (j = rp[i]; j < rp[i + 1]; ++j)
720 sum =
MAX (sum, fabs (aval[j]));
722 for (j = rp[i]; j < rp[i + 1]; ++j)
735 #define __FUNC__ "insert_missing_diags_private"
741 double *AVAL = A->
aval, *aval;
742 int i, j, nz = RP[m] + m;
745 rp = A->
rp = (
int *)
MALLOC_DH ((1 + m) *
sizeof (int));
749 aval = A->
aval = (
double *)
MALLOC_DH (nz *
sizeof (
double));
753 for (i = 0; i < m; ++i)
755 bool isMissing =
true;
756 for (j = RP[i]; j < RP[i + 1]; ++j)
782 #define __FUNC__ "readVec"
790 SET_V_ERROR (
"passed NULL filename; can't open for reading!");
793 if (!strcmp (ft,
"csr") || !strcmp (ft,
"trip"))
799 else if (!strcmp (ft,
"ebin"))
805 else if (!strcmp (ft,
"petsc"))
807 sprintf (
msgBuf_dh,
"must recompile Euclid using petsc mode!");
813 sprintf (
msgBuf_dh,
"unknown filetype: -ftin %s", ft);
821 #define __FUNC__ "writeMat"
827 SET_V_ERROR (
"passed NULL filename; can't open for writing!");
830 if (!strcmp (ft,
"csr"))
836 else if (!strcmp (ft,
"trip"))
842 else if (!strcmp (ft,
"ebin"))
849 else if (!strcmp (ft,
"petsc"))
851 sprintf (
msgBuf_dh,
"must recompile Euclid using petsc mode!");
857 sprintf (
msgBuf_dh,
"unknown filetype: -ftout %s", ft);
864 #define __FUNC__ "writeVec"
870 SET_V_ERROR (
"passed NULL filename; can't open for writing!");
873 if (!strcmp (ft,
"csr") || !strcmp (ft,
"trip"))
879 else if (!strcmp (ft,
"ebin"))
885 else if (!strcmp (ft,
"petsc"))
887 sprintf (
msgBuf_dh,
"must recompile Euclid using petsc mode!");
893 sprintf (
msgBuf_dh,
"unknown filetype: -ftout %s", ft);
900 #define __FUNC__ "isTriangular"
906 bool type_lower =
false, type_upper =
false;
910 SET_ERROR (-1,
"only implemented for a single cpu");
913 for (row = 0; row < m; ++row)
915 for (j = rp[row]; j < rp[row + 1]; ++j)
923 if (type_lower && type_upper)
927 if (type_lower && type_upper)
944 int *rpIN,
int *cvalIN,
952 #define __FUNC__ "mat_dh_transpose_reuse_private"
955 int *rpIN,
int *cvalIN,
double *avalIN,
956 int *rpOUT,
int *cvalOUT,
double *avalOUT)
960 &rpOUT, &cvalOUT, &avalOUT);
966 #define __FUNC__ "mat_dh_transpose_private"
969 int *CVAL,
int **cvalOUT,
970 double *AVAL,
double **avalOUT)
974 rpOUT, cvalOUT, avalOUT);
979 #define __FUNC__ "mat_dh_transpose_private_private"
982 int *RP,
int *CVAL,
double *AVAL,
983 int **rpOUT,
int **cvalOUT,
987 int i, j, nz = RP[m];
992 rp = *rpOUT = (
int *)
MALLOC_DH ((1 + m) *
sizeof (int));
994 cval = *cvalOUT = (
int *)
MALLOC_DH (nz *
sizeof (
int));
998 aval = *avalOUT = (
double *)
MALLOC_DH (nz *
sizeof (
double));
1006 if (avalOUT != NULL)
1011 tmp = (
int *)
MALLOC_DH ((1 + m) *
sizeof (int));
1013 for (i = 0; i <= m; ++i)
1016 for (i = 0; i < m; ++i)
1018 for (j = RP[i]; j < RP[i + 1]; ++j)
1024 for (i = 1; i <= m; ++i)
1025 tmp[i] += tmp[i - 1];
1026 memcpy (rp, tmp, (m + 1) *
sizeof (
int));
1028 if (avalOUT != NULL)
1030 for (i = 0; i < m; ++i)
1032 for (j = RP[i]; j < RP[i + 1]; ++j)
1037 aval[idx] = AVAL[j];
1045 for (i = 0; i < m; ++i)
1047 for (j = RP[i]; j < RP[i + 1]; ++j)
1064 #define __FUNC__ "mat_find_owner"
1070 for (pe = 0; pe <
np_dh; ++pe)
1072 if (index >= beg_rows[pe] && index < end_rows[pe])
1081 sprintf (
msgBuf_dh,
"failed to find owner for index= %i", index);
1094 #define __FUNC__ "readMat_par"
1104 readMat (&A, fileType, fileName, ignore);
1127 if (
np_dh > 1 && A != NULL)
1136 char xname[] =
"A", *name = xname;
1140 printf_dh (
"\n@@@ readMat_par: printed mat to %s\n\n", xname);
1148 #define __FUNC__ "partition_and_distribute_metis_private"
1155 int *rowLengths = NULL;
1156 int *o2n_row = NULL, *n2o_col = NULL, *rowToBlock = NULL;
1157 int *beg_row = NULL, *row_count = NULL;
1158 MPI_Request *send_req = NULL;
1159 MPI_Request *rcv_req = NULL;
1160 MPI_Status *send_status = NULL;
1161 MPI_Status *rcv_status = NULL;
1164 printf_dh (
"@@@ partitioning with metis\n");
1169 MPI_Bcast (&m, 1, MPI_INT, 0, MPI_COMM_WORLD);
1172 rowLengths = (
int *)
MALLOC_DH (m *
sizeof (
int));
1174 rowToBlock = (
int *)
MALLOC_DH (m *
sizeof (
int));
1180 for (i = 0; i < m; ++i)
1182 rowLengths[i] = tmp[i + 1] - tmp[i];
1185 MPI_Bcast (rowLengths, m, MPI_INT, 0,
comm_dh);
1200 for (i = 0; i <
np_dh; ++i)
1202 for (j = beg_row[i]; j < beg_row[i] + row_count[i]; ++j)
1204 rowToBlock[idx++] = i;
1210 MPI_Bcast (rowToBlock, m, MPI_INT, 0,
comm_dh);
1219 int *cval = C->
cval, *rp = C->
rp;
1220 double *aval = C->
aval;
1221 send_req = (MPI_Request *)
MALLOC_DH (2 * m *
sizeof (MPI_Request));
1223 send_status = (MPI_Status *)
MALLOC_DH (2 * m *
sizeof (MPI_Status));
1225 for (i = 0; i < m; ++i)
1227 int owner = rowToBlock[i];
1228 int count = rp[i + 1] - rp[i];
1233 sprintf (
msgBuf_dh,
"row %i of %i is empty!", i + 1, m);
1239 MPI_Isend (aval + rp[i], count, MPI_DOUBLE, owner,
AVAL_TAG,
1240 comm_dh, send_req + 2 * i + 1);
1246 int *cval = B->cval;
1248 double *aval = B->aval;
1251 rcv_req = (MPI_Request *)
MALLOC_DH (2 * m *
sizeof (MPI_Request));
1253 rcv_status = (MPI_Status *)
MALLOC_DH (2 * m *
sizeof (MPI_Status));
1256 for (i = 0; i < m; ++i)
1260 int count = rp[i + 1] - rp[i];
1263 sprintf (
msgBuf_dh,
"local row %i of %i is empty!", i + 1, m);
1270 rcv_req + 2 * i + 1);
1277 MPI_Waitall (m * 2, send_req, send_status);
1279 MPI_Waitall (2 * B->m, rcv_req, rcv_status);
1282 if (rowLengths != NULL)
1287 if (o2n_row != NULL)
1292 if (n2o_col != NULL)
1297 if (rowToBlock != NULL)
1302 if (send_req != NULL)
1307 if (rcv_req != NULL)
1312 if (send_status != NULL)
1317 if (rcv_status != NULL)
1322 if (beg_row != NULL)
1327 if (row_count != NULL)
1344 #define __FUNC__ "partition_and_distribute_private"
1350 int *rowLengths = NULL;
1351 int *o2n_row = NULL, *n2o_col = NULL, *rowToBlock = NULL;
1352 MPI_Request *send_req = NULL;
1353 MPI_Request *rcv_req = NULL;
1354 MPI_Status *send_status = NULL;
1355 MPI_Status *rcv_status = NULL;
1362 MPI_Bcast (&m, 1, MPI_INT, 0, MPI_COMM_WORLD);
1365 rowLengths = (
int *)
MALLOC_DH (m *
sizeof (
int));
1370 for (i = 0; i < m; ++i)
1372 rowLengths[i] = tmp[i + 1] - tmp[i];
1375 MPI_Bcast (rowLengths, m, MPI_INT, 0,
comm_dh);
1378 rowToBlock = (
int *)
MALLOC_DH (m *
sizeof (
int));
1383 o2n_row = (
int *)
MALLOC_DH (m *
sizeof (
int));
1390 MPI_Bcast (rowToBlock, m, MPI_INT, 0,
comm_dh);
1399 int *cval = A->
cval, *rp = A->
rp;
1400 double *aval = A->
aval;
1401 send_req = (MPI_Request *)
MALLOC_DH (2 * m *
sizeof (MPI_Request));
1403 send_status = (MPI_Status *)
MALLOC_DH (2 * m *
sizeof (MPI_Status));
1405 for (i = 0; i < m; ++i)
1407 int owner = rowToBlock[i];
1408 int count = rp[i + 1] - rp[i];
1413 sprintf (
msgBuf_dh,
"row %i of %i is empty!", i + 1, m);
1419 MPI_Isend (aval + rp[i], count, MPI_DOUBLE, owner,
AVAL_TAG,
1420 comm_dh, send_req + 2 * i + 1);
1426 int *cval = B->cval;
1428 double *aval = B->aval;
1431 rcv_req = (MPI_Request *)
MALLOC_DH (2 * m *
sizeof (MPI_Request));
1433 rcv_status = (MPI_Status *)
MALLOC_DH (2 * m *
sizeof (MPI_Status));
1436 for (i = 0; i < m; ++i)
1440 int count = rp[i + 1] - rp[i];
1443 sprintf (
msgBuf_dh,
"local row %i of %i is empty!", i + 1, m);
1450 rcv_req + 2 * i + 1);
1457 MPI_Waitall (m * 2, send_req, send_status);
1459 MPI_Waitall (2 * B->m, rcv_req, rcv_status);
1462 if (rowLengths != NULL)
1467 if (o2n_row != NULL)
1472 if (n2o_col != NULL)
1477 if (rowToBlock != NULL)
1482 if (send_req != NULL)
1487 if (rcv_req != NULL)
1492 if (send_status != NULL)
1497 if (rcv_status != NULL)
1508 #define __FUNC__ "mat_par_read_allocate_private"
1514 int i, m, nz, beg_row, *rp, idx;
1523 for (i = 0; i < n; ++i)
1532 for (i = 0; i < n; ++i)
1537 A->beg_row = beg_row;
1540 A->rp = rp = (
int *)
MALLOC_DH ((m + 1) *
sizeof (int));
1547 for (i = 0; i < n; ++i)
1551 nz += rowLengths[i];
1557 A->cval = (
int *)
MALLOC_DH (nz *
sizeof (
int));
1559 A->aval = (
double *)
MALLOC_DH (nz *
sizeof (
double));
1565 #define __FUNC__ "mat_partition_private"
1570 int rpb = n / blocks;
1573 while (rpb * blocks < n)
1576 if (rpb * (blocks - 1) == n)
1579 printf_dh (
"adjusted rpb to: %i\n", rpb);
1582 for (i = 0; i < n; ++i)
1588 for (i = 0; i < blocks - 1; ++i)
1590 for (j = 0; j < rpb; ++j)
1592 rowToBlock[idx++] = i;
1599 rowToBlock[idx++] = i;
1606 #define __FUNC__ "make_full_private"
1610 START_FUNC_DH int i, j, *rpNew, *cvalNew, *rp = *rpIN, *cval = *cvalIN;
1611 double *avalNew, *aval = *avalIN;
1612 int nz, *rowCounts = NULL;
1615 rowCounts = (
int *)
MALLOC_DH ((m + 1) *
sizeof (int));
1617 for (i = 0; i <= m; ++i)
1620 for (i = 0; i < m; ++i)
1622 for (j = rp[i]; j < rp[i + 1]; ++j)
1625 rowCounts[i + 1] += 1;
1627 rowCounts[col + 1] += 1;
1632 rpNew = (
int *)
MALLOC_DH ((m + 1) *
sizeof (int));
1634 for (i = 1; i <= m; ++i)
1635 rowCounts[i] += rowCounts[i - 1];
1636 memcpy (rpNew, rowCounts, (m + 1) *
sizeof (
int));
1641 cvalNew = (
int *)
MALLOC_DH (nz *
sizeof (
int));
1643 avalNew = (
double *)
MALLOC_DH (nz *
sizeof (
double));
1645 for (i = 0; i < m; ++i)
1647 for (j = rp[i]; j < rp[i + 1]; ++j)
1650 double val = aval[j];
1652 cvalNew[rowCounts[i]] = col;
1653 avalNew[rowCounts[i]] = val;
1657 cvalNew[rowCounts[col]] = i;
1658 avalNew[rowCounts[col]] = val;
1659 rowCounts[col] += 1;
1664 if (rowCounts != NULL)
1681 #define __FUNC__ "make_symmetric_private"
1685 START_FUNC_DH int i, j, *rpNew, *cvalNew, *rp = *rpIN, *cval = *cvalIN;
1686 double *avalNew, *aval = *avalIN;
1687 int nz, *rowCounts = NULL;
1688 int *rpTrans, *cvalTrans;
1691 int nzCount = 0, transCount = 0;
1694 cval, &cvalTrans, aval, &avalTrans);
1698 work = (
int *)
MALLOC_DH (m *
sizeof (
int));
1700 for (i = 0; i < m; ++i)
1702 rowCounts = (
int *)
MALLOC_DH ((m + 1) *
sizeof (int));
1704 for (i = 0; i <= m; ++i)
1707 for (i = 0; i < m; ++i)
1710 for (j = rp[i]; j < rp[i + 1]; ++j)
1717 for (j = rpTrans[i]; j < rpTrans[i + 1]; ++j)
1719 int col = cvalTrans[j];
1726 rowCounts[i + 1] = ct;
1732 if (transCount == 0)
1735 (
"make_symmetric_private: matrix is already structurally symmetric!\n");
1746 goto END_OF_FUNCTION;
1754 printf (
"original nz= %i\n", rp[m]);
1755 printf (
"zeros added= %i\n", transCount);
1757 (
"ratio of added zeros to nonzeros = %0.2f (assumes all original entries were nonzero!)\n",
1758 (
double) transCount / (
double) (nzCount));
1762 rpNew = (
int *)
MALLOC_DH ((m + 1) *
sizeof (int));
1764 for (i = 1; i <= m; ++i)
1765 rowCounts[i] += rowCounts[i - 1];
1766 memcpy (rpNew, rowCounts, (m + 1) *
sizeof (
int));
1767 for (i = 0; i < m; ++i)
1772 cvalNew = (
int *)
MALLOC_DH (nz *
sizeof (
int));
1774 avalNew = (
double *)
MALLOC_DH (nz *
sizeof (
double));
1776 for (i = 0; i < m; ++i)
1779 for (i = 0; i < m; ++i)
1781 for (j = rp[i]; j < rp[i + 1]; ++j)
1784 double val = aval[j];
1786 cvalNew[rowCounts[i]] = col;
1787 avalNew[rowCounts[i]] = val;
1790 for (j = rpTrans[i]; j < rpTrans[i + 1]; ++j)
1792 int col = cvalTrans[j];
1795 cvalNew[rowCounts[i]] = col;
1796 avalNew[rowCounts[i]] = 0.0;
1802 if (rowCounts != NULL)
1830 #define __FUNC__ "profileMat"
1840 bool isStructurallySymmetric =
true;
1841 bool isNumericallySymmetric =
true;
1842 bool is_Triangular =
false;
1843 int zeroCount = 0, nz;
1852 printf (
"\nYY----------------------------------------------------\n");
1856 for (i = 0; i < nz; ++i)
1858 if (A->
aval[i] == 0)
1861 printf (
"YY row count: %i\n", m);
1862 printf (
"YY nz count: %i\n", nz);
1863 printf (
"YY explicit zeros: %i (entire matrix)\n", zeroCount);
1867 int m_diag = 0, z_diag = 0;
1868 for (i = 0; i < m; ++i)
1871 for (j = A->
rp[i]; j < A->rp[i + 1]; ++j)
1873 int col = A->
cval[j];
1878 double val = A->
aval[j];
1890 printf (
"YY missing diagonals: %i\n", m_diag);
1891 printf (
"YY explicit zero diags: %i\n", z_diag);
1899 printf (
"YY matrix is upper triangular\n");
1900 is_Triangular =
true;
1901 goto END_OF_FUNCTION;
1905 printf (
"YY matrix is lower triangular\n");
1906 is_Triangular =
true;
1907 goto END_OF_FUNCTION;
1912 int unz = 0, lnz = 0;
1913 for (i = 0; i < m; ++i)
1915 for (j = A->
rp[i]; j < A->rp[i + 1]; ++j)
1917 int col = A->
cval[j];
1924 printf (
"YY strict upper triangular nonzeros: %i\n", unz);
1925 printf (
"YY strict lower triangular nonzeros: %i\n", lnz);
1936 work1 = (
int *)
MALLOC_DH (m *
sizeof (
int));
1938 work2 = (
double *)
MALLOC_DH (m *
sizeof (
double));
1940 for (i = 0; i < m; ++i)
1942 for (i = 0; i < m; ++i)
1945 for (i = 0; i < m; ++i)
1947 for (j = A->
rp[i]; j < A->rp[i + 1]; ++j)
1949 int col = A->
cval[j];
1950 double val = A->
aval[j];
1954 for (j = B->rp[i]; j < B->rp[i + 1]; ++j)
1956 int col = B->cval[j];
1957 double val = B->aval[j];
1959 if (work1[col] != i)
1961 isStructurallySymmetric =
false;
1962 isNumericallySymmetric =
false;
1963 goto END_OF_FUNCTION;
1965 if (work2[col] != val)
1967 isNumericallySymmetric =
false;
1978 printf (
"YY matrix is NOT triangular\n");
1979 if (isStructurallySymmetric)
1981 printf (
"YY matrix IS structurally symmetric\n");
1985 printf (
"YY matrix is NOT structurally symmetric\n");
1987 if (isNumericallySymmetric)
1989 printf (
"YY matrix IS numerically symmetric\n");
1993 printf (
"YY matrix is NOT numerically symmetric\n");
2013 printf (
"YY----------------------------------------------------\n");
void fix_diags_private(Mat_dh A)
void destroy_nat_ordering_private(int *p)
void Mat_dhReadBIN(Mat_dh *mat, char *filename)
void partition_and_distribute_private(Mat_dh A, Mat_dh *Bout)
void readVec(Vec_dh *bout, char *ft, char *fn, int ignore)
void mat_dh_read_csr_private(int *mOUT, int **rpOUT, int **cvalOUT, double **avalOUT, FILE *fp)
void Mat_dhPermute(Mat_dh A, int *n2o, Mat_dh *Bout)
void mat_dh_print_csr_private(int m, int *rp, int *cval, double *aval, FILE *fp)
void make_symmetric_private(int m, int **rpIN, int **cvalIN, double **avalIN)
void mat_partition_private(Mat_dh A, int blocks, int *o2n_row, int *rowToBlock)
void Mat_dhReadCSR(Mat_dh *mat, char *filename)
#define END_FUNC_VAL(retval)
void Mat_dhReadTriples(Mat_dh *mat, int ignore, char *filename)
#define SET_ERROR(retval, msg)
bool Parser_dhHasSwitch(Parser_dh p, char *s)
void make_full_private(int m, int **rpIN, int **cvalIN, double **avalIN)
void writeVec(Vec_dh bin, char *ft, char *fn)
void Hash_i_dhCreate(Hash_i_dh *h, int sizeIN)
void Vec_dhPrint(Vec_dh v, SubdomainGraph_dh sg, char *filename)
void Vec_dhReadBIN(Vec_dh *vout, char *filename)
void create_nat_ordering_private(int m, int **p)
void Vec_dhRead(Vec_dh *vout, int ignore, char *filename)
void printf_dh(char *fmt,...)
static void mat_dh_transpose_reuse_private_private(bool allocateMem, int m, int *rpIN, int *cvalIN, double *avalIN, int **rpOUT, int **cvalOUT, double **avalOUT)
void Mat_dhPrintBIN(Mat_dh A, SubdomainGraph_dh sg, char *filename)
int mat_find_owner(int *beg_rows, int *end_rows, int index)
static void convert_triples_to_scr_private(int m, int nz, int *I, int *J, double *A, int *rp, int *cval, double *aval)
void Mat_dhPrintCSR(Mat_dh A, SubdomainGraph_dh sg, char *filename)
void mat_dh_read_triples_private(int ignore, int *mOUT, int **rpOUT, int **cvalOUT, double **avalOUT, FILE *fp)
static int isTriangular(int m, int *rp, int *cval)
void invert_perm(int m, int *pIN, int *pOUT)
void readMat_par(Mat_dh *Aout, char *fileType, char *fileName, int ignore)
void Mat_dhCreate(Mat_dh *mat)
void Mat_dhPrintTriples(Mat_dh A, SubdomainGraph_dh sg, char *filename)
void mat_dh_transpose_private(int m, int *RP, int **rpOUT, int *CVAL, int **cvalOUT, double *AVAL, double **avalOUT)
bool Parser_dhReadString(Parser_dh p, char *in, char **out)
void mat_dh_transpose_reuse_private(int m, int *rpIN, int *cvalIN, double *avalIN, int *rpOUT, int *cvalOUT, double *avalOUT)
void Mat_dhPartition(Mat_dh mat, int blocks, int **beg_rowOUT, int **row_countOUT, int **n2oOUT, int **o2nOUT)
void partition_and_distribute_metis_private(Mat_dh A, Mat_dh *Bout)
void Mat_dhTranspose(Mat_dh A, Mat_dh *Bout)
void profileMat(Mat_dh A)
void mat_dh_print_graph_private(int m, int beg_row, int *rp, int *cval, double *aval, int *n2o, int *o2n, Hash_i_dh hash, FILE *fp)
static void mat_par_read_allocate_private(Mat_dh *Aout, int n, int *rowLengths, int *rowToBlock)
void Hash_i_dhDestroy(Hash_i_dh h)
int Hash_i_dhLookup(Hash_i_dh h, int key)
void writeMat(Mat_dh Ain, char *ft, char *fn)
void Mat_dhMakeStructurallySymmetric(Mat_dh A)
char msgBuf_dh[MSG_BUF_SIZE_DH]
void Mat_dhDestroy(Mat_dh mat)
void Vec_dhPrintBIN(Vec_dh v, SubdomainGraph_dh sg, char *filename)
void readMat(Mat_dh *Aout, char *ft, char *fn, int ignore)
void insert_missing_diags_private(Mat_dh A)