49#include "Teuchos_ParameterList.hpp"
50#include "Teuchos_RefCountPtr.hpp"
51#include "Teuchos_Time.hpp"
52#include "Teuchos_Comm.hpp"
70std::cout <<
"creating b = A*random" << std::endl;
83Teuchos::RCP< Epetra_LinearProblem >
87 Teuchos::Time timer(
"build_problem");
93 std::string mm_file(
"not specified");
94 std::string rhs_mm_file(
"not specified");
97 std::string hb_file(
"not specified");
100 if (mm_file !=
"not specified") {
101 if (comm.MyPID() == 0) {
102 std::cout <<
"Matrix-Market file: " << mm_file << std::endl;
105 if (rhs_mm_file !=
"not specified") {
106 if (comm.MyPID() == 0) {
107 std::cout <<
"Matrix-Market file: " << rhs_mm_file << std::endl;
112 else if (hb_file !=
"not specified") {
116 throw std::runtime_error(
"No matrix file specified.");
119 Teuchos::RCP<Epetra_LinearProblem> problem =
build_problem_mm(test_params, A, b);
121 if (comm.MyPID() == 0) {
122 std::cout <<
"proc 0 time to read matrix & create problem: " << timer.totalElapsedTime()
Epetra_CrsMatrix * read_matrix_mm(const std::string &mm_file, const Epetra_Comm &comm)
void read_matrix_hb(const std::string &hb_file, const Epetra_Comm &Comm, Epetra_CrsMatrix *&A, Epetra_Vector *&b)
Epetra_Vector * read_vector_mm(const std::string &mm_file, const Epetra_Comm &comm)
Teuchos::RCP< Epetra_LinearProblem > build_problem_mm(Teuchos::ParameterList &test_params, Epetra_CrsMatrix *A, Epetra_MultiVector *b)
Teuchos::RCP< Epetra_LinearProblem > build_problem(Teuchos::ParameterList &test_params, const Epetra_Comm &comm)
const Epetra_Map & RowMap() const
int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
int PutScalar(double ScalarConstant)
void GetParameter(const Teuchos::ParameterList ¶ms, const std::string &name, T &value)
Set a value from a ParameterList if a parameter with the specified name exists.