40 #ifndef _ispatest_epetra_test_utils_hpp_
41 #define _ispatest_epetra_test_utils_hpp_
50 class Epetra_CrsGraph;
51 class Epetra_RowMatrix;
52 class Epetra_LinearProblem;
53 class Epetra_CrsMatrix;
54 class Epetra_MultiVector;
56 class Epetra_BlockMap;
68 int numNonzerosPerRow,
77 int numNonzerosPerRow,
153 std::vector<double> &x, std::vector<double> &y, std::vector<double> &z);
162 Epetra_MultiVector *
makeWeights(
const Epetra_BlockMap &map,
double (*wFunc)(
const int,
const int,
const int,
const int));
166 double unitWeights(
const int id,
const int me,
const int nids,
const int nprocs);
171 double veeWeights(
const int id,
const int me,
const int nids,
const int nprocs);
175 double alternateWeights(
const int id,
const int me,
const int nids,
const int nprocs);
180 Epetra_MultiVector *
file2multivector(
const Epetra_Comm &comm,
const std::string &fname);
186 const char *s,
int max=1000);
194 const char *s,
bool withGraphCuts,
int max=1000);
double veeWeights(const int id, const int me, const int nids, const int nprocs)
A function for makeWeights, weight is based on global ID, lower in the middle and higher at both ends...
int fill_graph(Epetra_CrsGraph &graph, int numNonzerosPerRow, bool verbose)
Fill a graph with the specified number of nonzeros per row.
Epetra_Map * map_from_blockmap(const Epetra_BlockMap &b)
Method to create an Epetra_Map from an Epetra_BlockMap, when using methods that require an Epetra_Map...
bool test_matrix_vector_multiply(Epetra_CrsMatrix &A)
Verify that a matrix is a valid Epetra_CrsMatrix by attempting to multiply with it.
int printMultiVector(const Epetra_MultiVector &mv, std::ostream &os, const char *s, int max=1000)
Print out the contents of the multivector by process, with optional title.
bool test_row_matrix_vector_multiply(Epetra_RowMatrix &R)
Verify that a matrix is a valid Epetra_RowMatrix by attempting to multiply with it.
int printRowMatrix(const Epetra_RowMatrix &m, std::ostream &os, const char *s, bool withGraphCuts, int max=1000)
Print out the contents of a small Epetra_RowMatrix, with optional title.
Epetra_MultiVector * makeWeights(const Epetra_BlockMap &map, double(*wFunc)(const int, const int, const int, const int))
Create a multivector of 1 dimensional weights with the same distribution as the supplied map...
int readCoordFile(const std::string &fname, std::vector< double > &x, std::vector< double > &y, std::vector< double > &z)
Read in the file "fname".
double alternateWeights(const int id, const int me, const int nids, const int nprocs)
A function for makeWeights, weights alternate 1.0, 2.0, 1.0, etc.
Epetra_MultiVector * file2multivector(const Epetra_Comm &comm, const std::string &fname)
Read in a file of 1, 2 or 3 dimensional coordinates and create a multivector with a standard linear d...
int fill_matrix(Epetra_CrsMatrix &matrix, int numNonzerosPerRow, bool verbose)
Fill a matrix with the specified number of nonzeros per row, using matrix.InsertGlobalValues.
double unitWeights(const int id, const int me, const int nids, const int nprocs)
A function for makeWeights, returns 1.0 for the object's weight.