2 #include "RBGen_EpetraCrsMatrixFileIOHandler.h"
3 #include "RBGen_ConfigDefs.h"
5 #include "Epetra_BLAS.h"
6 #include "Epetra_Export.h"
7 #include "Epetra_Import.h"
8 #include "Epetra_Map.h"
9 #include "Epetra_CrsMatrix.h"
11 #include "EpetraExt_readEpetraLinearSystem.h"
12 #include "EpetraExt_RowMatrixOut.h"
15 #include "Epetra_MpiComm.h"
17 #include "Epetra_SerialComm.h"
20 #include "Teuchos_Assert.hpp"
36 if ( fileio_params.
isParameter(
"Data Input Path" ) ) {
37 in_path = Teuchos::getParameter<std::string>( fileio_params,
"Data Input Path" );
42 if ( fileio_params.
isParameter(
"Data Output Path" ) ) {
43 out_path = Teuchos::getParameter<std::string>( fileio_params,
"Data Output Path" );
66 std::string temp_filename = in_path + filenames[0];
72 EpetraExt::readEpetraLinearSystem( temp_filename, comm, &newMTX, &Map );
86 std::string temp_filename = out_path + filename;
87 EpetraExt::RowMatrixToMatrixMarketFile( temp_filename.c_str(), *(Teuchos::rcp_dynamic_cast<
const Epetra_CrsMatrix>(MTX)) );
void Initialize(const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Initialize file reader using.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
bool isParameter(const std::string &name) const
void Write(const Teuchos::RCP< const Epetra_Operator > &MTX, const std::string &filename)
Method for writing one Epetra_CrsMatrix into a file using the same type as was.
EpetraCrsMatrixFileIOHandler()
Default constructor.
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
Teuchos::RCP< Epetra_Operator > Read(const std::vector< std::string > &filenames)
Method for reading a file and constructing an Epetra_CrsMatrix.