61 int main(
int argc,
char *argv[])
69 MPI_Init(&argc, &argv);
72 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
85 if (argc>1)
if (argv[1][0]==
'-' && argv[1][1]==
'v') verbose =
true;
87 int verbose_int = verbose ? 1 : 0;
89 verbose = verbose_int==1 ?
true :
false;
92 int MyPID = Comm.
MyPID();
95 if(verbose && MyPID==0)
98 if (verbose) std::cout <<
"Processor "<<MyPID<<
" of "<< NumProc
99 <<
" is alive."<< std::endl;
104 if(verbose && rank!=0)
107 if (verbose) std::cout <<
"Test the memory management system of the class CrsMatrix (memory leak, invalid free)" << std::endl;
115 if (verbose) std::cout <<
"* Using Copy, ColMap, Variable number of indices per row and Static profile (cf. bug #5499)." << std::endl;
121 std::vector<long long> colids(2);
124 Epetra_Map ColMap(-1LL, 2, &colids[0], 0LL, Comm);
127 std::vector<int> NumEntriesPerRow(2);
128 NumEntriesPerRow[0]=2;
129 NumEntriesPerRow[1]=2;
144 if (verbose) std::cout <<
"* Using Copy, Fixed number of indices per row and Static profile" << std::endl;
161 if (verbose) std::cout <<
"* Using Copy, Fixed number of indices per row and Static profile + InsertGlobalValues()." << std::endl;
167 std::vector<long long> Indices(1);
168 std::vector<double> Values(1);
184 if (verbose) std::cout <<
"* Using Copy, Fixed number of indices per row and Dynamic profile" << std::endl;
200 if (verbose) std::cout <<
"* Using Copy, Fixed number of indices per row and Dynamic profile + InsertGlobalValues()." << std::endl;
206 std::vector<long long> Indices(1);
207 std::vector<double> Values(1);
218 if (verbose) std::cout <<
"* Using Copy, Static Graph()." << std::endl;
224 std::vector<long long> Indices(1);
230 std::vector<double> Values(1);
235 if (verbose) std::cout <<
"** Inf Norm of Matrix = " << norminf <<
"." << std::endl;
236 std::cout << A << std::endl;
244 if (verbose) std::cout <<
"* Using Copy, Fixed number of indices per row and static profile + InsertGlobalValues() for a single row." << std::endl;
250 std::vector<long long> Indices(1);
251 std::vector<double> Values(1);
265 if (verbose) std::cout << std::endl <<
"tests PASSED" << std::endl << std::endl;
Epetra_Map: A class for partitioning vectors and matrices.
int FillComplete()
Tranform to local index space. Perform other operations to allow optimal matrix operations.
virtual int InsertGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
Insert a list of elements in a given global row of the matrix.
double NormInf() const
Returns the infinity norm of the global matrix.
static void SetTracebackMode(int TracebackModeValue)
Set the value of the Epetra_Object error traceback report mode.
int MyPID() const
Return my process ID.
Epetra_MpiComm: The Epetra MPI Communication Class.
std::string Epetra_Version()
int FillComplete(bool OptimizeDataStorage=true)
Signal that data entry is complete. Perform transformations to local index space. ...
int NumProc() const
Returns total number of processes (always returns 1 for SerialComm).
int InsertGlobalIndices(int GlobalRow, int NumIndices, int *Indices)
Enter a list of elements in a specified global row of the graph.
Epetra_SerialComm: The Epetra Serial Communication Class.
Epetra_CrsMatrix: A class for constructing and using real-valued double-precision sparse compressed r...
int main(int argc, char *argv[])
int Broadcast(double *MyVals, int Count, int Root) const
Epetra_SerialComm Broadcast function.
virtual int ReplaceGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
Replace specified existing values with this list of entries for a given global row of the matrix...
Epetra_CrsGraph: A class for constructing and using sparse compressed row graphs. ...