46 #ifndef XPETRA_CRSMATRIXFACTORY_HPP 47 #define XPETRA_CRSMATRIXFACTORY_HPP 53 #ifdef HAVE_XPETRA_TPETRA 57 #ifdef HAVE_XPETRA_EPETRA 65 template <
class Scalar ,
81 size_t maxNumEntriesPerRow,
87 #ifdef HAVE_XPETRA_TPETRA 103 #ifdef HAVE_XPETRA_TPETRA 116 size_t maxNumEntriesPerRow,
122 #ifdef HAVE_XPETRA_TPETRA 132 static RCP<CrsMatrix<Scalar, 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,
ProfileType pftype=
DynamicProfile,
const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
135 #ifdef HAVE_XPETRA_TPETRA 148 #ifdef HAVE_XPETRA_TPETRA 149 if (graph->getRowMap()->lib() ==
UseTpetra)
158 static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
Build(
const Teuchos::RCP<
const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
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 Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
161 #ifdef HAVE_XPETRA_TPETRA 162 if (sourceMatrix->getRowMap()->lib() ==
UseTpetra)
170 static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
Build(
const Teuchos::RCP<
const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
const Export<LocalOrdinal,GlobalOrdinal,Node> &exporter,
const RCP<
Map<LocalOrdinal,GlobalOrdinal,Scalar> > & domainMap = Teuchos::null,
const RCP<
Map<LocalOrdinal,GlobalOrdinal,Scalar> > & rangeMap = Teuchos::null,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
173 #ifdef HAVE_XPETRA_TPETRA 174 if (sourceMatrix->getRowMap()->lib() ==
UseTpetra)
182 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 190 #ifdef HAVE_XPETRA_TPETRA 203 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES)) 223 #ifdef HAVE_XPETRA_TPETRA 237 #ifdef HAVE_XPETRA_TPETRA 249 static RCP<CrsMatrix<Scalar, 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,
ProfileType pftype=
DynamicProfile,
const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
252 #ifdef HAVE_XPETRA_TPETRA 264 static RCP<CrsMatrix<Scalar, 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,
ProfileType pftype=
DynamicProfile,
const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
267 #ifdef HAVE_XPETRA_TPETRA 282 #ifdef HAVE_XPETRA_TPETRA 283 if (graph->getRowMap()->lib() ==
UseTpetra)
287 if (graph->getRowMap()->lib() ==
UseEpetra)
295 static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
Build(
const Teuchos::RCP<
const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
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 Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
298 #ifdef HAVE_XPETRA_TPETRA 299 if (sourceMatrix->getRowMap()->lib() ==
UseTpetra)
303 if (sourceMatrix->getRowMap()->lib() ==
UseEpetra)
310 static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
Build(
const Teuchos::RCP<
const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
const Export<LocalOrdinal,GlobalOrdinal,Node> &exporter,
const RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap = Teuchos::null,
const RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap = Teuchos::null,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
313 #ifdef HAVE_XPETRA_TPETRA 314 if (sourceMatrix->getRowMap()->lib() ==
UseTpetra)
318 if (sourceMatrix->getRowMap()->lib() ==
UseEpetra)
324 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 332 #ifdef HAVE_XPETRA_TPETRA 348 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES)) 366 #ifdef HAVE_XPETRA_TPETRA 380 #ifdef HAVE_XPETRA_TPETRA 392 static RCP<CrsMatrix<Scalar, 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,
ProfileType pftype=
DynamicProfile,
const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
395 #ifdef HAVE_XPETRA_TPETRA 407 static RCP<CrsMatrix<Scalar, 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,
ProfileType pftype=
DynamicProfile,
const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
410 #ifdef HAVE_XPETRA_TPETRA 425 #ifdef HAVE_XPETRA_TPETRA 426 if (graph->getRowMap()->lib() ==
UseTpetra)
430 if (graph->getRowMap()->lib() ==
UseEpetra)
438 static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
Build(
const Teuchos::RCP<
const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
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 Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
441 #ifdef HAVE_XPETRA_TPETRA 442 if (sourceMatrix->getRowMap()->lib() ==
UseTpetra)
446 if (sourceMatrix->getRowMap()->lib() ==
UseEpetra)
453 static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
Build(
const Teuchos::RCP<
const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
const Export<LocalOrdinal,GlobalOrdinal,Node> &exporter,
const RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap = Teuchos::null,
const RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap = Teuchos::null,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
456 #ifdef HAVE_XPETRA_TPETRA 457 if (sourceMatrix->getRowMap()->lib() ==
UseTpetra)
461 if (sourceMatrix->getRowMap()->lib() ==
UseEpetra)
467 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 475 #ifdef HAVE_XPETRA_TPETRA 491 #define XPETRA_CRSMATRIXFACTORY_SHORT
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor using FusedExport.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, 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 Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype=Xpetra::DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying fixed number of entries for each row.
static RCP< CrsMatrix< Scalar, 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, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, 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 Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor using FusedImport.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=Xpetra::DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
#define XPETRA_FACTORY_ERROR_IF_EPETRA(lib)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=Xpetra::DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying a previously constructed graph.
CrsMatrixFactory()
Private constructor. This is a static class.
CrsMatrixFactory()
Private constructor. This is a static class.
static RCP< CrsMatrix< Scalar, 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, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row.
CrsMatrixFactory()
Private constructor. This is a static class.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying a previously constructed graph.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const RCP< Map< LocalOrdinal, GlobalOrdinal, Scalar > > &domainMap=Teuchos::null, const RCP< Map< LocalOrdinal, GlobalOrdinal, Scalar > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype=Xpetra::DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
static RCP< CrsMatrix< Scalar, 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, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries in each row.
#define XPETRA_FACTORY_END
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, 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 Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor using FusedImport.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying a previously constructed graph.
static RCP< CrsMatrix< Scalar, 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, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries in each row.
static RCP< CrsMatrix< Scalar, 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, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries in each row.
#define XPETRA_MONITOR(funcName)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor using FusedExport.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype=Xpetra::DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
static RCP< CrsMatrix< Scalar, 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, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=Xpetra::DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying (possibly different) number of entries in each row.