Skip to content

Commit

Permalink
#210: add missing includes and update orthomanager method signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
tlamonthezie committed Sep 26, 2023
1 parent d73f2eb commit cf96b9e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
#include <Teuchos_Comm.hpp>
#include <Teuchos_CommHelpers.hpp>
#include <Teuchos_DefaultComm.hpp>
#include "Teuchos_ParameterList.hpp"
#include <Teuchos_ParameterList.hpp>
#include <Teuchos_TypeNameTraits.hpp>
#include <Teuchos_oblackholestream.hpp>
#include "Teuchos_StandardCatchMacros.hpp"
#include "Teuchos_CommandLineProcessor.hpp"
#include <Teuchos_StandardCatchMacros.hpp>
#include <Teuchos_CommandLineProcessor.hpp>

// Belos
#include "BelosTpetraAdapter.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#include "BelosConfigDefs.hpp"
#include "BelosPseudoBlockGmresSolMgr.hpp"
#include "BelosLinearProblem.hpp"
#include "BelosTpetraAdapter.hpp"


template <typename ScalarType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
#include "BelosConfigDefs.hpp"
#include "BelosGCRODRSolMgr.hpp"
#include "BelosLinearProblem.hpp"

#include "BelosTpetraAdapter.hpp"

template <typename ScalarType>
int run(int argc, char *argv[]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
#include "BelosLinearProblem.hpp"
#include "BelosPseudoBlockTFQMRSolMgr.hpp"
#include "BelosTpetraAdapter.hpp"
#include "BelosTpetraTestFramework.hpp"

template <typename ScalarType>
int run(int argc, char *argv[]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class SparseMatrixLoader {
typedef Tpetra::Map<LocalOrdinalType, GlobalOrdinalType, NodeType> map_type;
typedef Tpetra::CrsMatrix<ScalarType, LocalOrdinalType, GlobalOrdinalType, NodeType> matrix_type;

static void load(Teuchos::RCP<map_type>& map, Teuchos::RCP<matrix_type>& M,
static void load(Teuchos::RCP<const map_type>& map, Teuchos::RCP<matrix_type>& M,
const Teuchos::RCP<const Teuchos::Comm<int> >& comm, std::ostream& debugOut) {
TEUCHOS_TEST_FOR_EXCEPTION(filename != "", std::logic_error,
"Sorry, reading in a Harwell-Boeing "
Expand All @@ -226,12 +226,12 @@ class SparseMatrixLoader<double, LocalOrdinalType, GlobalOrdinalType, NodeType>
typedef Tpetra::Map<LocalOrdinalType, GlobalOrdinalType, NodeType> map_type;
typedef Tpetra::CrsMatrix<double, LocalOrdinalType, GlobalOrdinalType, NodeType> matrix_type;

static void load(Teuchos::RCP<map_type>& map, Teuchos::RCP<matrix_type>& M,
static void load(Teuchos::RCP<const map_type>& map, Teuchos::RCP<matrix_type>& M,
const Teuchos::RCP<const Teuchos::Comm<int> >& comm, std::ostream& debugOut) {
// If the sparse matrix is loaded successfully, this call will
// modify numRows to be the number of rows in the sparse matrix.
// Otherwise, it will leave numRows alone.
std::pair<Teuchos::RCP<map_type>, Teuchos::RCP<matrix_type> > results =
std::pair<Teuchos::RCP<const map_type>, Teuchos::RCP<matrix_type> > results =
Belos::Test::loadSparseMatrix<typename matrix_type::scalar_type, LocalOrdinalType, GlobalOrdinalType, NodeType>(
comm, filename, numRows, debugOut);
map = results.first;
Expand Down Expand Up @@ -281,7 +281,7 @@ bool runTest(const Teuchos::RCP<const Teuchos::Comm<int> >& comm) {
// Teuchos::null. Also return an appropriate Map (which will always
// be initialized, even if filename == ""; it should never be
// Teuchos::null).
RCP<map_type> map;
RCP<const map_type> map;
RCP<crs_matrix_type> M;
{
typedef SparseMatrixLoader<scalar_type, local_ordinal_type, global_ordinal_type, node_type> loader_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ main (int argc, char *argv[])
// If the sparse matrix is loaded successfully, this call will
// modify numRows to be the total number of rows in the sparse
// matrix. Otherwise, it will leave numRows alone.
std::pair<RCP<map_type>, RCP<sparse_matrix_type> > results =
std::pair<RCP<const map_type>, RCP<sparse_matrix_type> > results =
loadSparseMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type> (pComm, filename, numRows, debugOut);
map = results.first;
M = results.second;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Teuchos::RCP<Belos::OutputManager<Scalar>> makeOutputManager(const bool verbose,
/// that the domain, range, and row maps are the same) and a
/// sparse_matrix_type (the sparse matrix itself).
template <class SC, class LO, class GO, class NodeType>
std::pair<Teuchos::RCP<::Tpetra::Map<LO, GO, NodeType>>, Teuchos::RCP<::Tpetra::CrsMatrix<SC, LO, GO, NodeType>>>
std::pair<Teuchos::RCP<const Tpetra::Map<LO, GO, NodeType>>, Teuchos::RCP<Tpetra::CrsMatrix<SC, LO, GO, NodeType>>>
loadSparseMatrix(const Teuchos::RCP<const Teuchos::Comm<int>> pComm, const std::string& filename, int& numRows,
std::ostream& debugOut) {
typedef SC scalar_type;
Expand All @@ -113,8 +113,7 @@ loadSparseMatrix(const Teuchos::RCP<const Teuchos::Comm<int>> pComm, const std::
using Teuchos::RCP;
using Teuchos::rcp;

// const int myRank = Teuchos::rank (*pComm);
RCP<map_type> pMap;
RCP<const map_type> pMap;
RCP<sparse_matrix_type> pMatrix;

if (filename != "") {
Expand Down

0 comments on commit cf96b9e

Please sign in to comment.