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" 80 template<
typename int_type>
81 static void sort_three(int_type* list, int_type *parlista,
double *parlistb,
85 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 87 const Epetra_Comm & comm, Epetra_CrsMatrix * & A)
95 const Epetra_Comm & comm, Epetra_CrsMatrix * & A,
const bool transpose)
98 0, 0, 0, 0, transpose));
104 const Epetra_Comm & comm, Epetra_CrsMatrix * & A,
const bool transpose,
109 transpose, verbose));
115 const Epetra_Map & rowMap,
const Epetra_Map& rangeMap,
116 const Epetra_Map& domainMap, Epetra_CrsMatrix * & A,
const bool transpose,
122 &rangeMap, &domainMap,
123 transpose, verbose));
129 const Epetra_Map & rowMap, Epetra_CrsMatrix * & A,
const bool transpose,
135 transpose, verbose));
141 const Epetra_Map & rowMap,
const Epetra_Map & colMap,
142 Epetra_CrsMatrix * & A,
const bool transpose,
147 &rowMap, &colMap, 0, 0,
148 transpose, verbose));
154 const Epetra_Map & rowMap,
const Epetra_Map & colMap,
155 const Epetra_Map& rangeMap,
const Epetra_Map& domainMap,
156 Epetra_CrsMatrix * & A,
const bool transpose,
162 &rangeMap, &domainMap,
163 transpose, verbose));
168 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 170 const Epetra_Comm & comm, Epetra_CrsMatrix * & A)
178 const Epetra_Comm & comm, Epetra_CrsMatrix * & A,
const bool transpose)
181 0, 0, 0, 0, transpose));
187 const Epetra_Comm & comm, Epetra_CrsMatrix * & A,
const bool transpose,
192 transpose, verbose));
198 const Epetra_Map & rowMap,
const Epetra_Map& rangeMap,
199 const Epetra_Map& domainMap, Epetra_CrsMatrix * & A,
const bool transpose,
205 &rangeMap, &domainMap,
206 transpose, verbose));
212 const Epetra_Map & rowMap, Epetra_CrsMatrix * & A,
const bool transpose,
218 transpose, verbose));
224 const Epetra_Map & rowMap,
const Epetra_Map & colMap,
225 Epetra_CrsMatrix * & A,
const bool transpose,
230 &rowMap, &colMap, 0, 0,
231 transpose, verbose));
237 const Epetra_Map & rowMap,
const Epetra_Map & colMap,
238 const Epetra_Map& rangeMap,
const Epetra_Map& domainMap,
239 Epetra_CrsMatrix * & A,
const bool transpose,
245 &rangeMap, &domainMap,
246 transpose, verbose));
252 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 254 const Epetra_Comm & comm,
255 Epetra_CrsMatrix * & A,
256 const Epetra_Map * rowMap,
257 const Epetra_Map * colMap,
258 const Epetra_Map * rangeMap,
259 const Epetra_Map * domainMap,
260 const bool transpose,
264 const int chunk_read = 500000;
266 const int headerlineLength = 257;
267 const int lineLength = 81;
268 const int tokenLength = 35;
269 char line[headerlineLength];
270 char token1[tokenLength];
271 char token2[tokenLength];
272 char token3[tokenLength];
273 char token4[tokenLength];
274 char token5[tokenLength];
276 int me = comm.MyPID();
278 Epetra_Time timer(comm);
281 if ((domainMap!=0 && rangeMap==0) || (domainMap==0 && rangeMap!=0)) {
288 if (!domainMap->UniqueGIDs()) {EPETRA_CHK_ERR(-2);}
289 if (!rangeMap->UniqueGIDs()) {EPETRA_CHK_ERR(-2);}
295 if (!rowMap->UniqueGIDs()) {EPETRA_CHK_ERR(-2);}
302 if (verbose) std::cout <<
"Reading MatrixMarket file " << filename << std::endl;
303 handle = fopen(filename,
"r");
310 if( (rv != -1) && fgets(line, headerlineLength, handle)==0 ) {
311 if (handle!=0) fclose(handle);
314 if( (rv != -1) && sscanf(line,
"%s %s %s %s %s", token1,token2,token3,token4,token5)==0) {
315 if (handle!=0) fclose(handle);
318 if ( (rv != -1) && (strcmp(token1,
"%%MatrixMarket") ||
319 strcmp(token2,
"matrix") ||
320 strcmp(token3,
"coordinate") ||
321 strcmp(token4,
"real") ||
322 strcmp(token5,
"general")) ) {
323 if (handle!=0) fclose(handle);
330 if(fgets(line, headerlineLength, handle)==0) {
331 if (handle!=0) fclose(handle);
335 }
while (line[0] ==
'%');
339 if((rv != -1) && sscanf(line,
"%d %d %d", &M, &N, &NZ)==0) {
340 if (handle!=0) fclose(handle);
345 comm.Broadcast(&rv, 1, 0);
348 comm.Broadcast(&M, 1, 0);
349 comm.Broadcast(&N, 1, 0);
350 comm.Broadcast(&NZ, 1, 0);
356 char *buffer =
new char[chunk_read*lineLength];
363 const int localblock = 100000;
364 int localsize = NZ / comm.NumProc() + localblock;
365 int *iv = (
int *) malloc(localsize *
sizeof(
int));
366 int *jv = (
int *) malloc(localsize *
sizeof(
int));
367 double *vv = (
double *) malloc(localsize *
sizeof(
double));
370 if (!iv || !jv || !vv)
374 bool allocatedHere=
false;
376 rowMap1 =
const_cast<Epetra_Map *
>(rowMap);
378 rowMap1 =
new Epetra_Map(M, 0, comm);
379 allocatedHere =
true;
381 int ioffset = rowMap1->IndexBase()-1;
382 int joffset = (colMap != 0 ? colMap->IndexBase()-1 : ioffset);
389 if (NZ-nread > chunk_read) nchunk = chunk_read;
390 else nchunk = NZ - nread;
395 for (
int i = 0; i < nchunk; i++) {
396 eof = fgets(&buffer[rlen],lineLength,handle);
398 fprintf(stderr,
"%s",
"Unexpected end of matrix file.");
401 rlen += strlen(&buffer[rlen]);
405 comm.Broadcast(&rlen, 1, 0);
406 comm.Broadcast(buffer, rlen, 0);
408 buffer[rlen++] =
'\0';
412 char *lineptr = buffer;
413 for (rlen = 0; rlen < nchunk; rlen++) {
414 char *next = strchr(lineptr,
'\n');
415 int I = atoi(strtok(lineptr,
" \t\n")) + ioffset;
416 int J = atoi(strtok(NULL,
" \t\n")) + joffset;
417 double V = atof(strtok(NULL,
" \t\n"));
425 if (rowMap1->MyGID(I)) {
427 if (lnz >= localsize) {
429 localsize += localblock;
430 iv = (
int *) realloc(iv, localsize *
sizeof(
int));
431 jv = (
int *) realloc(jv, localsize *
sizeof(
int));
432 vv = (
double *) realloc(vv, localsize *
sizeof(
double));
438 if (I < prevrow) rowmajor = 0;
444 if (nread / 1000000 > nmillion) {
446 if (verbose && me == 0) std::cout << nmillion <<
"M ";
455 if (verbose && me == 0) std::cout << std::endl <<
" Sorting local nonzeros" << std::endl;
464 if (verbose && me == 0) std::cout << std::endl <<
" Constructing the matrix" << std::endl;
465 int numRows = rowMap1->NumMyElements();
466 int *numNonzerosPerRow =
new int[numRows];
467 for (
int i = 0; i < numRows; i++) numNonzerosPerRow[i] = 0;
468 for (
int i = 0; i < lnz; i++)
469 numNonzerosPerRow[rowMap1->LID(iv[i])]++;
471 if (rowMap!=0 && colMap !=0)
472 A =
new Epetra_CrsMatrix(Copy, *rowMap, *colMap, numNonzerosPerRow);
473 else if (rowMap!=0) {
476 A =
new Epetra_CrsMatrix(Copy, *rowMap, numNonzerosPerRow,
true);
481 A =
new Epetra_CrsMatrix(Copy, *rowMap1, numNonzerosPerRow,
true);
483 A->SetTracebackMode(1);
487 int *gidList =
new int[numRows];
488 for (
int i = 0; i < numRows; i++) gidList[i] = rowMap1->GID(i);
489 Epetra_Util::Sort(
true,numRows,gidList,0,0,1,&numNonzerosPerRow);
493 if (verbose && me == 0) std::cout <<
" Inserting global values" << std::endl;
496 for (
int sum = 0; i < numRows; i++) {
497 if (numNonzerosPerRow[i]) {
498 int ierr = A->InsertGlobalValues(iv[sum], numNonzerosPerRow[i],
500 if (ierr<0) EPETRA_CHK_ERR(ierr);
501 sum += numNonzerosPerRow[i];
506 delete [] numNonzerosPerRow;
511 if (verbose && me == 0) std::cout <<
" Completing matrix fill" << std::endl;
512 if (rangeMap != 0 && domainMap != 0) {
513 EPETRA_CHK_ERR(A->FillComplete(*domainMap, *rangeMap));
516 Epetra_Map newDomainMap(N,rowMap1->IndexBase(), comm);
517 EPETRA_CHK_ERR(A->FillComplete(newDomainMap, *rowMap1));
520 EPETRA_CHK_ERR(A->FillComplete());
523 if (allocatedHere)
delete rowMap1;
525 if (handle!=0) fclose(handle);
526 double dt = timer.ElapsedTime();
527 if (verbose && me == 0) std::cout <<
"File Read time (secs): " << dt << std::endl;
532 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 534 const Epetra_Comm & comm,
535 Epetra_CrsMatrix * & A,
536 const Epetra_Map * rowMap,
537 const Epetra_Map * colMap,
538 const Epetra_Map * rangeMap,
539 const Epetra_Map * domainMap,
540 const bool transpose,
544 const int chunk_read = 500000;
546 const int headerlineLength = 257;
547 const int lineLength = 81;
548 const int tokenLength = 35;
549 char line[headerlineLength];
550 char token1[tokenLength];
551 char token2[tokenLength];
552 char token3[tokenLength];
553 char token4[tokenLength];
554 char token5[tokenLength];
556 int me = comm.MyPID();
558 Epetra_Time timer(comm);
561 if ((domainMap!=0 && rangeMap==0) || (domainMap==0 && rangeMap!=0)) {
568 if (!domainMap->UniqueGIDs()) {EPETRA_CHK_ERR(-2);}
569 if (!rangeMap->UniqueGIDs()) {EPETRA_CHK_ERR(-2);}
575 if (!rowMap->UniqueGIDs()) {EPETRA_CHK_ERR(-2);}
581 if (verbose) std::cout <<
"Reading MatrixMarket file " << filename << std::endl;
582 handle = fopen(filename,
"r");
588 if(fgets(line, headerlineLength, handle)==0) {
589 if (handle!=0) fclose(handle);
592 if(sscanf(line,
"%s %s %s %s %s", token1,token2,token3,token4,token5)==0) {
593 if (handle!=0) fclose(handle);
596 if (strcmp(token1,
"%%MatrixMarket") ||
597 strcmp(token2,
"matrix") ||
598 strcmp(token3,
"coordinate") ||
599 strcmp(token4,
"real") ||
600 strcmp(token5,
"general")) {
601 if (handle!=0) fclose(handle);
607 if(fgets(line, headerlineLength, handle)==0) {
608 if (handle!=0) fclose(handle);
611 }
while (line[0] ==
'%');
614 if(sscanf(line,
"%lld %lld %lld", &M, &N, &NZ)==0) {
615 if (handle!=0) fclose(handle);
619 comm.Broadcast(&M, 1, 0);
620 comm.Broadcast(&N, 1, 0);
621 comm.Broadcast(&NZ, 1, 0);
627 char *buffer =
new char[chunk_read*lineLength];
634 const int localblock = 100000;
635 int localsize = (int) (NZ / comm.NumProc()) + localblock;
636 long long *iv = (
long long *) malloc(localsize *
sizeof(
long long));
637 long long *jv = (
long long *) malloc(localsize *
sizeof(
long long));
638 double *vv = (
double *) malloc(localsize *
sizeof(
double));
641 if (!iv || !jv || !vv)
645 bool allocatedHere=
false;
647 rowMap1 =
const_cast<Epetra_Map *
>(rowMap);
649 rowMap1 =
new Epetra_Map(M, 0, comm);
650 allocatedHere =
true;
652 long long ioffset = rowMap1->IndexBase64()-1;
653 long long joffset = (colMap != 0 ? colMap->IndexBase64()-1 : ioffset);
656 long long prevrow = -1;
660 if (NZ-nread > chunk_read) nchunk = chunk_read;
661 else nchunk = NZ - nread;
666 for (
int i = 0; i < nchunk; i++) {
667 eof = fgets(&buffer[rlen],lineLength,handle);
669 fprintf(stderr,
"%s",
"Unexpected end of matrix file.");
672 rlen += strlen(&buffer[rlen]);
676 comm.Broadcast(&rlen, 1, 0);
677 comm.Broadcast(buffer, rlen, 0);
679 buffer[rlen++] =
'\0';
683 char *lineptr = buffer;
684 for (rlen = 0; rlen < nchunk; rlen++) {
685 char *next = strchr(lineptr,
'\n');
688 #if defined(_MSC_VER) 689 long long I = _strtoi64(strtok(lineptr,
" \t\n"), &endp, base) + ioffset;
690 long long J = _strtoi64(strtok(NULL,
" \t\n"), &endp, base) + joffset;
694 std::istringstream ssI(strtok(lineptr,
" \t\n"));
695 ssI >> I; I += ioffset;
696 std::istringstream ssJ(strtok(NULL,
" \t\n"));
697 ssJ >> J; J += joffset;
699 long long I = strtoll(strtok(lineptr,
" \t\n"), &endp, base) + ioffset;
700 long long J = strtoll(strtok(NULL,
" \t\n"), &endp, base) + joffset;
703 double V = atof(strtok(NULL,
" \t\n"));
711 if (rowMap1->MyGID(I)) {
713 if (lnz >= localsize) {
715 localsize += localblock;
716 iv = (
long long *) realloc(iv, localsize *
sizeof(
long long));
717 jv = (
long long *) realloc(jv, localsize *
sizeof(
long long));
718 vv = (
double *) realloc(vv, localsize *
sizeof(
double));
724 if (I < prevrow) rowmajor = 0;
730 if (nread / 1000000 > nmillion) {
732 if (verbose && me == 0) std::cout << nmillion <<
"M ";
741 if (verbose && me == 0) std::cout << std::endl <<
" Sorting local nonzeros" << std::endl;
750 if (verbose && me == 0) std::cout << std::endl <<
" Constructing the matrix" << std::endl;
751 int numRows = rowMap1->NumMyElements();
752 int *numNonzerosPerRow =
new int[numRows];
753 for (
int i = 0; i < numRows; i++) numNonzerosPerRow[i] = 0;
754 for (
int i = 0; i < lnz; i++)
755 numNonzerosPerRow[rowMap1->LID(iv[i])]++;
757 if (rowMap!=0 && colMap !=0)
758 A =
new Epetra_CrsMatrix(Copy, *rowMap, *colMap, numNonzerosPerRow);
759 else if (rowMap!=0) {
762 A =
new Epetra_CrsMatrix(Copy, *rowMap, numNonzerosPerRow,
true);
767 A =
new Epetra_CrsMatrix(Copy, *rowMap1, numNonzerosPerRow,
true);
769 A->SetTracebackMode(1);
773 long long *gidList =
new long long[numRows];
774 for (
int i = 0; i < numRows; i++) gidList[i] = rowMap1->GID64(i);
775 Epetra_Util::Sort(
true,numRows,gidList,0,0,1,&numNonzerosPerRow,0,0);
779 if (verbose && me == 0) std::cout <<
" Inserting global values" << std::endl;
782 for (
int sum = 0; i < numRows; i++) {
783 if (numNonzerosPerRow[i]) {
784 int ierr = A->InsertGlobalValues(iv[sum], numNonzerosPerRow[i],
786 if (ierr<0) EPETRA_CHK_ERR(ierr);
787 sum += numNonzerosPerRow[i];
792 delete [] numNonzerosPerRow;
797 if (verbose && me == 0) std::cout <<
" Completing matrix fill" << std::endl;
798 if (rangeMap != 0 && domainMap != 0) {
799 EPETRA_CHK_ERR(A->FillComplete(*domainMap, *rangeMap));
802 Epetra_Map newDomainMap(N,rowMap1->IndexBase64(), comm);
803 EPETRA_CHK_ERR(A->FillComplete(newDomainMap, *rowMap1));
806 EPETRA_CHK_ERR(A->FillComplete());
809 if (allocatedHere)
delete rowMap1;
811 if (handle!=0) fclose(handle);
812 double dt = timer.ElapsedTime();
813 if (verbose && me == 0) std::cout <<
"File Read time (secs): " << dt << std::endl;
823 template<
typename int_type>
825 int_type *list, int_type *parlista,
double *parlistb,
826 int start,
int end,
int *equal,
int *larger)
832 key = list ? list[(end+start)/2] : 1;
834 *equal = *larger = start;
835 for (i = start; i <= end; i++)
838 parlista[i] = parlista[*larger];
839 parlista[(*larger)] = parlista[*equal];
840 parlista[(*equal)] = itmp;
842 parlistb[i] = parlistb[*larger];
843 parlistb[(*larger)] = parlistb[*equal];
844 parlistb[(*equal)] = dtmp;
846 list[i] = list[*larger];
847 list[(*larger)++] = list[*equal];
848 list[(*equal)++] = itmp;
850 else if (list[i] == key) {
852 parlista[i] = parlista[*larger];
853 parlista[(*larger)] = itmp;
855 parlistb[i] = parlistb[*larger];
856 parlistb[(*larger)] = dtmp;
857 list[i] = list[*larger];
858 list[(*larger)++] = key;
863 template<
typename int_type>
864 static void sort_three(int_type* list, int_type *parlista,
double *parlistb,
872 sort_three(list, parlista, parlistb, start, equal-1);
873 sort_three(list, parlista, parlistb, larger, end);
878 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 880 const Epetra_Comm & comm,
881 Epetra_CrsMatrix * & A)
883 const int lineLength = 1025;
884 char line[lineLength];
890 handle = fopen(filename,
"r");
894 int numGlobalRows = 0;
895 int numGlobalCols = 0;
896 while(fgets(line, lineLength, handle)!=0) {
897 if(sscanf(line,
"%d %d %lg\n", &I, &J, &V)==0) {
if (handle!=0) fclose(handle); EPETRA_CHK_ERR(-1);}
898 if (I>numGlobalRows) numGlobalRows = I;
899 if (J>numGlobalCols) numGlobalCols = J;
902 if (handle!=0) fclose(handle);
903 Epetra_Map rangeMap(numGlobalRows, 0, comm);
904 Epetra_Map domainMap(numGlobalCols, 0, comm);
905 A =
new Epetra_CrsMatrix(Copy, rangeMap, 0);
908 const Epetra_Map & rowMap1 = A->RowMap();
912 handle = fopen(filename,
"r");
916 while (fgets(line, lineLength, handle)!=0) {
917 if(sscanf(line,
"%d %d %lg\n", &I, &J, &V)==0) {
if (handle!=0) fclose(handle); EPETRA_CHK_ERR(-1);}
919 if (rowMap1.MyGID(I)) {
920 int ierr = A->InsertGlobalValues(I, 1, &V, &J);
921 if (ierr<0) EPETRA_CHK_ERR(ierr);
925 EPETRA_CHK_ERR(A->FillComplete(domainMap, rangeMap));
927 if (handle!=0) fclose(handle);
932 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 934 const Epetra_Comm & comm,
935 Epetra_CrsMatrix * & A)
937 const int lineLength = 1025;
938 char line[lineLength];
944 handle = fopen(filename,
"r");
948 long long numGlobalRows = 0;
949 long long numGlobalCols = 0;
950 while(fgets(line, lineLength, handle)!=0) {
951 if(sscanf(line,
"%lld %lld %lg\n", &I, &J, &V)==0) {
if (handle!=0) fclose(handle); EPETRA_CHK_ERR(-1);}
952 if (I>numGlobalRows) numGlobalRows = I;
953 if (J>numGlobalCols) numGlobalCols = J;
956 if (handle!=0) fclose(handle);
957 Epetra_Map rangeMap(numGlobalRows, 0, comm);
958 Epetra_Map domainMap(numGlobalCols, 0, comm);
959 A =
new Epetra_CrsMatrix(Copy, rangeMap, 0);
962 const Epetra_Map & rowMap1 = A->RowMap();
966 handle = fopen(filename,
"r");
970 while (fgets(line, lineLength, handle)!=0) {
971 if(sscanf(line,
"%lld %lld %lg\n", &I, &J, &V)==0) {
if (handle!=0) fclose(handle); EPETRA_CHK_ERR(-1);}
973 if (rowMap1.MyGID(I)) {
974 int ierr = A->InsertGlobalValues(I, 1, &V, &J);
975 if (ierr<0) EPETRA_CHK_ERR(ierr);
979 EPETRA_CHK_ERR(A->FillComplete(domainMap, rangeMap));
981 if (handle!=0) fclose(handle);
986 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 988 int MyPID = comm.MyPID();
990 double filePID = (double)MyPID/(
double)100000;
991 std::ostringstream stream;
993 stream << std::setiosflags(std::ios::fixed) << std::setprecision(5) << filePID;
995 std::string fileName(filename);
996 fileName += stream.str().substr(1,7);
998 std::ifstream file(fileName.c_str());
1001 std::getline(file, line);
1003 std::istringstream istream(line);
1008 Epetra_Map RowMap(-1, iupper-ilower+1, 0, comm);
1009 Matrix =
new Epetra_CrsMatrix(Copy, RowMap, 0);
1012 std::vector<int> indices;
1013 std::vector<double> values;
1015 std::getline(file, line);
1016 std::istringstream lineStr(line);
1022 if(currRow == -1) currRow = row;
1025 counter = counter + 1;
1026 indices.push_back(col);
1027 values.push_back(val);
1029 Matrix->InsertGlobalValues(currRow, counter, &values[0], &indices[0]);
1035 indices.push_back(col);
1036 values.push_back(val);
1037 counter = counter + 1;
1040 Matrix->InsertGlobalValues(currRow, counter, &values[0], &indices[0]);
1041 Matrix->Comm().Barrier();
1042 Matrix->FillComplete();
1046 std::cout <<
"\nERROR:\nCouldn't open " << fileName <<
".\n";
1052 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES 1054 int MyPID = comm.MyPID();
1056 double filePID = (double)MyPID/(
double)100000;
1057 std::ostringstream stream;
1059 stream << std::setiosflags(std::ios::fixed) << std::setprecision(5) << filePID;
1061 std::string fileName(filename);
1062 fileName += stream.str().substr(1,7);
1064 std::ifstream file(fileName.c_str());
1067 std::getline(file, line);
1069 std::istringstream istream(line);
1074 Epetra_Map RowMap(-1LL, iupper-ilower+1, 0LL, comm);
1075 Matrix =
new Epetra_CrsMatrix(Copy, RowMap, 0);
1076 long long currRow = -1;
1078 std::vector<long long> indices;
1079 std::vector<double> values;
1081 std::getline(file, line);
1082 std::istringstream lineStr(line);
1088 if(currRow == -1) currRow = row;
1091 counter = counter + 1;
1092 indices.push_back(col);
1093 values.push_back(val);
1095 Matrix->InsertGlobalValues(currRow, counter, &values[0], &indices[0]);
1101 indices.push_back(col);
1102 values.push_back(val);
1103 counter = counter + 1;
1106 Matrix->InsertGlobalValues(currRow, counter, &values[0], &indices[0]);
1107 Matrix->Comm().Barrier();
1108 Matrix->FillComplete();
1112 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)