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,
75 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
78 TEUCHOS_TEST_FOR_EXCEPTION(rowMap->lib() ==
UseEpetra, std::logic_error,
79 "Can't create Xpetra::EpetraCrsMatrix with these scalar/LO/GO types");
80 #ifdef HAVE_XPETRA_TPETRA
89 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
93 #ifdef HAVE_XPETRA_TPETRA
100 TEUCHOS_UNREACHABLE_RETURN(null);
104 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
107 const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc,
108 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
111 #ifdef HAVE_XPETRA_TPETRA
118 TEUCHOS_UNREACHABLE_RETURN(null);
121 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
122 #ifdef HAVE_XPETRA_TPETRA
123 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
147 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
178 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
179 Build(
const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& rowMap,
180 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& colMap,
182 const Teuchos::RCP<Teuchos::ParameterList>& params) {
186 return rcp(
new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap,
218 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
220 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& rowMap,
221 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& colMap,
222 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap = Teuchos::null,
223 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap = Teuchos::null,
224 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
228 return rcp(
new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(lclGraph,
243 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES))
258 static RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
262 #ifdef HAVE_XPETRA_TPETRA
266 #ifdef HAVE_XPETRA_EPETRA
273 static RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
277 #ifdef HAVE_XPETRA_TPETRA
286 TEUCHOS_UNREACHABLE_RETURN(null);
289 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
293 #ifdef HAVE_XPETRA_TPETRA
302 TEUCHOS_UNREACHABLE_RETURN(null);
305 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
306 #ifdef HAVE_XPETRA_TPETRA
307 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
331 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
362 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
363 Build(
const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& rowMap,
364 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& colMap,
366 const Teuchos::RCP<Teuchos::ParameterList>& params) {
370 return rcp(
new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap,
402 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
404 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& rowMap,
405 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& colMap,
406 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap = Teuchos::null,
407 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap = Teuchos::null,
408 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
412 return rcp(
new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(lclGraph,
428 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES))
443 static RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
447 #ifdef HAVE_XPETRA_TPETRA
451 #ifdef HAVE_XPETRA_EPETRA
458 static RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
462 #ifdef HAVE_XPETRA_TPETRA
471 TEUCHOS_UNREACHABLE_RETURN(null);
474 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
478 #ifdef HAVE_XPETRA_TPETRA
487 TEUCHOS_UNREACHABLE_RETURN(null);
490 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
491 #ifdef HAVE_XPETRA_TPETRA
492 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
516 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
547 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
548 Build(
const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& rowMap,
549 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& colMap,
551 const Teuchos::RCP<Teuchos::ParameterList>& params) {
555 return rcp(
new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap,
587 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
589 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& rowMap,
590 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& colMap,
591 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap = Teuchos::null,
592 const Teuchos::RCP<
const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap = Teuchos::null,
593 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
597 return rcp(
new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(lclGraph,
613 #define XPETRA_CRSGRAPHFACTORY_SHORT
static RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t maxNumEntriesPerRow)
#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)
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 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap)
Constructor for empty graph (intended use is an import/export target - can't insert entries directly)...
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 > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
#define XPETRA_FACTORY_END
static RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t maxNumEntriesPerRow)
CrsGraphFactory()
Private constructor. This is a static class.
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.
#define XPETRA_MONITOR(funcName)
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.
CrsGraphFactory()
Private constructor. This is a static class.
CrsGraphFactory()
Private constructor. This is a static class.