10 #ifndef XPETRA_CRSGRAPHFACTORY_HPP
11 #define XPETRA_CRSGRAPHFACTORY_HPP
17 #ifdef HAVE_XPETRA_TPETRA
18 #include "Xpetra_TpetraCrsGraph.hpp"
21 #ifdef HAVE_XPETRA_EPETRA
29 template <
class LocalOrdinal,
31 class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
39 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
41 TEUCHOS_TEST_FOR_EXCEPTION(rowMap->lib() ==
UseEpetra, std::logic_error,
42 "Can't create Xpetra::EpetraCrsMatrix with these scalar/LO/GO types");
43 #ifdef HAVE_XPETRA_TPETRA
52 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
56 #ifdef HAVE_XPETRA_TPETRA
63 TEUCHOS_UNREACHABLE_RETURN(null);
67 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
70 size_t maxNumEntriesPerRow,
71 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
74 #ifdef HAVE_XPETRA_TPETRA
81 TEUCHOS_UNREACHABLE_RETURN(null);
85 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
88 const ArrayRCP<const size_t>& NumEntriesPerRowToAlloc,
89 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
92 #ifdef HAVE_XPETRA_TPETRA
99 TEUCHOS_UNREACHABLE_RETURN(null);
103 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
108 const RCP<Teuchos::ParameterList>& params = Teuchos::null) {
109 #ifdef HAVE_XPETRA_TPETRA
110 if (sourceGraph->getRowMap()->lib() ==
UseTpetra)
116 TEUCHOS_UNREACHABLE_RETURN(null);
119 #ifdef HAVE_XPETRA_TPETRA
120 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
144 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
175 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
179 const Teuchos::RCP<Teuchos::ParameterList>& params) {
215 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
221 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
255 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
258 const Teuchos::ArrayRCP<size_t>& rowPointers,
259 const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
260 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
275 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES))
289 static RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
292 #ifdef HAVE_XPETRA_TPETRA
296 #ifdef HAVE_XPETRA_EPETRA
303 static RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
307 #ifdef HAVE_XPETRA_TPETRA
316 TEUCHOS_UNREACHABLE_RETURN(null);
319 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
323 #ifdef HAVE_XPETRA_TPETRA
332 TEUCHOS_UNREACHABLE_RETURN(null);
336 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
339 size_t maxNumEntriesPerRow,
340 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
343 #ifdef HAVE_XPETRA_TPETRA
351 TEUCHOS_UNREACHABLE_RETURN(null);
355 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
360 const RCP<Teuchos::ParameterList>& params = Teuchos::null) {
361 #ifdef HAVE_XPETRA_TPETRA
362 if (sourceGraph->getRowMap()->lib() ==
UseTpetra)
365 if (sourceGraph->getRowMap()->lib() ==
UseEpetra)
369 TEUCHOS_UNREACHABLE_RETURN(null);
372 #ifdef HAVE_XPETRA_TPETRA
373 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
397 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
428 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
432 const Teuchos::RCP<Teuchos::ParameterList>& params) {
468 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
474 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
508 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
511 const Teuchos::ArrayRCP<size_t>& rowPointers,
512 const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
513 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
529 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES))
543 static RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
546 #ifdef HAVE_XPETRA_TPETRA
550 #ifdef HAVE_XPETRA_EPETRA
557 static RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
561 #ifdef HAVE_XPETRA_TPETRA
570 TEUCHOS_UNREACHABLE_RETURN(null);
573 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
577 #ifdef HAVE_XPETRA_TPETRA
586 TEUCHOS_UNREACHABLE_RETURN(null);
590 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
593 size_t maxNumEntriesPerRow,
594 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
597 #ifdef HAVE_XPETRA_TPETRA
605 TEUCHOS_UNREACHABLE_RETURN(null);
609 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
614 const RCP<Teuchos::ParameterList>& params = Teuchos::null) {
615 #ifdef HAVE_XPETRA_TPETRA
616 if (sourceGraph->getRowMap()->lib() ==
UseTpetra)
619 if (sourceGraph->getRowMap()->lib() ==
UseTpetra)
623 TEUCHOS_UNREACHABLE_RETURN(null);
626 #ifdef HAVE_XPETRA_TPETRA
627 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
651 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
682 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
686 const Teuchos::RCP<Teuchos::ParameterList>& params) {
722 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
728 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
762 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
765 const Teuchos::ArrayRCP<size_t>& rowPointers,
766 const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
767 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null) {
783 #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...