Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_StridedMapFactory_decl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Xpetra: A linear algebra interface package
4 //
5 // Copyright 2012 NTESS and the Xpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef XPETRA_STRIDEDMAPFACTORY_DECL_HPP
11 #define XPETRA_STRIDEDMAPFACTORY_DECL_HPP
12 
13 #include <Tpetra_KokkosCompat_DefaultNode.hpp>
14 
15 #include "Xpetra_ConfigDefs.hpp"
16 
18 
19 namespace Xpetra {
20 
29 template <class LocalOrdinal,
30  class GlobalOrdinal,
31  class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
33 #undef XPETRA_STRIDEDMAPFACTORY_SHORT
35 
36  private:
38  StridedMapFactory() = delete;
39 
40  public:
42  static RCP<Xpetra::StridedMap<LocalOrdinal, GlobalOrdinal, Node>>
43  Build(UnderlyingLib lib,
44  global_size_t numGlobalElements,
45  GlobalOrdinal indexBase,
46  std::vector<size_t>& stridingInfo,
47  const Teuchos::RCP<const Teuchos::Comm<int>>& comm,
48  LocalOrdinal stridedBlockId = -1,
49  GlobalOrdinal offset = 0,
51 
53  static RCP<StridedMap>
54  Build(UnderlyingLib lib,
55  global_size_t numGlobalElements,
56  size_t numLocalElements,
57  GlobalOrdinal indexBase,
58  std::vector<size_t>& stridingInfo,
59  const Teuchos::RCP<const Teuchos::Comm<int>>& comm,
60  LocalOrdinal stridedBlockId = -1,
61  GlobalOrdinal offset = 0);
62 
64  static RCP<StridedMap>
65  Build(const RCP<const Map>& map, std::vector<size_t>& stridingInfo, LocalOrdinal stridedBlockId = -1, GlobalOrdinal offset = 0);
66 
68  static RCP<StridedMap>
69  Build(const RCP<const StridedMap>& map, LocalOrdinal stridedBlockId);
70 
72  static RCP<StridedMap>
73  Build(const StridedMap& map);
74 
80  static RCP<StridedMap>
81  Build(UnderlyingLib lib,
82  global_size_t numGlobalElements,
83  const Teuchos::ArrayView<const GlobalOrdinal>& elementList,
84  GlobalOrdinal indexBase,
85  std::vector<size_t>& stridingInfo,
86  const Teuchos::RCP<const Teuchos::Comm<int>>& comm,
87  LocalOrdinal stridedBlockId = -1, // FIXME (mfh 03 Sep 2014) This breaks if LocalOrdinal is unsigned
88  GlobalOrdinal /* offset */ = 0);
89 
90 }; // class StridedMapFactory
91 
92 } // namespace Xpetra
93 
94 #define XPETRA_STRIDEDMAPFACTORY_SHORT
95 #endif // XPETRA_STRIDEDMAPFACTORY_DECL_HPP
96 
97 // TODO: removed unused methods
This factory creates a Xpetra::StridedMap .
StridedMapFactory()=delete
Private constructor. This is a static class.
size_t global_size_t
Global size_t object.
static RCP< Xpetra::StridedMap< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, GlobalOrdinal indexBase, std::vector< size_t > &stridingInfo, const Teuchos::RCP< const Teuchos::Comm< int >> &comm, LocalOrdinal stridedBlockId=-1, GlobalOrdinal offset=0, LocalGlobal lg=Xpetra::GloballyDistributed)
Map constructor with Xpetra-defined contiguous uniform distribution.
Class that stores a strided map.