41 #include "Epetra_ConfigDefs.h" 43 #include "Epetra_Comm.h" 44 #include "Epetra_CrsMatrix.h" 45 #include "Epetra_Map.h" 46 #include "Epetra_IntVector.h" 47 #include "Epetra_IntSerialDenseVector.h" 48 #include "Epetra_Import.h" 49 #include "Epetra_Time.h" 50 #include "Epetra_Util.h" 78 template<
typename int_type>
79 static void sort_three(int_type* list, int_type *parlista,
double *parlistb,
83 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 85 const Epetra_Comm & comm, Epetra_CrsMatrix * & A)
93 const Epetra_Comm & comm, Epetra_CrsMatrix * & A,
const bool transpose)
96 0, 0, 0, 0, transpose));
102 const Epetra_Comm & comm, Epetra_CrsMatrix * & A,
const bool transpose,
107 transpose, verbose));
113 const Epetra_Map & rowMap,
const Epetra_Map& rangeMap,
114 const Epetra_Map& domainMap, Epetra_CrsMatrix * & A,
const bool transpose,
120 &rangeMap, &domainMap,
121 transpose, verbose));
127 const Epetra_Map & rowMap, Epetra_CrsMatrix * & A,
const bool transpose,
133 transpose, verbose));
139 const Epetra_Map & rowMap,
const Epetra_Map & colMap,
140 Epetra_CrsMatrix * & A,
const bool transpose,
145 &rowMap, &colMap, 0, 0,
146 transpose, verbose));
152 const Epetra_Map & rowMap,
const Epetra_Map & colMap,
153 const Epetra_Map& rangeMap,
const Epetra_Map& domainMap,
154 Epetra_CrsMatrix * & A,
const bool transpose,
160 &rangeMap, &domainMap,
161 transpose, verbose));
166 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 168 const Epetra_Comm & comm, Epetra_CrsMatrix * & A)
176 const Epetra_Comm & comm, Epetra_CrsMatrix * & A,
const bool transpose)
179 0, 0, 0, 0, transpose));
185 const Epetra_Comm & comm, Epetra_CrsMatrix * & A,
const bool transpose,
190 transpose, verbose));
196 const Epetra_Map & rowMap,
const Epetra_Map& rangeMap,
197 const Epetra_Map& domainMap, Epetra_CrsMatrix * & A,
const bool transpose,
203 &rangeMap, &domainMap,
204 transpose, verbose));
210 const Epetra_Map & rowMap, Epetra_CrsMatrix * & A,
const bool transpose,
216 transpose, verbose));
222 const Epetra_Map & rowMap,
const Epetra_Map & colMap,
223 Epetra_CrsMatrix * & A,
const bool transpose,
228 &rowMap, &colMap, 0, 0,
229 transpose, verbose));
235 const Epetra_Map & rowMap,
const Epetra_Map & colMap,
236 const Epetra_Map& rangeMap,
const Epetra_Map& domainMap,
237 Epetra_CrsMatrix * & A,
const bool transpose,
243 &rangeMap, &domainMap,
244 transpose, verbose));
250 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 252 const Epetra_Comm & comm,
253 Epetra_CrsMatrix * & A,
254 const Epetra_Map * rowMap,
255 const Epetra_Map * colMap,
256 const Epetra_Map * rangeMap,
257 const Epetra_Map * domainMap,
258 const bool transpose,
262 const int chunk_read = 500000;
264 const int headerlineLength = 257;
265 const int lineLength = 81;
266 const int tokenLength = 35;
267 char line[headerlineLength];
268 char token1[tokenLength];
269 char token2[tokenLength];
270 char token3[tokenLength];
271 char token4[tokenLength];
272 char token5[tokenLength];
274 int me = comm.MyPID();
276 Epetra_Time timer(comm);
279 if ((domainMap!=0 && rangeMap==0) || (domainMap==0 && rangeMap!=0)) {
286 if (!domainMap->UniqueGIDs()) {EPETRA_CHK_ERR(-2);}
287 if (!rangeMap->UniqueGIDs()) {EPETRA_CHK_ERR(-2);}
293 if (!rowMap->UniqueGIDs()) {EPETRA_CHK_ERR(-2);}
299 if (verbose) std::cout <<
"Reading MatrixMarket file " << filename << std::endl;
300 handle = fopen(filename,
"r");
306 if(fgets(line, headerlineLength, handle)==0) {
307 if (handle!=0) fclose(handle);
310 if(sscanf(line,
"%s %s %s %s %s", token1,token2,token3,token4,token5)==0) {
311 if (handle!=0) fclose(handle);
314 if (strcmp(token1,
"%%MatrixMarket") ||
315 strcmp(token2,
"matrix") ||
316 strcmp(token3,
"coordinate") ||
317 strcmp(token4,
"real") ||
318 strcmp(token5,
"general")) {
319 if (handle!=0) fclose(handle);
325 if(fgets(line, headerlineLength, handle)==0) {
326 if (handle!=0) fclose(handle);
329 }
while (line[0] ==
'%');
332 if(sscanf(line,
"%d %d %d", &M, &N, &NZ)==0) {
333 if (handle!=0) fclose(handle);
337 comm.Broadcast(&M, 1, 0);
338 comm.Broadcast(&N, 1, 0);
339 comm.Broadcast(&NZ, 1, 0);
345 char *buffer =
new char[chunk_read*lineLength];
352 const int localblock = 100000;
353 int localsize = NZ / comm.NumProc() + localblock;
354 int *iv = (
int *) malloc(localsize *
sizeof(
int));
355 int *jv = (
int *) malloc(localsize *
sizeof(
int));
356 double *vv = (
double *) malloc(localsize *
sizeof(
double));
359 if (!iv || !jv || !vv)
363 bool allocatedHere=
false;
365 rowMap1 =
const_cast<Epetra_Map *
>(rowMap);
367 rowMap1 =
new Epetra_Map(M, 0, comm);
368 allocatedHere =
true;
370 int ioffset = rowMap1->IndexBase()-1;
371 int joffset = (colMap != 0 ? colMap->IndexBase()-1 : ioffset);
378 if (NZ-nread > chunk_read) nchunk = chunk_read;
379 else nchunk = NZ - nread;
384 for (
int i = 0; i < nchunk; i++) {
385 eof = fgets(&buffer[rlen],lineLength,handle);
387 fprintf(stderr,
"%s",
"Unexpected end of matrix file.");
390 rlen += strlen(&buffer[rlen]);
394 comm.Broadcast(&rlen, 1, 0);
395 comm.Broadcast(buffer, rlen, 0);
397 buffer[rlen++] =
'\0';
401 char *lineptr = buffer;
402 for (rlen = 0; rlen < nchunk; rlen++) {
403 char *next = strchr(lineptr,
'\n');
404 int I = atoi(strtok(lineptr,
" \t\n")) + ioffset;
405 int J = atoi(strtok(NULL,
" \t\n")) + joffset;
406 double V = atof(strtok(NULL,
" \t\n"));
414 if (rowMap1->MyGID(I)) {
416 if (lnz >= localsize) {
418 localsize += localblock;
419 iv = (
int *) realloc(iv, localsize *
sizeof(
int));
420 jv = (
int *) realloc(jv, localsize *
sizeof(
int));
421 vv = (
double *) realloc(vv, localsize *
sizeof(
double));
427 if (I < prevrow) rowmajor = 0;
433 if (nread / 1000000 > nmillion) {
435 if (verbose && me == 0) std::cout << nmillion <<
"M ";
444 if (verbose && me == 0) std::cout << std::endl <<
" Sorting local nonzeros" << std::endl;
453 if (verbose && me == 0) std::cout << std::endl <<
" Constructing the matrix" << std::endl;
454 int numRows = rowMap1->NumMyElements();
455 int *numNonzerosPerRow =
new int[numRows];
456 for (
int i = 0; i < numRows; i++) numNonzerosPerRow[i] = 0;
457 for (
int i = 0; i < lnz; i++)
458 numNonzerosPerRow[rowMap1->LID(iv[i])]++;
460 if (rowMap!=0 && colMap !=0)
461 A =
new Epetra_CrsMatrix(Copy, *rowMap, *colMap, numNonzerosPerRow);
462 else if (rowMap!=0) {
465 A =
new Epetra_CrsMatrix(Copy, *rowMap, numNonzerosPerRow,
true);
470 A =
new Epetra_CrsMatrix(Copy, *rowMap1, numNonzerosPerRow,
true);
472 A->SetTracebackMode(1);
476 int *gidList =
new int[numRows];
477 for (
int i = 0; i < numRows; i++) gidList[i] = rowMap1->GID(i);
478 Epetra_Util::Sort(
true,numRows,gidList,0,0,1,&numNonzerosPerRow);
482 if (verbose && me == 0) std::cout <<
" Inserting global values" << std::endl;
485 for (
int sum = 0; i < numRows; i++) {
486 if (numNonzerosPerRow[i]) {
487 int ierr = A->InsertGlobalValues(iv[sum], numNonzerosPerRow[i],
489 if (ierr<0) EPETRA_CHK_ERR(ierr);
490 sum += numNonzerosPerRow[i];
495 delete [] numNonzerosPerRow;
500 if (verbose && me == 0) std::cout <<
" Completing matrix fill" << std::endl;
501 if (rangeMap != 0 && domainMap != 0) {
502 EPETRA_CHK_ERR(A->FillComplete(*domainMap, *rangeMap));
505 Epetra_Map newDomainMap(N,rowMap1->IndexBase(), comm);
506 EPETRA_CHK_ERR(A->FillComplete(newDomainMap, *rowMap1));
509 EPETRA_CHK_ERR(A->FillComplete());
512 if (allocatedHere)
delete rowMap1;
514 if (handle!=0) fclose(handle);
515 double dt = timer.ElapsedTime();
516 if (verbose && me == 0) std::cout <<
"File Read time (secs): " << dt << std::endl;
521 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 523 const Epetra_Comm & comm,
524 Epetra_CrsMatrix * & A,
525 const Epetra_Map * rowMap,
526 const Epetra_Map * colMap,
527 const Epetra_Map * rangeMap,
528 const Epetra_Map * domainMap,
529 const bool transpose,
533 const int chunk_read = 500000;
535 const int headerlineLength = 257;
536 const int lineLength = 81;
537 const int tokenLength = 35;
538 char line[headerlineLength];
539 char token1[tokenLength];
540 char token2[tokenLength];
541 char token3[tokenLength];
542 char token4[tokenLength];
543 char token5[tokenLength];
545 int me = comm.MyPID();
547 Epetra_Time timer(comm);
550 if ((domainMap!=0 && rangeMap==0) || (domainMap==0 && rangeMap!=0)) {
557 if (!domainMap->UniqueGIDs()) {EPETRA_CHK_ERR(-2);}
558 if (!rangeMap->UniqueGIDs()) {EPETRA_CHK_ERR(-2);}
564 if (!rowMap->UniqueGIDs()) {EPETRA_CHK_ERR(-2);}
570 if (verbose) std::cout <<
"Reading MatrixMarket file " << filename << std::endl;
571 handle = fopen(filename,
"r");
577 if(fgets(line, headerlineLength, handle)==0) {
578 if (handle!=0) fclose(handle);
581 if(sscanf(line,
"%s %s %s %s %s", token1,token2,token3,token4,token5)==0) {
582 if (handle!=0) fclose(handle);
585 if (strcmp(token1,
"%%MatrixMarket") ||
586 strcmp(token2,
"matrix") ||
587 strcmp(token3,
"coordinate") ||
588 strcmp(token4,
"real") ||
589 strcmp(token5,
"general")) {
590 if (handle!=0) fclose(handle);
596 if(fgets(line, headerlineLength, handle)==0) {
597 if (handle!=0) fclose(handle);
600 }
while (line[0] ==
'%');
603 if(sscanf(line,
"%lld %lld %lld", &M, &N, &NZ)==0) {
604 if (handle!=0) fclose(handle);
608 comm.Broadcast(&M, 1, 0);
609 comm.Broadcast(&N, 1, 0);
610 comm.Broadcast(&NZ, 1, 0);
616 char *buffer =
new char[chunk_read*lineLength];
623 const int localblock = 100000;
624 int localsize = (int) (NZ / comm.NumProc()) + localblock;
625 long long *iv = (
long long *) malloc(localsize *
sizeof(
long long));
626 long long *jv = (
long long *) malloc(localsize *
sizeof(
long long));
627 double *vv = (
double *) malloc(localsize *
sizeof(
double));
630 if (!iv || !jv || !vv)
634 bool allocatedHere=
false;
636 rowMap1 =
const_cast<Epetra_Map *
>(rowMap);
638 rowMap1 =
new Epetra_Map(M, 0, comm);
639 allocatedHere =
true;
641 long long ioffset = rowMap1->IndexBase64()-1;
642 long long joffset = (colMap != 0 ? colMap->IndexBase64()-1 : ioffset);
645 long long prevrow = -1;
649 if (NZ-nread > chunk_read) nchunk = chunk_read;
650 else nchunk = NZ - nread;
655 for (
int i = 0; i < nchunk; i++) {
656 eof = fgets(&buffer[rlen],lineLength,handle);
658 fprintf(stderr,
"%s",
"Unexpected end of matrix file.");
661 rlen += strlen(&buffer[rlen]);
665 comm.Broadcast(&rlen, 1, 0);
666 comm.Broadcast(buffer, rlen, 0);
668 buffer[rlen++] =
'\0';
672 char *lineptr = buffer;
673 for (rlen = 0; rlen < nchunk; rlen++) {
674 char *next = strchr(lineptr,
'\n');
677 #if defined(_MSC_VER) 678 long long I = _strtoi64(strtok(lineptr,
" \t\n"), &endp, base) + ioffset;
679 long long J = _strtoi64(strtok(NULL,
" \t\n"), &endp, base) + joffset;
683 std::istringstream ssI(strtok(lineptr,
" \t\n"));
684 ssI >> I; I += ioffset;
685 std::istringstream ssJ(strtok(NULL,
" \t\n"));
686 ssJ >> J; J += joffset;
688 long long I = strtoll(strtok(lineptr,
" \t\n"), &endp, base) + ioffset;
689 long long J = strtoll(strtok(NULL,
" \t\n"), &endp, base) + joffset;
692 double V = atof(strtok(NULL,
" \t\n"));
700 if (rowMap1->MyGID(I)) {
702 if (lnz >= localsize) {
704 localsize += localblock;
705 iv = (
long long *) realloc(iv, localsize *
sizeof(
long long));
706 jv = (
long long *) realloc(jv, localsize *
sizeof(
long long));
707 vv = (
double *) realloc(vv, localsize *
sizeof(
double));
713 if (I < prevrow) rowmajor = 0;
719 if (nread / 1000000 > nmillion) {
721 if (verbose && me == 0) std::cout << nmillion <<
"M ";
730 if (verbose && me == 0) std::cout << std::endl <<
" Sorting local nonzeros" << std::endl;
739 if (verbose && me == 0) std::cout << std::endl <<
" Constructing the matrix" << std::endl;
740 int numRows = rowMap1->NumMyElements();
741 int *numNonzerosPerRow =
new int[numRows];
742 for (
int i = 0; i < numRows; i++) numNonzerosPerRow[i] = 0;
743 for (
int i = 0; i < lnz; i++)
744 numNonzerosPerRow[rowMap1->LID(iv[i])]++;
746 if (rowMap!=0 && colMap !=0)
747 A =
new Epetra_CrsMatrix(Copy, *rowMap, *colMap, numNonzerosPerRow);
748 else if (rowMap!=0) {
751 A =
new Epetra_CrsMatrix(Copy, *rowMap, numNonzerosPerRow,
true);
756 A =
new Epetra_CrsMatrix(Copy, *rowMap1, numNonzerosPerRow,
true);
758 A->SetTracebackMode(1);
762 long long *gidList =
new long long[numRows];
763 for (
int i = 0; i < numRows; i++) gidList[i] = rowMap1->GID64(i);
764 Epetra_Util::Sort(
true,numRows,gidList,0,0,1,&numNonzerosPerRow,0,0);
768 if (verbose && me == 0) std::cout <<
" Inserting global values" << std::endl;
771 for (
int sum = 0; i < numRows; i++) {
772 if (numNonzerosPerRow[i]) {
773 int ierr = A->InsertGlobalValues(iv[sum], numNonzerosPerRow[i],
775 if (ierr<0) EPETRA_CHK_ERR(ierr);
776 sum += numNonzerosPerRow[i];
781 delete [] numNonzerosPerRow;
786 if (verbose && me == 0) std::cout <<
" Completing matrix fill" << std::endl;
787 if (rangeMap != 0 && domainMap != 0) {
788 EPETRA_CHK_ERR(A->FillComplete(*domainMap, *rangeMap));
791 Epetra_Map newDomainMap(N,rowMap1->IndexBase64(), comm);
792 EPETRA_CHK_ERR(A->FillComplete(newDomainMap, *rowMap1));
795 EPETRA_CHK_ERR(A->FillComplete());
798 if (allocatedHere)
delete rowMap1;
800 if (handle!=0) fclose(handle);
801 double dt = timer.ElapsedTime();
802 if (verbose && me == 0) std::cout <<
"File Read time (secs): " << dt << std::endl;
812 template<
typename int_type>
814 int_type *list, int_type *parlista,
double *parlistb,
815 int start,
int end,
int *equal,
int *larger)
821 key = list ? list[(end+start)/2] : 1;
823 *equal = *larger = start;
824 for (i = start; i <= end; i++)
827 parlista[i] = parlista[*larger];
828 parlista[(*larger)] = parlista[*equal];
829 parlista[(*equal)] = itmp;
831 parlistb[i] = parlistb[*larger];
832 parlistb[(*larger)] = parlistb[*equal];
833 parlistb[(*equal)] = dtmp;
835 list[i] = list[*larger];
836 list[(*larger)++] = list[*equal];
837 list[(*equal)++] = itmp;
839 else if (list[i] == key) {
841 parlista[i] = parlista[*larger];
842 parlista[(*larger)] = itmp;
844 parlistb[i] = parlistb[*larger];
845 parlistb[(*larger)] = dtmp;
846 list[i] = list[*larger];
847 list[(*larger)++] = key;
852 template<
typename int_type>
853 static void sort_three(int_type* list, int_type *parlista,
double *parlistb,
861 sort_three(list, parlista, parlistb, start, equal-1);
862 sort_three(list, parlista, parlistb, larger, end);
867 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 869 const Epetra_Comm & comm,
870 Epetra_CrsMatrix * & A)
872 const int lineLength = 1025;
873 char line[lineLength];
879 handle = fopen(filename,
"r");
883 int numGlobalRows = 0;
884 int numGlobalCols = 0;
885 while(fgets(line, lineLength, handle)!=0) {
886 if(sscanf(line,
"%d %d %lg\n", &I, &J, &V)==0) {
if (handle!=0) fclose(handle); EPETRA_CHK_ERR(-1);}
887 if (I>numGlobalRows) numGlobalRows = I;
888 if (J>numGlobalCols) numGlobalCols = J;
891 if (handle!=0) fclose(handle);
892 Epetra_Map rangeMap(numGlobalRows, 0, comm);
893 Epetra_Map domainMap(numGlobalCols, 0, comm);
894 A =
new Epetra_CrsMatrix(Copy, rangeMap, 0);
897 const Epetra_Map & rowMap1 = A->RowMap();
901 handle = fopen(filename,
"r");
905 while (fgets(line, lineLength, handle)!=0) {
906 if(sscanf(line,
"%d %d %lg\n", &I, &J, &V)==0) {
if (handle!=0) fclose(handle); EPETRA_CHK_ERR(-1);}
908 if (rowMap1.MyGID(I)) {
909 int ierr = A->InsertGlobalValues(I, 1, &V, &J);
910 if (ierr<0) EPETRA_CHK_ERR(ierr);
914 EPETRA_CHK_ERR(A->FillComplete(domainMap, rangeMap));
916 if (handle!=0) fclose(handle);
921 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 923 const Epetra_Comm & comm,
924 Epetra_CrsMatrix * & A)
926 const int lineLength = 1025;
927 char line[lineLength];
933 handle = fopen(filename,
"r");
937 long long numGlobalRows = 0;
938 long long numGlobalCols = 0;
939 while(fgets(line, lineLength, handle)!=0) {
940 if(sscanf(line,
"%lld %lld %lg\n", &I, &J, &V)==0) {
if (handle!=0) fclose(handle); EPETRA_CHK_ERR(-1);}
941 if (I>numGlobalRows) numGlobalRows = I;
942 if (J>numGlobalCols) numGlobalCols = J;
945 if (handle!=0) fclose(handle);
946 Epetra_Map rangeMap(numGlobalRows, 0, comm);
947 Epetra_Map domainMap(numGlobalCols, 0, comm);
948 A =
new Epetra_CrsMatrix(Copy, rangeMap, 0);
951 const Epetra_Map & rowMap1 = A->RowMap();
955 handle = fopen(filename,
"r");
959 while (fgets(line, lineLength, handle)!=0) {
960 if(sscanf(line,
"%lld %lld %lg\n", &I, &J, &V)==0) {
if (handle!=0) fclose(handle); EPETRA_CHK_ERR(-1);}
962 if (rowMap1.MyGID(I)) {
963 int ierr = A->InsertGlobalValues(I, 1, &V, &J);
964 if (ierr<0) EPETRA_CHK_ERR(ierr);
968 EPETRA_CHK_ERR(A->FillComplete(domainMap, rangeMap));
970 if (handle!=0) fclose(handle);
975 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 977 int MyPID = comm.MyPID();
979 double filePID = (double)MyPID/(
double)100000;
980 std::ostringstream stream;
982 stream << std::setiosflags(std::ios::fixed) << std::setprecision(5) << filePID;
984 std::string fileName(filename);
985 fileName += stream.str().substr(1,7);
987 std::ifstream file(fileName.c_str());
990 std::getline(file, line);
992 std::istringstream istream(line);
997 Epetra_Map RowMap(-1, iupper-ilower+1, 0, comm);
998 Matrix =
new Epetra_CrsMatrix(Copy, RowMap, 0);
1001 std::vector<int> indices;
1002 std::vector<double> values;
1004 std::getline(file, line);
1005 std::istringstream lineStr(line);
1011 if(currRow == -1) currRow = row;
1014 counter = counter + 1;
1015 indices.push_back(col);
1016 values.push_back(val);
1018 Matrix->InsertGlobalValues(currRow, counter, &values[0], &indices[0]);
1024 indices.push_back(col);
1025 values.push_back(val);
1026 counter = counter + 1;
1029 Matrix->InsertGlobalValues(currRow, counter, &values[0], &indices[0]);
1030 Matrix->Comm().Barrier();
1031 Matrix->FillComplete();
1035 std::cout <<
"\nERROR:\nCouldn't open " << fileName <<
".\n";
1041 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 1043 int MyPID = comm.MyPID();
1045 double filePID = (double)MyPID/(
double)100000;
1046 std::ostringstream stream;
1048 stream << std::setiosflags(std::ios::fixed) << std::setprecision(5) << filePID;
1050 std::string fileName(filename);
1051 fileName += stream.str().substr(1,7);
1053 std::ifstream file(fileName.c_str());
1056 std::getline(file, line);
1058 std::istringstream istream(line);
1063 Epetra_Map RowMap(-1LL, iupper-ilower+1, 0LL, comm);
1064 Matrix =
new Epetra_CrsMatrix(Copy, RowMap, 0);
1065 long long currRow = -1;
1067 std::vector<long long> indices;
1068 std::vector<double> values;
1070 std::getline(file, line);
1071 std::istringstream lineStr(line);
1077 if(currRow == -1) currRow = row;
1080 counter = counter + 1;
1081 indices.push_back(col);
1082 values.push_back(val);
1084 Matrix->InsertGlobalValues(currRow, counter, &values[0], &indices[0]);
1090 indices.push_back(col);
1091 values.push_back(val);
1092 counter = counter + 1;
1095 Matrix->InsertGlobalValues(currRow, counter, &values[0], &indices[0]);
1096 Matrix->Comm().Barrier();
1097 Matrix->FillComplete();
1101 std::cout <<
"\nERROR:\nCouldn't open " << fileName <<
".\n";
int MatrixMarketFileToCrsMatrix64(const char *filename, const Epetra_Comm &comm, Epetra_CrsMatrix *&A)
int HypreFileToCrsMatrix64(const char *filename, const Epetra_Comm &comm, Epetra_CrsMatrix *&Matrix)
EpetraExt::BlockCrsMatrix: A class for constructing a distributed block matrix.
static void quickpart_list_inc_int(int_type *list, int_type *parlista, double *parlistb, int start, int end, int *equal, int *larger)
int MatrixMarketFileToCrsMatrix(const char *filename, const Epetra_Comm &comm, Epetra_CrsMatrix *&A)
int MatlabFileToCrsMatrix64(const char *filename, const Epetra_Comm &comm, Epetra_CrsMatrix *&A)
int MatrixMarketFileToCrsMatrixHandle(const char *filename, const Epetra_Comm &comm, Epetra_CrsMatrix *&A, const Epetra_Map *rowMap, const Epetra_Map *colMap, const Epetra_Map *rangeMap, const Epetra_Map *domainMap, const bool transpose, const bool verbose)
int MatlabFileToCrsMatrix(const char *filename, const Epetra_Comm &comm, Epetra_CrsMatrix *&A)
Constructs an Epetra_CrsMatrix object from a Matlab format file, distributes rows evenly across proce...
int HypreFileToCrsMatrix(const char *filename, const Epetra_Comm &comm, Epetra_CrsMatrix *&Matrix)
Constructs an Epetra_CrsMatrix object from a Hypre Matrix Print command, the row map is specified...
int MatrixMarketFileToCrsMatrixHandle64(const char *filename, const Epetra_Comm &comm, Epetra_CrsMatrix *&A, const Epetra_Map *rowMap, const Epetra_Map *colMap, const Epetra_Map *rangeMap, const Epetra_Map *domainMap, const bool transpose, const bool verbose)
static void sort_three(int_type *list, int_type *parlista, double *parlistb, int start, int end)