10#ifndef TPETRA_MMHELPERS_DECL_HPP 
   11#define TPETRA_MMHELPERS_DECL_HPP 
   13#include <Tpetra_CrsMatrix.hpp> 
   14#include <Tpetra_BlockCrsMatrix.hpp> 
   15#include <Teuchos_Array.hpp> 
   32template <
class Scalar        = ::Tpetra::Details::DefaultTypes::scalar_type,
 
   34          class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
 
   35          class Node          = ::Tpetra::Details::DefaultTypes::node_type>
 
   45  void deleteContents();
 
   58  Teuchos::RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > 
importMatrix;
 
   60  Teuchos::RCP<const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > 
origMatrix;
 
 
   68template <
class Scalar        = ::Tpetra::Details::DefaultTypes::scalar_type,
 
   70          class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
 
   71          class Node          = ::Tpetra::Details::DefaultTypes::node_type>
 
   81  void deleteContents();
 
   94  Teuchos::RCP<BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > 
importMatrix;
 
   96  Teuchos::RCP<const BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > 
origMatrix;
 
 
  101template <
class Scalar, 
class LocalOrdinal, 
class GlobalOrdinal, 
class Node>
 
  104template <
class Scalar, 
class LocalOrdinal, 
class GlobalOrdinal, 
class Node>
 
  109  virtual ~CrsWrapper() {}
 
  110  virtual Teuchos::RCP<const map_type> getRowMap() 
const = 0;
 
  111  virtual bool isFillComplete()                          = 0;
 
  114  insertGlobalValues(GlobalOrdinal globalRow,
 
  115                     const Teuchos::ArrayView<const GlobalOrdinal> &indices,
 
  116                     const Teuchos::ArrayView<const Scalar> &values) = 0;
 
  118  sumIntoGlobalValues(GlobalOrdinal globalRow,
 
  119                      const Teuchos::ArrayView<const GlobalOrdinal> &indices,
 
  120                      const Teuchos::ArrayView<const Scalar> &values) = 0;
 
  123template <
class Scalar        = ::Tpetra::Details::DefaultTypes::scalar_type,
 
  125          class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
 
  126          class Node          = ::Tpetra::Details::DefaultTypes::node_type>
 
  127class CrsWrapper_CrsMatrix : 
public CrsWrapper<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
 
  129  typedef Map<LocalOrdinal, GlobalOrdinal, Node> map_type;
 
  130  typedef CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> crs_matrix_type;
 
  132  CrsWrapper_CrsMatrix(crs_matrix_type &crsmatrix);
 
  133  virtual ~CrsWrapper_CrsMatrix();
 
  134  Teuchos::RCP<const map_type> getRowMap() 
const;
 
  136  bool isFillComplete();
 
  139  insertGlobalValues(GlobalOrdinal globalRow,
 
  140                     const Teuchos::ArrayView<const GlobalOrdinal> &indices,
 
  141                     const Teuchos::ArrayView<const Scalar> &values);
 
  143  sumIntoGlobalValues(GlobalOrdinal globalRow,
 
  144                      const Teuchos::ArrayView<const GlobalOrdinal> &indices,
 
  145                      const Teuchos::ArrayView<const Scalar> &values);
 
  148  crs_matrix_type &crsmat_;
 
  151template <
class Scalar        = ::Tpetra::Details::DefaultTypes::scalar_type,
 
  153          class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
 
  154          class Node          = ::Tpetra::Details::DefaultTypes::node_type>
 
  155class CrsWrapper_GraphBuilder : 
public CrsWrapper<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
 
  157  typedef Map<LocalOrdinal, GlobalOrdinal, Node> map_type;
 
  159  CrsWrapper_GraphBuilder(
const Teuchos::RCP<const map_type> &map);
 
  160  virtual ~CrsWrapper_GraphBuilder();
 
  162  Teuchos::RCP<const map_type> getRowMap()
 const {
 
  166  bool isFillComplete();
 
  168  insertGlobalValues(GlobalOrdinal globalRow,
 
  169                     const Teuchos::ArrayView<const GlobalOrdinal> &indices,
 
  170                     const Teuchos::ArrayView<const Scalar> &values);
 
  172  sumIntoGlobalValues(GlobalOrdinal globalRow,
 
  173                      const Teuchos::ArrayView<const GlobalOrdinal> &indices,
 
  174                      const Teuchos::ArrayView<const Scalar> &values);
 
  176  std::map<GlobalOrdinal, std::set<GlobalOrdinal> *> &get_graph();
 
  178  size_t get_max_row_length() {
 
  179    return max_row_length_;
 
  183  std::map<GlobalOrdinal, std::set<GlobalOrdinal> *> graph_;
 
  184  const Teuchos::RCP<const map_type> &rowmap_;
 
  188template <
class Scalar, 
class LocalOrdinal, 
class GlobalOrdinal, 
class Node>
 
  189void insert_matrix_locations(CrsWrapper_GraphBuilder<Scalar, LocalOrdinal, GlobalOrdinal, Node> &graphbuilder,
 
  190                             CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> &C);
 
Struct that holds views of the contents of a BlockCrsMatrix.
 
Teuchos::RCP< const map_type > importColMap
Colmap garnered as a result of the import.
 
Teuchos::RCP< BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > importMatrix
The imported matrix.
 
Teuchos::RCP< const map_type > colMap
Col map for the original version of the matrix.
 
Teuchos::RCP< const map_type > domainMap
Domain map for original matrix.
 
Teuchos::RCP< const BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > origMatrix
The original matrix.
 
Teuchos::RCP< const map_type > rowMap
Desired row map for "imported" version of the matrix.
 
const LocalOrdinal blocksize
The blocksize of all matrices.
 
Teuchos::RCP< const map_type > origRowMap
Original row map of matrix.
 
Struct that holds views of the contents of a CrsMatrix.
 
Teuchos::RCP< const map_type > colMap
Col map for the original version of the matrix.
 
Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > origMatrix
The original matrix.
 
Teuchos::RCP< const map_type > importColMap
Colmap garnered as a result of the import.
 
Teuchos::RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > importMatrix
The imported matrix.
 
Teuchos::RCP< const map_type > domainMap
Domain map for original matrix.
 
Teuchos::RCP< const map_type > rowMap
Desired row map for "imported" version of the matrix.
 
Teuchos::RCP< const map_type > origRowMap
Original row map of matrix.
 
Sparse matrix that presents a row-oriented interface that lets users read or modify entries.
 
int local_ordinal_type
Default value of Scalar template parameter.
 
Namespace Tpetra contains the class and methods constituting the Tpetra library.
 
size_t global_size_t
Global size_t object.