46 #ifndef XPETRA_CRSGRAPHFACTORY_HPP
47 #define XPETRA_CRSGRAPHFACTORY_HPP
53 #ifdef HAVE_XPETRA_TPETRA
54 #include "Xpetra_TpetraCrsGraph.hpp"
57 #ifdef HAVE_XPETRA_EPETRA
65 template <
class LocalOrdinal,
67 class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
75 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
77 TEUCHOS_TEST_FOR_EXCEPTION(rowMap->lib() ==
UseEpetra, std::logic_error,
78 "Can't create Xpetra::EpetraCrsMatrix with these scalar/LO/GO types");
79 #ifdef HAVE_XPETRA_TPETRA
88 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
92 #ifdef HAVE_XPETRA_TPETRA
99 TEUCHOS_UNREACHABLE_RETURN(null);
103 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
106 size_t maxNumEntriesPerRow,
107 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
110 #ifdef HAVE_XPETRA_TPETRA
117 TEUCHOS_UNREACHABLE_RETURN(null);
121 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
124 const ArrayRCP<const size_t>& NumEntriesPerRowToAlloc,
125 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
128 #ifdef HAVE_XPETRA_TPETRA
135 TEUCHOS_UNREACHABLE_RETURN(null);
139 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
144 const RCP<Teuchos::ParameterList>& params = Teuchos::null) {
145 #ifdef HAVE_XPETRA_TPETRA
146 if (sourceGraph->getRowMap()->lib() ==
UseTpetra)
152 TEUCHOS_UNREACHABLE_RETURN(null);
155 #ifdef HAVE_XPETRA_TPETRA
156 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
180 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
211 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
215 const Teuchos::RCP<Teuchos::ParameterList>& params) {
251 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
257 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
291 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
294 const Teuchos::ArrayRCP<size_t>& rowPointers,
295 const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
296 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
311 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES))
325 static RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
328 #ifdef HAVE_XPETRA_TPETRA
332 #ifdef HAVE_XPETRA_EPETRA
339 static RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
343 #ifdef HAVE_XPETRA_TPETRA
352 TEUCHOS_UNREACHABLE_RETURN(null);
355 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
359 #ifdef HAVE_XPETRA_TPETRA
368 TEUCHOS_UNREACHABLE_RETURN(null);
372 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
375 size_t maxNumEntriesPerRow,
376 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
379 #ifdef HAVE_XPETRA_TPETRA
387 TEUCHOS_UNREACHABLE_RETURN(null);
391 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
396 const RCP<Teuchos::ParameterList>& params = Teuchos::null) {
397 #ifdef HAVE_XPETRA_TPETRA
398 if (sourceGraph->getRowMap()->lib() ==
UseTpetra)
401 if (sourceGraph->getRowMap()->lib() ==
UseEpetra)
405 TEUCHOS_UNREACHABLE_RETURN(null);
408 #ifdef HAVE_XPETRA_TPETRA
409 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
433 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
464 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
468 const Teuchos::RCP<Teuchos::ParameterList>& params) {
504 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
510 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
544 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
547 const Teuchos::ArrayRCP<size_t>& rowPointers,
548 const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
549 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
565 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES))
579 static RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
582 #ifdef HAVE_XPETRA_TPETRA
586 #ifdef HAVE_XPETRA_EPETRA
593 static RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
597 #ifdef HAVE_XPETRA_TPETRA
606 TEUCHOS_UNREACHABLE_RETURN(null);
609 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
613 #ifdef HAVE_XPETRA_TPETRA
622 TEUCHOS_UNREACHABLE_RETURN(null);
626 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
629 size_t maxNumEntriesPerRow,
630 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
633 #ifdef HAVE_XPETRA_TPETRA
641 TEUCHOS_UNREACHABLE_RETURN(null);
645 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
650 const RCP<Teuchos::ParameterList>& params = Teuchos::null) {
651 #ifdef HAVE_XPETRA_TPETRA
652 if (sourceGraph->getRowMap()->lib() ==
UseTpetra)
655 if (sourceGraph->getRowMap()->lib() ==
UseTpetra)
659 TEUCHOS_UNREACHABLE_RETURN(null);
662 #ifdef HAVE_XPETRA_TPETRA
663 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
687 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
718 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
722 const Teuchos::RCP<Teuchos::ParameterList>& params) {
758 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
764 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
798 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
801 const Teuchos::ArrayRCP<size_t>& rowPointers,
802 const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
803 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
819 #define XPETRA_CRSGRAPHFACTORY_SHORT
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type &lclGraph, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Constructor specifying column Map and a local (sorted) graph, which the resulting CrsGraph views...
Kokkos::StaticCrsGraph< LocalOrdinal, Kokkos::LayoutLeft, device_type, void, size_t > local_graph_type
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type::row_map_type &rowPointers, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type::entries_type::non_const_type &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and arrays containing the graph in sorted, local ids...
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type::row_map_type &rowPointers, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type::entries_type::non_const_type &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and arrays containing the graph in sorted, local ids...
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node >> &sourceGraph, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &domainMap=Teuchos::null, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rangeMap=Teuchos::null, const RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor using fused import.
#define XPETRA_FACTORY_ERROR_IF_EPETRA(lib)
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries in each row.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node >> &sourceGraph, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &domainMap=Teuchos::null, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rangeMap=Teuchos::null, const RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor using fused import.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type::row_map_type &rowPointers, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type::entries_type::non_const_type &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and arrays containing the graph in sorted, local ids...
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
static RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap)
Constructor for empty graph (intended use is an import/export target - can't insert entries directly)...
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &map, size_t maxNumEntriesPerRow)
Constructor specifying the number of non-zeros for all rows.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type &lclGraph, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying column, domain and range maps, and a local (sorted) graph, which the resulting...
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap)
Constructor for empty graph (intended use is an import/export target - can't insert entries directly)...
#define XPETRA_FACTORY_END
static RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &map, size_t maxNumEntriesPerRow)
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type &lclGraph, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Constructor specifying column Map and a local (sorted) graph, which the resulting CrsGraph views...
static RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap)
Constructor for empty graph (intended use is an import/export target - can't insert entries directly)...
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const Teuchos::ArrayRCP< size_t > &rowPointers, const Teuchos::ArrayRCP< LocalOrdinal > &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and arrays containing the graph in sorted, local ids...
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries per row.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries per row.
CrsGraphFactory()
Private constructor. This is a static class.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type &lclGraph, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying column, domain and range maps, and a local (sorted) graph, which the resulting...
static RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &map, size_t maxNumEntriesPerRow)
#define XPETRA_MONITOR(funcName)
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const Teuchos::ArrayRCP< size_t > &rowPointers, const Teuchos::ArrayRCP< LocalOrdinal > &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and arrays containing the graph in sorted, local ids...
CrsGraphFactory()
Private constructor. This is a static class.
CrsGraphFactory()
Private constructor. This is a static class.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node >> &sourceGraph, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &domainMap=Teuchos::null, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rangeMap=Teuchos::null, const RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor using fused import.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type &lclGraph, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying column, domain and range maps, and a local (sorted) graph, which the resulting...
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries per row.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type &lclGraph, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Constructor specifying column Map and a local (sorted) graph, which the resulting CrsGraph views...
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &colMap, const Teuchos::ArrayRCP< size_t > &rowPointers, const Teuchos::ArrayRCP< LocalOrdinal > &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and arrays containing the graph in sorted, local ids...