50 #include "Galeri_ReadHB.h"
69 int main(
int argc,
char *argv[])
72 MPI_Init(&argc, &argv);
78 std::string matrix_file;
79 std::string solver_type;
82 matrix_file = argv[1];
84 matrix_file =
"662_bus.rsa";
87 solver_type = argv[2];
91 if (Comm.
MyPID() == 0)
92 std::cout <<
"Reading matrix `" << matrix_file <<
"'";
112 Galeri::ReadHB(matrix_file.c_str(), Comm, readMap,
113 readA, readx, readb, readxexact);
117 std::cout <<
"Caught exception, maybe file name is incorrect" << std::endl;
144 assert (OriginalMap.
SameAs(*readMap));
152 x.Export(*readx, exporter,
Add);
153 b.Export(*readb, exporter,
Add);
154 xexact.Export(*readxexact, exporter,
Add);
155 A.Export(*readA, exporter,
Add);
175 std::cout <<
"Calling Amesos..." << std::endl;
183 Solver = Factory.
Create(solver_type,Problem);
188 std::cerr <<
"Selected solver (" << solver_type <<
") is not available" << std::endl;
194 return(EXIT_SUCCESS);
246 Ax.Update(1.0, b, -1.0);
250 std::cout <<
"After Amesos solution, ||b - A * x||_2 = " << residual << std::endl;
257 return(EXIT_FAILURE);
263 return(EXIT_SUCCESS);
int NumGlobalElements() const
virtual int Solve()=0
Solves A X = B (or AT x = B)
bool GlobalIndicesLongLong() const
bool SameAs(const Epetra_BlockMap &Map) const
int Multiply(bool TransA, const Epetra_Vector &x, Epetra_Vector &y) const
const Epetra_Map & RowMatrixRowMap() const
bool GlobalIndicesInt() const
int FillComplete(bool OptimizeDataStorage=true)
virtual void PrintTiming() const =0
Prints timing information about the current solver.
virtual const Epetra_BlockMap & Map() const =0
int main(int argc, char *argv[])
Factory for binding a third party direct solver to an Epetra_LinearProblem.
virtual void PrintStatus() const =0
Prints status information about the current solver.
Amesos_BaseSolver * Create(const char *ClassType, const Epetra_LinearProblem &LinearProblem)
Amesos Create method.
Amesos_BaseSolver: A pure virtual class for direct solution of real-valued double-precision operators...