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) {
118 int* indices =
new int[rowLen*2];
119 int* Bindices = indices+rowLen;
121 double* values =
new double[rowLen*2];
122 double* Bvalues = values+rowLen;
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];
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;
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.";
bool PointSameAs(const Epetra_BlockMap &Map) const
Returns true if this and Map have identical point-wise structure.
int MyGlobalElements(int *MyGlobalElementList) const
Puts list of global elements on this processor into the user-provided array.
long long * MyGlobalElements64() const
bool GlobalIndicesInt() const
Returns true if map create with int NumGlobalElements.
int NumMyElements() const
Number of elements on the calling processor.
bool GlobalIndicesLongLong() const
Returns true if map create with long long NumGlobalElements.
Epetra_Comm: The Epetra Communication Abstract Base Class.
virtual int NumProc() const =0
Returns total number of processes.
virtual int Broadcast(double *MyVals, int Count, int Root) const =0
Epetra_Comm Broadcast function.
virtual int MyPID() const =0
Return my process ID.
Epetra_CrsMatrix: A class for constructing and using real-valued double-precision sparse compressed r...
int NumGlobalEntries(long long Row) const
Returns the current number of nonzero entries in specified global row on this processor.
const Epetra_Map & RowMap() const
Returns the Epetra_Map object associated with the rows of this matrix.
int ExtractGlobalRowCopy(int GlobalRow, int Length, int &NumEntries, double *Values, int *Indices) const
Returns a copy of the specified global row in user-provided arrays.
Epetra_Map: A class for partitioning vectors and matrices.
Epetra_MpiComm: The Epetra MPI Communication Class.
Epetra_SerialComm: The Epetra Serial Communication Class.
Epetra_Util: The Epetra Util Wrapper Class.
static void EPETRA_LIB_DLL_EXPORT Sort(bool SortAscending, int NumKeys, T *Keys, int NumDoubleCompanions, double **DoubleCompanions, int NumIntCompanions, int **IntCompanions, int NumLongLongCompanions, long long **LongLongCompanions)
Epetra_Util Sort Routine (Shell sort)
bool global_check_for_flag_on_proc_0(const char *flag, int numargs, char **strargs, const Epetra_Comm &comm)
Check through a list of C-style string arguments searching for a specified flag on proc 0.
Epetra_Comm * create_comm(int argc, char **argv)
If macro EPETRA_MPI is defined, call MPI_Init and then return new Epetra_MpiComm.
bool compare_matrices(const Epetra_CrsMatrix &A, const Epetra_CrsMatrix &B)
Check whether the two CrsMatrix arguments have the same size, structure and coefs.
bool compare_matrices_LL(const Epetra_CrsMatrix &A, const Epetra_CrsMatrix &B)