59 int mypid = comm.
MyPID();
64 for(
int i=0; i<numargs; ++i) {
65 if (strargs[i]==0)
continue;
67 if (strcmp(flag, strargs[i]) == 0) {
68 flag_found = 1;
break;
77 bool return_value = flag_found==1 ? true :
false;
79 return( return_value );
85 MPI_Init(&argc, &argv);
106 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
111 for(
int i=0; i<numRows; ++i) {
113 int rowLen =
A.NumGlobalEntries(row);
114 if (rowLen !=
B.NumGlobalEntries(row)) {
118 int* indices =
new int[rowLen*2];
119 int* Bindices = indices+rowLen;
121 double* values =
new double[rowLen*2];
122 double* Bvalues = values+rowLen;
124 A.ExtractGlobalRowCopy(row, rowLen, rowLen, values, indices);
125 B.ExtractGlobalRowCopy(row, rowLen, rowLen, Bvalues, Bindices);
127 util.
Sort(
true, rowLen, indices, 1, &values, 0, 0, 0, 0);
128 util.
Sort(
true, rowLen, Bindices, 1, &Bvalues, 0, 0, 0, 0);
131 for(
int j=0; j<rowLen; ++j) {
132 if (indices[j] != Bindices[j]) {
135 if (values[j] != Bvalues[j]) {
148 throw "compare_matrices: GlobalIndices int but not API for it.";
152 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
158 for(
int i=0; i<numRows; ++i) {
159 long long row = rows[i];
160 int rowLen =
A.NumGlobalEntries(row);
161 if (rowLen !=
B.NumGlobalEntries(row)) {
165 long long* indices =
new long long[rowLen*2];
166 long long* Bindices = indices+rowLen;
168 double* values =
new double[rowLen*2];
169 double* Bvalues = values+rowLen;
171 A.ExtractGlobalRowCopy(row, rowLen, rowLen, values, indices);
172 B.ExtractGlobalRowCopy(row, rowLen, rowLen, Bvalues, Bindices);
174 util.
Sort(
true, rowLen, indices, 1, &values, 0, 0, 0, 0);
175 util.
Sort(
true, rowLen, Bindices, 1, &Bvalues, 0, 0, 0, 0);
178 for(
int j=0; j<rowLen; ++j) {
179 if (indices[j] != Bindices[j]) {
182 if (values[j] != Bvalues[j]) {
195 throw "compare_matrices: GlobalIndices long long but not API for it.";