#include <Teuchos_oblackholestream.hpp>
#include <Tpetra_MatrixIO.hpp>
#include "Tpetra_Power_Method.hpp"
#include "Tpetra_DefaultPlatform.hpp"
#include "Tpetra_Version.hpp"
#include "Tpetra_Map.hpp"
#include "Tpetra_MultiVector.hpp"
#include "Tpetra_Vector.hpp"
#include "Tpetra_CrsMatrix.hpp"
int main(int argc, char *argv[]) {
typedef double Scalar;
typedef int Ordinal;
using Teuchos::tuple;
RCP<const Teuchos::Comm<int> > comm = platform.getComm();
RCP<Node> node = platform.getNode();
const int myRank = comm->getRank();
bool printMatrix = false;
bool verbose = (myRank==0);
int niters = 100;
Magnitude tolerance = 1.0e-2;
std::string filename("bcsstk14.hb");
cmdp.
setOption(
"verbose",
"quiet",&verbose,
"Print messages and results.");
cmdp.
setOption(
"filename",&filename,
"Filename for Harwell-Boeing test matrix.");
cmdp.
setOption(
"tolerance",&tolerance,
"Relative residual tolerance used for solver.");
cmdp.
setOption(
"iterations",&niters,
"Maximum number of iterations.");
cmdp.
setOption(
"printMatrix",
"noPrintMatrix",&printMatrix,
"Print the full matrix after reading it.");
return -1;
}
if (verbose) {
std::cout << "\n" << Tpetra::version() << std::endl << std::endl;
}
std::cout << "Comm info: " << *comm;
RCP<CrsMatrix> A;
Tpetra::Utils::readHBMatrix(filename,comm,node,A);
if (printMatrix) {
RCP<Teuchos::FancyOStream> fos = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
}
else if (verbose) {
std::cout << std::endl << A->description() << std::endl << std::endl;
}
TpetraExamples::powerMethod<Scalar,Ordinal>(A, niters, tolerance, verbose);
if (verbose) {
std::cout << "\nEnd Result: TEST PASSED" << std::endl;
}
return 0;
}