Tpetra parallel linear algebra  Version of the Day
Tpetra_CrsGraph_decl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Tpetra: Templated Linear Algebra Services Package
5 // Copyright (2008) Sandia Corporation
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the U.S. Government retains certain rights in this software.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // ************************************************************************
38 // @HEADER
39 
40 #ifndef TPETRA_CRSGRAPH_DECL_HPP
41 #define TPETRA_CRSGRAPH_DECL_HPP
42 
50 
51 #include "Tpetra_CrsGraph_fwd.hpp"
52 #include "Tpetra_CrsMatrix_fwd.hpp"
54 #include "Tpetra_DistObject.hpp"
55 #include "Tpetra_Exceptions.hpp"
56 #include "Tpetra_RowGraph.hpp"
57 #include "Tpetra_Util.hpp" // need this here for sort2
58 
59 #include "KokkosSparse_findRelOffset.hpp"
60 #include "Kokkos_DualView.hpp"
61 #include "Kokkos_StaticCrsGraph.hpp"
62 #include "Kokkos_UnorderedMap.hpp"
63 
64 #include "Teuchos_CommHelpers.hpp"
65 #include "Teuchos_Describable.hpp"
66 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp"
67 
68 #include <functional> // std::function
69 
70 namespace Tpetra {
71 
72 
73  // Forward declaration for CrsGraph::swap() test
74  template<class LocalOrdinal, class GlobalOrdinal, class Node> class crsGraph_Swap_Tester;
75 
76 #ifndef DOXYGEN_SHOULD_SKIP_THIS
77  namespace Details {
78 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
79  // Forward declaration of an implementation detail of CrsGraph::clone.
80  template<class OutputCrsGraphType, class InputCrsGraphType>
81  class CrsGraphCopier {
82  public:
83  static Teuchos::RCP<OutputCrsGraphType>
84  clone (const InputCrsGraphType& graphIn,
85  const Teuchos::RCP<typename OutputCrsGraphType::node_type> nodeOut,
86  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
87  }; // class CrsGraphCopier
88 #endif // TPETRA_ENABLE_DEPRECATED_CODE
89 
90  template<class LO, class GO, class NT>
91  void
93  CrsGraph<LO, GO, NT>& graph,
94  const Teuchos::ArrayView<const typename CrsGraph<LO,GO,NT>::packet_type>& imports,
95  const Teuchos::ArrayView<const size_t>& numPacketsPerLID,
96  const Teuchos::ArrayView<const LO>& importLIDs,
97  size_t constantNumPackets,
98  Distributor & distor,
99  CombineMode combineMode);
100  } // namespace Details
101 
102  namespace { // (anonymous)
103 
104  template<class ViewType>
105  struct UnmanagedView {
106  static_assert (Kokkos::is_view<ViewType>::value,
107  "ViewType must be a Kokkos::View specialization.");
108  // FIXME (mfh 02 Dec 2015) Right now, this strips away other
109  // memory traits. Christian will add an "AllTraits" enum which is
110  // the enum value of MemoryTraits<T>, that will help us fix this.
111  typedef Kokkos::View<typename ViewType::data_type,
112  typename ViewType::array_layout,
113  typename ViewType::device_type,
114  Kokkos::MemoryUnmanaged> type;
115  };
116 
117  } // namespace (anonymous)
118 #endif // DOXYGEN_SHOULD_SKIP_THIS
119 
128  struct RowInfo {
129  size_t localRow;
130  size_t allocSize;
131  size_t numEntries;
132  size_t offset1D;
133  };
134 
135  enum ELocalGlobal {
136  LocalIndices,
137  GlobalIndices
138  };
139 
140  namespace Details {
181  STORAGE_2D, //<! 2-D storage
182  STORAGE_1D_UNPACKED, //<! 1-D "unpacked" storage
183  STORAGE_1D_PACKED, //<! 1-D "packed" storage
184  STORAGE_UB //<! Invalid value; upper bound on enum values
185  };
186 
187 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
188  class HasDeprecatedMethods2630_WarningThisClassIsNotForUsers {
197  public:
198  virtual ~HasDeprecatedMethods2630_WarningThisClassIsNotForUsers () = default;
199  virtual bool isLowerTriangularImpl () const = 0;
200  virtual bool isUpperTriangularImpl () const = 0;
201  virtual size_t getGlobalNumDiagsImpl () const = 0;
202  virtual global_size_t getNodeNumDiagsImpl () const = 0;
203  }; // class HasDeprecatedMethods2630_WarningThisClassIsNotForUsers
204 #endif // TPETRA_ENABLE_DEPRECATED_CODE
205  } // namespace Details
206 
265  template <class LocalOrdinal,
266  class GlobalOrdinal,
267  class Node>
268  class CrsGraph :
269  public RowGraph<LocalOrdinal, GlobalOrdinal, Node>,
270  public DistObject<GlobalOrdinal,
271  LocalOrdinal,
272  GlobalOrdinal,
273  Node>,
274  public Teuchos::ParameterListAcceptorDefaultBase
275 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
276  , public ::Tpetra::Details::HasDeprecatedMethods2630_WarningThisClassIsNotForUsers
277 #endif // TPETRA_ENABLE_DEPRECATED_CODE
278  {
279  template <class S, class LO, class GO, class N>
280  friend class CrsMatrix;
281  template <class LO2, class GO2, class N2>
282  friend class CrsGraph;
283  template <class LO, class GO, class N>
284  friend class FECrsGraph;
285 
288 
289  public:
291  using local_ordinal_type = LocalOrdinal;
293  using global_ordinal_type = GlobalOrdinal;
295  using device_type = typename Node::device_type;
297  using execution_space = typename device_type::execution_space;
298 
303  using node_type = Node;
304 
306  using local_graph_type = Kokkos::StaticCrsGraph<local_ordinal_type,
307  Kokkos::LayoutLeft,
309 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
310  typedef local_graph_type LocalStaticCrsGraphType TPETRA_DEPRECATED;
313  typedef typename local_graph_type::row_map_type t_RowPtrs TPETRA_DEPRECATED;
315  typedef typename local_graph_type::row_map_type::non_const_type t_RowPtrsNC TPETRA_DEPRECATED;
317  typedef typename local_graph_type::entries_type::non_const_type t_LocalOrdinal_1D TPETRA_DEPRECATED;
318 #endif // TPETRA_ENABLE_DEPRECATED_CODE
319 
326 
328 
329 
348  CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
349  const size_t maxNumEntriesPerRow,
350  const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
351  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
352 
370  CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
371  const Kokkos::DualView<const size_t*, execution_space>& numEntPerRow,
372  const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
373  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
374 
393  CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
394  const Teuchos::ArrayView<const size_t>& numEntPerRow,
395  const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
396  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
397 
398 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
399  TPETRA_DEPRECATED
401  CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
402  const Teuchos::ArrayRCP<const size_t>& numEntPerRow,
403  const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
404  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
405 #endif // TPETRA_ENABLE_DEPRECATED_CODE
406 
428  CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
429  const Teuchos::RCP<const map_type>& colMap,
430  const size_t maxNumEntriesPerRow,
431  const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
432  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
433 
452  CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
453  const Teuchos::RCP<const map_type>& colMap,
454  const Kokkos::DualView<const size_t*, execution_space>& numEntPerRow,
455  const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
456  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
457 
477  CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
478  const Teuchos::RCP<const map_type>& colMap,
479  const Teuchos::ArrayView<const size_t>& numEntPerRow,
480  const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
481  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
482 
483 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
484  TPETRA_DEPRECATED
486  CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
487  const Teuchos::RCP<const map_type>& colMap,
488  const Teuchos::ArrayRCP<const size_t>& numEntPerRow,
489  const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
490  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
491 #endif // TPETRA_ENABLE_DEPRECATED_CODE
492 
513  CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
514  const Teuchos::RCP<const map_type>& colMap,
515  const typename local_graph_type::row_map_type& rowPointers,
516  const typename local_graph_type::entries_type::non_const_type& columnIndices,
517  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
518 
539  CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
540  const Teuchos::RCP<const map_type>& colMap,
541  const Teuchos::ArrayRCP<size_t>& rowPointers,
542  const Teuchos::ArrayRCP<local_ordinal_type>& columnIndices,
543  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
544 
563  CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
564  const Teuchos::RCP<const map_type>& colMap,
565  const local_graph_type& lclGraph,
566  const Teuchos::RCP<Teuchos::ParameterList>& params);
567 
592  CrsGraph (const local_graph_type& lclGraph,
593  const Teuchos::RCP<const map_type>& rowMap,
594  const Teuchos::RCP<const map_type>& colMap,
595  const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
596  const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
597  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
598 
600  CrsGraph (const local_graph_type& lclGraph,
601  const Teuchos::RCP<const map_type>& rowMap,
602  const Teuchos::RCP<const map_type>& colMap,
603  const Teuchos::RCP<const map_type>& domainMap,
604  const Teuchos::RCP<const map_type>& rangeMap,
605  const Teuchos::RCP<const import_type>& importer,
606  const Teuchos::RCP<const export_type>& exporter,
607  const Teuchos::RCP<Teuchos::ParameterList>& params =
608  Teuchos::null);
609 
612 
615 
618 
621 
631  virtual ~CrsGraph () = default;
632 
660 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
661  template<class Node2>
662  Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node2> > TPETRA_DEPRECATED
663  clone (const Teuchos::RCP<Node2>& node2,
664  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) const
665  {
666  typedef CrsGraph<local_ordinal_type, global_ordinal_type, Node2> output_crs_graph_type;
668  typedef ::Tpetra::Details::CrsGraphCopier<output_crs_graph_type, input_crs_graph_type> copier_type;
669  return copier_type::clone (*this, node2, params);
670  }
671 #endif
672 
690 
692 
694 
696  void
697  setParameterList (const Teuchos::RCP<Teuchos::ParameterList>& params) override;
698 
700  Teuchos::RCP<const Teuchos::ParameterList>
701  getValidParameters () const override;
702 
704 
706 
728  void
729  insertGlobalIndices (const global_ordinal_type globalRow,
730  const Teuchos::ArrayView<const global_ordinal_type>& indices);
731 
738  void
739  insertGlobalIndices (const global_ordinal_type globalRow,
740  const local_ordinal_type numEnt,
741  const global_ordinal_type inds[]);
742 
744 
758  void
759  insertLocalIndices (const local_ordinal_type localRow,
760  const Teuchos::ArrayView<const local_ordinal_type>& indices);
761 
768  void
769  insertLocalIndices (const local_ordinal_type localRow,
770  const local_ordinal_type numEnt,
771  const local_ordinal_type inds[]);
772 
774 
783  void removeLocalIndices (local_ordinal_type localRow);
784 
786 
788 
796  void globalAssemble ();
797 
816  void
817  resumeFill (const Teuchos::RCP<Teuchos::ParameterList>& params =
818  Teuchos::null);
819 
857  void
858  fillComplete (const Teuchos::RCP<const map_type>& domainMap,
859  const Teuchos::RCP<const map_type>& rangeMap,
860  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
861 
889  void
890  fillComplete (const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
891 
920  void
921  expertStaticFillComplete (const Teuchos::RCP<const map_type>& domainMap,
922  const Teuchos::RCP<const map_type>& rangeMap,
923  const Teuchos::RCP<const import_type>& importer =
924  Teuchos::null,
925  const Teuchos::RCP<const export_type>& exporter =
926  Teuchos::null,
927  const Teuchos::RCP<Teuchos::ParameterList>& params =
928  Teuchos::null);
930 
932 
934  Teuchos::RCP<const Teuchos::Comm<int> > getComm() const override;
935 
936 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
937  TPETRA_DEPRECATED Teuchos::RCP<node_type> getNode() const override;
939 #endif // TPETRA_ENABLE_DEPRECATED_CODE
940 
942  Teuchos::RCP<const map_type> getRowMap () const override;
943 
945  Teuchos::RCP<const map_type> getColMap () const override;
946 
948  Teuchos::RCP<const map_type> getDomainMap () const override;
949 
951  Teuchos::RCP<const map_type> getRangeMap () const override;
952 
954  Teuchos::RCP<const import_type> getImporter () const override;
955 
957  Teuchos::RCP<const export_type> getExporter () const override;
958 
960 
962  global_size_t getGlobalNumRows() const override;
963 
965 
968  global_size_t getGlobalNumCols () const override;
969 
971  size_t getNodeNumRows () const override;
972 
974 
976  size_t getNodeNumCols () const override;
977 
979  global_ordinal_type getIndexBase () const override;
980 
982 
984  global_size_t getGlobalNumEntries () const override;
985 
995  size_t getNodeNumEntries() const override;
996 
998 
999  size_t
1000  getNumEntriesInGlobalRow (global_ordinal_type globalRow) const override;
1001 
1008  size_t
1009  getNumEntriesInLocalRow (local_ordinal_type localRow) const override;
1010 
1030  size_t getNodeAllocationSize () const;
1031 
1039  size_t getNumAllocatedEntriesInGlobalRow (global_ordinal_type globalRow) const;
1040 
1048  size_t getNumAllocatedEntriesInLocalRow (local_ordinal_type localRow) const;
1049 
1063  size_t getGlobalMaxNumRowEntries () const override;
1064 
1069  size_t getNodeMaxNumRowEntries () const override;
1070 
1086  bool hasColMap () const override;
1087 
1088 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
1089  global_size_t TPETRA_DEPRECATED getGlobalNumDiags () const override;
1097 
1104  size_t TPETRA_DEPRECATED getNodeNumDiags () const override;
1105 
1117  global_size_t getGlobalNumDiagsImpl () const override;
1118 
1130  size_t getNodeNumDiagsImpl () const override;
1131 
1142  bool TPETRA_DEPRECATED isLowerTriangular () const override;
1143 
1154  bool TPETRA_DEPRECATED isUpperTriangular () const override;
1155 
1167  bool isLowerTriangularImpl () const override;
1168 
1180  bool isUpperTriangularImpl () const override;
1181 #endif // TPETRA_ENABLE_DEPRECATED_CODE
1182 
1190  bool isLocallyIndexed () const override;
1191 
1199  bool isGloballyIndexed () const override;
1200 
1202  bool isFillComplete () const override;
1203 
1205  bool isFillActive () const;
1206 
1214  bool isSorted () const;
1215 
1217 
1223  bool isStorageOptimized () const;
1224 
1226  ProfileType getProfileType () const;
1227 
1233  void
1235  const Teuchos::ArrayView<global_ordinal_type>& gblColInds,
1236  size_t& numColInds) const override;
1237 
1245  void
1247  const Teuchos::ArrayView<local_ordinal_type>& lclColInds,
1248  size_t& numColInds) const override;
1249 
1260  void
1261  getGlobalRowView (const global_ordinal_type gblRow,
1262  Teuchos::ArrayView<const global_ordinal_type>& gblColInds) const override;
1263 
1266  bool supportsRowViews () const override;
1267 
1278  void
1279  getLocalRowView (const local_ordinal_type lclRow,
1280  Teuchos::ArrayView<const local_ordinal_type>& lclColInds) const override;
1281 
1283 
1285 
1287  std::string description () const override;
1288 
1291  void
1292  describe (Teuchos::FancyOStream& out,
1293  const Teuchos::EVerbosityLevel verbLevel =
1294  Teuchos::Describable::verbLevel_default) const override;
1295 
1297 
1299 
1307 
1308  virtual bool
1309  checkSizes (const SrcDistObject& source) override;
1310 
1311  virtual void
1312 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
1313  copyAndPermuteNew
1314 #else // TPETRA_ENABLE_DEPRECATED_CODE
1315  copyAndPermute
1316 #endif // TPETRA_ENABLE_DEPRECATED_CODE
1317  (const SrcDistObject& source,
1318  const size_t numSameIDs,
1319  const Kokkos::DualView<const local_ordinal_type*,
1320  buffer_device_type>& permuteToLIDs,
1321  const Kokkos::DualView<const local_ordinal_type*,
1322  buffer_device_type>& permuteFromLIDs) override;
1323 
1324  void
1325  applyCrsPadding (const Kokkos::UnorderedMap<local_ordinal_type, size_t, device_type>& padding);
1326 
1327  Kokkos::UnorderedMap<local_ordinal_type, size_t, device_type>
1328  computeCrsPadding (const RowGraph<local_ordinal_type, global_ordinal_type, node_type>& source,
1329  const size_t numSameIDs,
1330  const Kokkos::DualView<const local_ordinal_type*, buffer_device_type>& permuteToLIDs,
1331  const Kokkos::DualView<const local_ordinal_type*, buffer_device_type>& permuteFromLIDs) const;
1332 
1333  Kokkos::UnorderedMap<local_ordinal_type, size_t, device_type>
1334  computeCrsPadding (const Kokkos::DualView<const local_ordinal_type*, buffer_device_type>& importLIDs,
1335  Kokkos::DualView<size_t*, buffer_device_type> numPacketsPerLID) const;
1336 
1337  void
1338  computeCrsPaddingForSameIDs (Kokkos::UnorderedMap<local_ordinal_type, size_t, device_type>& padding,
1340  const size_t numSameIDs,
1341  const bool padAll) const;
1342  void
1343  computeCrsPaddingForPermutedIDs (Kokkos::UnorderedMap<local_ordinal_type, size_t, device_type>& padding,
1345  const Kokkos::DualView<const local_ordinal_type*, buffer_device_type>& permuteToLIDs,
1346  const Kokkos::DualView<const local_ordinal_type*, buffer_device_type>& permuteFromLIDs,
1347  const bool padAll) const;
1348 
1349  virtual void
1350 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
1351  packAndPrepareNew
1352 #else // TPETRA_ENABLE_DEPRECATED_CODE
1353  packAndPrepare
1354 #endif // TPETRA_ENABLE_DEPRECATED_CODE
1355  (const SrcDistObject& source,
1356  const Kokkos::DualView<const local_ordinal_type*,
1357  buffer_device_type>& exportLIDs,
1358  Kokkos::DualView<packet_type*,
1359  buffer_device_type>& exports,
1360  Kokkos::DualView<size_t*,
1361  buffer_device_type> numPacketsPerLID,
1362  size_t& constantNumPackets,
1363  Distributor& distor) override;
1364 
1365  virtual void
1366  pack (const Teuchos::ArrayView<const local_ordinal_type>& exportLIDs,
1367  Teuchos::Array<global_ordinal_type>& exports,
1368  const Teuchos::ArrayView<size_t>& numPacketsPerLID,
1369  size_t& constantNumPackets,
1370  Distributor& distor) const override;
1371 
1372  void
1373  packFillActive (const Teuchos::ArrayView<const local_ordinal_type>& exportLIDs,
1374  Teuchos::Array<global_ordinal_type>& exports,
1375  const Teuchos::ArrayView<size_t>& numPacketsPerLID,
1376  size_t& constantNumPackets,
1377  Distributor& distor) const;
1378 
1379  void
1380  packFillActiveNew (const Kokkos::DualView<const local_ordinal_type*,
1381  buffer_device_type>& exportLIDs,
1382  Kokkos::DualView<packet_type*,
1383  buffer_device_type>& exports,
1384  Kokkos::DualView<size_t*,
1385  buffer_device_type> numPacketsPerLID,
1386  size_t& constantNumPackets,
1387  Distributor& distor) const;
1388 
1389  virtual void
1390 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
1391  unpackAndCombineNew
1392 #else // TPETRA_ENABLE_DEPRECATED_CODE
1393  unpackAndCombine
1394 #endif // TPETRA_ENABLE_DEPRECATED_CODE
1395  (const Kokkos::DualView<const local_ordinal_type*,
1396  buffer_device_type>& importLIDs,
1397  Kokkos::DualView<packet_type*,
1398  buffer_device_type> imports,
1399  Kokkos::DualView<size_t*,
1400  buffer_device_type> numPacketsPerLID,
1401  const size_t constantNumPackets,
1402  Distributor& distor,
1403  const CombineMode combineMode) override;
1404 
1406 
1408 
1451  void
1452  getLocalDiagOffsets (const Kokkos::View<size_t*, device_type, Kokkos::MemoryUnmanaged>& offsets) const;
1453 
1463  void
1464  getLocalDiagOffsets (Teuchos::ArrayRCP<size_t>& offsets) const;
1465 
1488  void
1489  getNumEntriesPerLocalRowUpperBound (Teuchos::ArrayRCP<const size_t>& boundPerLocalRow,
1490  size_t& boundForAllLocalRows,
1491  bool& boundSameForAllLocalRows) const;
1492 
1501  void
1502  setAllIndices (const typename local_graph_type::row_map_type& rowPointers,
1503  const typename local_graph_type::entries_type::non_const_type& columnIndices);
1504 
1513  void
1514  setAllIndices (const Teuchos::ArrayRCP<size_t> & rowPointers,
1515  const Teuchos::ArrayRCP<local_ordinal_type> & columnIndices);
1516 
1524  Teuchos::ArrayRCP<const size_t> getNodeRowPtrs () const;
1525 
1527 
1529  Teuchos::ArrayRCP<const local_ordinal_type> getNodePackedIndices () const;
1530 
1541  void replaceColMap (const Teuchos::RCP<const map_type>& newColMap);
1542 
1562  void
1563  reindexColumns (const Teuchos::RCP<const map_type>& newColMap,
1564  const Teuchos::RCP<const import_type>& newImport = Teuchos::null,
1565  const bool sortIndicesInEachRow = true);
1566 
1580  void
1581  replaceDomainMapAndImporter (const Teuchos::RCP<const map_type>& newDomainMap,
1582  const Teuchos::RCP<const import_type>& newImporter);
1583 
1612  virtual void
1613  removeEmptyProcessesInPlace (const Teuchos::RCP<const map_type>& newMap) override;
1615 
1616  template<class ViewType, class OffsetViewType >
1617  struct pack_functor {
1618  typedef typename ViewType::execution_space execution_space;
1619  ViewType src;
1620  ViewType dest;
1621  OffsetViewType src_offset;
1622  OffsetViewType dest_offset;
1623  typedef typename OffsetViewType::non_const_value_type ScalarIndx;
1624 
1625  pack_functor(ViewType dest_, ViewType src_, OffsetViewType dest_offset_, OffsetViewType src_offset_):
1626  src(src_),dest(dest_),src_offset(src_offset_),dest_offset(dest_offset_) {};
1627 
1628  KOKKOS_INLINE_FUNCTION
1629  void operator() (size_t row) const {
1630  ScalarIndx i = src_offset(row);
1631  ScalarIndx j = dest_offset(row);
1632  const ScalarIndx k = dest_offset(row+1);
1633  for(;j<k;j++,i++) {
1634  dest(j) = src(i);
1635  }
1636  }
1637  };
1638 
1639  private:
1640  // Friend declaration for nonmember function.
1641  template<class CrsGraphType>
1642  friend Teuchos::RCP<CrsGraphType>
1643  importAndFillCompleteCrsGraph (const Teuchos::RCP<const CrsGraphType>& sourceGraph,
1644  const Import<typename CrsGraphType::local_ordinal_type,
1645  typename CrsGraphType::global_ordinal_type,
1646  typename CrsGraphType::node_type>& importer,
1647  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
1648  typename CrsGraphType::global_ordinal_type,
1649  typename CrsGraphType::node_type> >& domainMap,
1650  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
1651  typename CrsGraphType::global_ordinal_type,
1652  typename CrsGraphType::node_type> >& rangeMap,
1653  const Teuchos::RCP<Teuchos::ParameterList>& params);
1654 
1655  // Friend declaration for nonmember function.
1656  template<class CrsGraphType>
1657  friend Teuchos::RCP<CrsGraphType>
1658  importAndFillCompleteCrsGraph (const Teuchos::RCP<const CrsGraphType>& sourceGraph,
1659  const Import<typename CrsGraphType::local_ordinal_type,
1660  typename CrsGraphType::global_ordinal_type,
1661  typename CrsGraphType::node_type>& rowImporter,
1662  const Import<typename CrsGraphType::local_ordinal_type,
1663  typename CrsGraphType::global_ordinal_type,
1664  typename CrsGraphType::node_type>& domainImporter,
1665  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
1666  typename CrsGraphType::global_ordinal_type,
1667  typename CrsGraphType::node_type> >& domainMap,
1668  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
1669  typename CrsGraphType::global_ordinal_type,
1670  typename CrsGraphType::node_type> >& rangeMap,
1671  const Teuchos::RCP<Teuchos::ParameterList>& params);
1672 
1673 
1674  // Friend declaration for nonmember function.
1675  template<class CrsGraphType>
1676  friend Teuchos::RCP<CrsGraphType>
1677  exportAndFillCompleteCrsGraph (const Teuchos::RCP<const CrsGraphType>& sourceGraph,
1678  const Export<typename CrsGraphType::local_ordinal_type,
1679  typename CrsGraphType::global_ordinal_type,
1680  typename CrsGraphType::node_type>& exporter,
1681  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
1682  typename CrsGraphType::global_ordinal_type,
1683  typename CrsGraphType::node_type> >& domainMap,
1684  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
1685  typename CrsGraphType::global_ordinal_type,
1686  typename CrsGraphType::node_type> >& rangeMap,
1687  const Teuchos::RCP<Teuchos::ParameterList>& params);
1688 
1689  // Friend declaration for nonmember function.
1690  template<class CrsGraphType>
1691  friend Teuchos::RCP<CrsGraphType>
1692  exportAndFillCompleteCrsGraph (const Teuchos::RCP<const CrsGraphType>& sourceGraph,
1693  const Export<typename CrsGraphType::local_ordinal_type,
1694  typename CrsGraphType::global_ordinal_type,
1695  typename CrsGraphType::node_type>& rowExporter,
1696  const Export<typename CrsGraphType::local_ordinal_type,
1697  typename CrsGraphType::global_ordinal_type,
1698  typename CrsGraphType::node_type>& domainExporter,
1699  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
1700  typename CrsGraphType::global_ordinal_type,
1701  typename CrsGraphType::node_type> >& domainMap,
1702  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
1703  typename CrsGraphType::global_ordinal_type,
1704  typename CrsGraphType::node_type> >& rangeMap,
1705  const Teuchos::RCP<Teuchos::ParameterList>& params);
1706 
1707  template<class LO, class GO, class NT>
1708  friend void
1710  CrsGraph<LO, GO, NT>& graph,
1711  const Teuchos::ArrayView<const typename CrsGraph<LO,GO,NT>::packet_type>& imports,
1712  const Teuchos::ArrayView<const size_t>& numPacketsPerLID,
1713  const Teuchos::ArrayView<const LO>& importLIDs,
1714  size_t constantNumPackets,
1715  Distributor & distor,
1716  CombineMode combineMode);
1717 
1718  public:
1734  void
1735  importAndFillComplete (Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node> >& destGraph,
1736  const import_type& importer,
1737  const Teuchos::RCP<const map_type>& domainMap,
1738  const Teuchos::RCP<const map_type>& rangeMap,
1739  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) const;
1740 
1756  void
1757  importAndFillComplete (Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node> >& destGraph,
1758  const import_type& rowImporter,
1759  const import_type& domainImporter,
1760  const Teuchos::RCP<const map_type>& domainMap,
1761  const Teuchos::RCP<const map_type>& rangeMap,
1762  const Teuchos::RCP<Teuchos::ParameterList>& params) const;
1763 
1764 
1780  void
1781  exportAndFillComplete (Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node> >& destGraph,
1782  const export_type& exporter,
1783  const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
1784  const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
1785  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) const;
1786 
1802  void
1803  exportAndFillComplete (Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node> >& destGraph,
1804  const export_type& rowExporter,
1805  const export_type& domainExporter,
1806  const Teuchos::RCP<const map_type>& domainMap,
1807  const Teuchos::RCP<const map_type>& rangeMap,
1808  const Teuchos::RCP<Teuchos::ParameterList>& params) const;
1809 
1810 
1811  private:
1832  void
1833  transferAndFillComplete (Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node> >& destGraph,
1834  const ::Tpetra::Details::Transfer<local_ordinal_type, global_ordinal_type, Node>& rowTransfer,
1835  const Teuchos::RCP<const ::Tpetra::Details::Transfer<local_ordinal_type, global_ordinal_type, Node> > & domainTransfer,
1836  const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
1837  const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
1838  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) const;
1839 
1840  protected:
1841  // these structs are conveniences, to cut down on the number of
1842  // arguments to some of the methods below.
1843  struct SLocalGlobalViews {
1844  Teuchos::ArrayView<const global_ordinal_type> ginds;
1845  Teuchos::ArrayView<const local_ordinal_type> linds;
1846  };
1847  struct SLocalGlobalNCViews {
1848  Teuchos::ArrayView<global_ordinal_type> ginds;
1849  Teuchos::ArrayView<local_ordinal_type> linds;
1850  };
1851 
1852  bool indicesAreAllocated () const;
1853  void allocateIndices (const ELocalGlobal lg);
1854 
1856 
1857 
1867  void makeColMap (Teuchos::Array<int>& remotePIDs);
1868 
1885  std::pair<size_t, std::string> makeIndicesLocal ();
1886 
1895  void
1896  makeImportExport (Teuchos::Array<int>& remotePIDs,
1897  const bool useRemotePIDs);
1898 
1900 
1902 
1937  size_t
1938  insertIndices (RowInfo& rowInfo,
1939  const SLocalGlobalViews& newInds,
1940  const ELocalGlobal lg,
1941  const ELocalGlobal I);
1942 
1952  size_t
1954  const global_ordinal_type inputGblColInds[],
1955  const size_t numInputInds);
1956 
1966  size_t
1967  insertGlobalIndicesImpl (const RowInfo& rowInfo,
1968  const global_ordinal_type inputGblColInds[],
1969  const size_t numInputInds,
1970  std::function<void(const size_t, const size_t, const size_t)> fun =
1971  std::function<void(const size_t, const size_t, const size_t)>());
1972 
1973  void
1974  insertLocalIndicesImpl (const local_ordinal_type lclRow,
1975  const Teuchos::ArrayView<const local_ordinal_type>& gblColInds,
1976  std::function<void(const size_t, const size_t, const size_t)> fun =
1977  std::function<void(const size_t, const size_t, const size_t)>());
1978 
1994  size_t
1995  findLocalIndices(const RowInfo& rowInfo,
1996  const Teuchos::ArrayView<const local_ordinal_type>& indices,
1997  std::function<void(const size_t, const size_t, const size_t)> fun) const;
1998 
1999  size_t
2000  findGlobalIndices(const RowInfo& rowInfo,
2001  const Teuchos::ArrayView<const global_ordinal_type>& indices,
2002  std::function<void(const size_t, const size_t, const size_t)> fun) const;
2003 
2015  void
2017  const global_ordinal_type gblColInds[],
2018  const local_ordinal_type numGblColInds);
2019 
2031  void
2033  const global_ordinal_type gblColInds[],
2034  const local_ordinal_type numGblColInds);
2035 
2040  static const bool useAtomicUpdatesByDefault =
2041 #ifdef KOKKOS_ENABLE_SERIAL
2042  ! std::is_same<execution_space, Kokkos::Serial>::value;
2043 #else
2044  true;
2045 #endif // KOKKOS_ENABLE_SERIAL
2046 
2048 
2050 
2052  bool isMerged () const;
2053 
2059  void setLocallyModified ();
2060 
2061  private:
2066  void
2067  sortAndMergeAllIndices (const bool sorted, const bool merged);
2068 
2069  // mfh 08 May 2017: I only restore "protected" here for backwards
2070  // compatibility.
2071  protected:
2080  size_t sortAndMergeRowIndices (const RowInfo& rowInfo,
2081  const bool sorted,
2082  const bool merged);
2084 
2094  void
2095  setDomainRangeMaps (const Teuchos::RCP<const map_type>& domainMap,
2096  const Teuchos::RCP<const map_type>& rangeMap);
2097 
2098  void staticAssertions() const;
2099  void clearGlobalConstants();
2100 
2101  public:
2104 
2133  void computeGlobalConstants (const bool computeLocalTriangularConstants);
2134 
2135  protected:
2170  void computeLocalConstants (const bool computeLocalTriangularConstants);
2171 
2174  RowInfo getRowInfo (const local_ordinal_type myRow) const;
2175 
2189 
2193  Teuchos::ArrayView<const local_ordinal_type>
2194  getLocalView (const RowInfo& rowinfo) const;
2195 
2199  Teuchos::ArrayView<local_ordinal_type>
2200  getLocalViewNonConst (const RowInfo& rowinfo);
2201 
2214  getLocalViewRawConst (const local_ordinal_type*& lclInds,
2215  local_ordinal_type& capacity,
2216  const RowInfo& rowInfo) const;
2217 
2218  private:
2219 
2226  Kokkos::View<const local_ordinal_type*, execution_space, Kokkos::MemoryUnmanaged>
2227  getLocalKokkosRowView (const RowInfo& rowInfo) const;
2228 
2235  Kokkos::View<local_ordinal_type*, execution_space, Kokkos::MemoryUnmanaged>
2236  getLocalKokkosRowViewNonConst (const RowInfo& rowInfo);
2237 
2244  Kokkos::View<const global_ordinal_type*, execution_space, Kokkos::MemoryUnmanaged>
2245  getGlobalKokkosRowView (const RowInfo& rowInfo) const;
2246 
2247  protected:
2248 
2252  Teuchos::ArrayView<const global_ordinal_type>
2253  getGlobalView (const RowInfo& rowinfo) const;
2254 
2258  Teuchos::ArrayView<global_ordinal_type>
2259  getGlobalViewNonConst (const RowInfo& rowinfo);
2260 
2274  getGlobalViewRawConst (const global_ordinal_type*& gblInds,
2275  local_ordinal_type& capacity,
2276  const RowInfo& rowInfo) const;
2277 
2278 
2279  public:
2280 
2281 
2290 
2291 
2292  protected:
2293 
2294 
2295  void fillLocalGraph (const Teuchos::RCP<Teuchos::ParameterList>& params);
2296 
2298  void checkInternalState () const;
2299 
2304 
2305  // Friend the tester for CrsGraph::swap
2306  friend class Tpetra::crsGraph_Swap_Tester<local_ordinal_type, global_ordinal_type, Node>;
2307 
2308 
2310  Teuchos::RCP<const map_type> rowMap_;
2312  Teuchos::RCP<const map_type> colMap_;
2314  Teuchos::RCP<const map_type> rangeMap_;
2316  Teuchos::RCP<const map_type> domainMap_;
2317 
2324  Teuchos::RCP<const import_type> importer_;
2325 
2331  Teuchos::RCP<const export_type> exporter_;
2332 
2335 
2340 
2345 
2350 
2355 
2360 
2363 
2389  typename Kokkos::View<const size_t*, execution_space>::HostMirror
2391 
2402 
2404 
2405 
2413  typename local_graph_type::entries_type::non_const_type k_lclInds1D_;
2414 
2416  typedef Kokkos::View<global_ordinal_type*, execution_space> t_GlobalOrdinal_1D;
2417 
2426 
2451  typename local_graph_type::row_map_type::const_type k_rowPtrs_;
2452 
2454 
2466 
2478  Teuchos::ArrayRCP<Teuchos::Array<local_ordinal_type> > lclInds2D_;
2479 
2491  Teuchos::ArrayRCP<Teuchos::Array<global_ordinal_type> > gblInds2D_;
2492 
2500  typedef typename Kokkos::View<size_t*, Kokkos::LayoutLeft, device_type>::HostMirror num_row_entries_type;
2501 
2502  // typedef Kokkos::View<
2503  // size_t*,
2504  // Kokkos::LayoutLeft,
2505  // Kokkos::Device<
2506  // typename Kokkos::View<
2507  // size_t*,
2508  // Kokkos::LayoutLeft,
2509  // device_type>::HostMirror::execution_space,
2510  // Kokkos::HostSpace> > num_row_entries_type;
2511 
2519 
2521 
2532 
2533  bool indicesAreAllocated_;
2534  bool indicesAreLocal_;
2535  bool indicesAreGlobal_;
2536  bool fillComplete_;
2537 
2551 
2552  typedef typename std::map<global_ordinal_type, std::vector<global_ordinal_type> > nonlocals_type;
2553 
2555  nonlocals_type nonlocals_;
2556 
2572 
2573  }; // class CrsGraph
2574 
2581  template <class LocalOrdinal, class GlobalOrdinal, class Node>
2582  Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
2583  createCrsGraph (const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map,
2584  size_t maxNumEntriesPerRow = 0,
2585  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
2586  {
2587  using Teuchos::rcp;
2589  const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE;
2590  return rcp (new graph_type (map, maxNumEntriesPerRow, pftype, params));
2591  }
2592 
2641  template<class CrsGraphType>
2642  Teuchos::RCP<CrsGraphType>
2643  importAndFillCompleteCrsGraph (const Teuchos::RCP<const CrsGraphType>& sourceGraph,
2644  const Import<typename CrsGraphType::local_ordinal_type,
2645  typename CrsGraphType::global_ordinal_type,
2646  typename CrsGraphType::node_type>& importer,
2647  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
2648  typename CrsGraphType::global_ordinal_type,
2649  typename CrsGraphType::node_type> >& domainMap = Teuchos::null,
2650  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
2651  typename CrsGraphType::global_ordinal_type,
2652  typename CrsGraphType::node_type> >& rangeMap = Teuchos::null,
2653  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
2654  {
2655  Teuchos::RCP<CrsGraphType> destGraph;
2656  sourceGraph->importAndFillComplete (destGraph,importer,domainMap, rangeMap, params);
2657  return destGraph;
2658  }
2659 
2710  template<class CrsGraphType>
2711  Teuchos::RCP<CrsGraphType>
2712  importAndFillCompleteCrsGraph (const Teuchos::RCP<const CrsGraphType>& sourceGraph,
2713  const Import<typename CrsGraphType::local_ordinal_type,
2714  typename CrsGraphType::global_ordinal_type,
2715  typename CrsGraphType::node_type>& rowImporter,
2716  const Import<typename CrsGraphType::local_ordinal_type,
2717  typename CrsGraphType::global_ordinal_type,
2718  typename CrsGraphType::node_type>& domainImporter,
2719  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
2720  typename CrsGraphType::global_ordinal_type,
2721  typename CrsGraphType::node_type> >& domainMap,
2722  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
2723  typename CrsGraphType::global_ordinal_type,
2724  typename CrsGraphType::node_type> >& rangeMap,
2725  const Teuchos::RCP<Teuchos::ParameterList>& params)
2726  {
2727  Teuchos::RCP<CrsGraphType> destGraph;
2728  sourceGraph->importAndFillComplete (destGraph,rowImporter,domainImporter, domainMap, rangeMap, params);
2729  return destGraph;
2730  }
2731 
2765  template<class CrsGraphType>
2766  Teuchos::RCP<CrsGraphType>
2767  exportAndFillCompleteCrsGraph (const Teuchos::RCP<const CrsGraphType>& sourceGraph,
2768  const Export<typename CrsGraphType::local_ordinal_type,
2769  typename CrsGraphType::global_ordinal_type,
2770  typename CrsGraphType::node_type>& exporter,
2771  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
2772  typename CrsGraphType::global_ordinal_type,
2773  typename CrsGraphType::node_type> >& domainMap = Teuchos::null,
2774  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
2775  typename CrsGraphType::global_ordinal_type,
2776  typename CrsGraphType::node_type> >& rangeMap = Teuchos::null,
2777  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
2778  {
2779  Teuchos::RCP<CrsGraphType> destGraph;
2780  sourceGraph->exportAndFillComplete (destGraph,exporter,domainMap, rangeMap, params);
2781  return destGraph;
2782  }
2783 
2817  template<class CrsGraphType>
2818  Teuchos::RCP<CrsGraphType>
2819  exportAndFillCompleteCrsGraph (const Teuchos::RCP<const CrsGraphType>& sourceGraph,
2820  const Export<typename CrsGraphType::local_ordinal_type,
2821  typename CrsGraphType::global_ordinal_type,
2822  typename CrsGraphType::node_type>& rowExporter,
2823  const Export<typename CrsGraphType::local_ordinal_type,
2824  typename CrsGraphType::global_ordinal_type,
2825  typename CrsGraphType::node_type>& domainExporter,
2826  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
2827  typename CrsGraphType::global_ordinal_type,
2828  typename CrsGraphType::node_type> >& domainMap,
2829  const Teuchos::RCP<const Map<typename CrsGraphType::local_ordinal_type,
2830  typename CrsGraphType::global_ordinal_type,
2831  typename CrsGraphType::node_type> >& rangeMap,
2832  const Teuchos::RCP<Teuchos::ParameterList>& params)
2833  {
2834  Teuchos::RCP<CrsGraphType> destGraph;
2835  sourceGraph->exportAndFillComplete (destGraph,rowExporter,domainExporter,domainMap, rangeMap, params);
2836  return destGraph;
2837  }
2838 
2839 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
2840  namespace Details {
2841  template<class LocalOrdinal,
2842  class GlobalOrdinal,
2843  class OutputNodeType,
2844  class InputNodeType>
2845  class CrsGraphCopier<CrsGraph<LocalOrdinal, GlobalOrdinal, OutputNodeType>,
2846  CrsGraph<LocalOrdinal, GlobalOrdinal, InputNodeType> > {
2847  public:
2848  typedef CrsGraph<LocalOrdinal, GlobalOrdinal, InputNodeType> input_crs_graph_type;
2849  typedef CrsGraph<LocalOrdinal, GlobalOrdinal, OutputNodeType> output_crs_graph_type;
2850 
2851  static Teuchos::RCP<output_crs_graph_type> TPETRA_DEPRECATED
2852  clone (const input_crs_graph_type& graphIn,
2853  const Teuchos::RCP<OutputNodeType> &nodeOut,
2854  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
2855  {
2856  using Teuchos::arcp;
2857  using Teuchos::Array;
2858  using Teuchos::ArrayRCP;
2859  using Teuchos::ArrayView;
2860  using Teuchos::null;
2861  using Teuchos::outArg;
2862  using Teuchos::ParameterList;
2863  using Teuchos::parameterList;
2864  using Teuchos::RCP;
2865  using Teuchos::rcp;
2866  using Teuchos::REDUCE_MIN;
2867  using Teuchos::reduceAll;
2868  using Teuchos::sublist;
2869  using std::cerr;
2870  using std::endl;
2871  typedef LocalOrdinal LO;
2872  typedef GlobalOrdinal GO;
2873  typedef typename ArrayView<const GO>::size_type size_type;
2874  typedef ::Tpetra::Map<LO, GO, InputNodeType> input_map_type;
2875  typedef ::Tpetra::Map<LO, GO, OutputNodeType> output_map_type;
2876  const char prefix[] = "Tpetra::Details::CrsGraphCopier::clone: ";
2877 
2878  // Set parameters' default values.
2879  bool debug = false;
2880  bool fillCompleteClone = true;
2881  bool useLocalIndices = graphIn.hasColMap ();
2882  ProfileType pftype = StaticProfile;
2883  // If the user provided a ParameterList, get values from there.
2884  if (! params.is_null ()) {
2885  fillCompleteClone = params->get ("fillComplete clone", fillCompleteClone);
2886  useLocalIndices = params->get ("Locally indexed clone", useLocalIndices);
2887  if (params->get ("Static profile clone", true) == false) {
2888  pftype = ProfileType(StaticProfile+1); // DynamicProfile (Tpetra_ConfigDefs.h)
2889  }
2890  debug = params->get ("Debug", debug);
2891  }
2892 
2893  const Teuchos::Comm<int>& comm = * (graphIn.getRowMap ()->getComm ());
2894  const int myRank = comm.getRank ();
2895 
2896  TEUCHOS_TEST_FOR_EXCEPTION
2897  (! graphIn.hasColMap () && useLocalIndices, std::runtime_error,
2898  prefix << "You asked clone() to use local indices (by setting the "
2899  "\"Locally indexed clone\" parameter to true), but the source graph "
2900  "does not yet have a column Map, so this is impossible.");
2901 
2902  if (debug) {
2903  std::ostringstream os;
2904  os << "Process " << myRank << ": Cloning row Map" << endl;
2905  cerr << os.str ();
2906  }
2907 
2908  RCP<const output_map_type> clonedRowMap =
2909  graphIn.getRowMap ()->template clone<OutputNodeType> (nodeOut);
2910 
2911  // Invoke the output graph's constructor, using the input graph's
2912  // upper bounds on the number of entries in each local row.
2913  RCP<output_crs_graph_type> clonedGraph; // returned by this function
2914  {
2915  ArrayRCP<const size_t> numEntriesPerRow;
2916  size_t numEntriesForAll = 0;
2917  bool boundSameForAllLocalRows = true;
2918 
2919  if (debug) {
2920  std::ostringstream os;
2921  os << "Process " << myRank << ": Getting per-row bounds" << endl;
2922  cerr << os.str ();
2923  }
2924  graphIn.getNumEntriesPerLocalRowUpperBound (numEntriesPerRow,
2925  numEntriesForAll,
2926  boundSameForAllLocalRows);
2927  if (debug) {
2928  std::ostringstream os;
2929  os << "Process " << myRank << ": numEntriesForAll = "
2930  << numEntriesForAll << endl;
2931  cerr << os.str ();
2932  }
2933 
2934  if (debug) {
2935  std::ostringstream os;
2936  os << "Process " << myRank << ": graphIn.getNodeMaxNumRowEntries() = "
2937  << graphIn.getNodeMaxNumRowEntries () << endl;
2938  cerr << os.str ();
2939  }
2940 
2941  RCP<ParameterList> graphparams;
2942  if (params.is_null ()) {
2943  graphparams = parameterList ("CrsGraph");
2944  } else {
2945  graphparams = sublist (params, "CrsGraph");
2946  }
2947  if (useLocalIndices) {
2948  RCP<const output_map_type> clonedColMap =
2949  graphIn.getColMap ()->template clone<OutputNodeType> (nodeOut);
2950  if (boundSameForAllLocalRows) {
2951  clonedGraph = rcp (new output_crs_graph_type (clonedRowMap, clonedColMap,
2952  numEntriesForAll, pftype,
2953  graphparams));
2954  } else {
2955  clonedGraph = rcp (new output_crs_graph_type (clonedRowMap, clonedColMap,
2956  numEntriesPerRow (), pftype,
2957  graphparams));
2958  }
2959  } else {
2960  if (boundSameForAllLocalRows) {
2961  clonedGraph = rcp (new output_crs_graph_type (clonedRowMap,
2962  numEntriesForAll, pftype,
2963  graphparams));
2964  } else {
2965  clonedGraph = rcp (new output_crs_graph_type (clonedRowMap,
2966  numEntriesPerRow (),
2967  pftype, graphparams));
2968  }
2969  }
2970 
2971  if (debug) {
2972  std::ostringstream os;
2973  os << "Process " << myRank << ": Invoked output graph's constructor" << endl;
2974  cerr << os.str ();
2975  }
2976 
2977  // done with these
2978  numEntriesPerRow = null;
2979  numEntriesForAll = 0;
2980  }
2981 
2982  const input_map_type& inputRowMap = * (graphIn.getRowMap ());
2983  const size_type numRows =
2984  static_cast<size_type> (inputRowMap.getNodeNumElements ());
2985 
2986  bool failed = false;
2987 
2988  if (useLocalIndices) {
2989  const LO localMinLID = inputRowMap.getMinLocalIndex ();
2990  const LO localMaxLID = inputRowMap.getMaxLocalIndex ();
2991 
2992  if (graphIn.isLocallyIndexed ()) {
2993  if (numRows != 0) {
2994  try {
2995  ArrayView<const LO> linds;
2996  for (LO lrow = localMinLID; lrow <= localMaxLID; ++lrow) {
2997  graphIn.getLocalRowView (lrow, linds);
2998  if (linds.size () != 0) {
2999  clonedGraph->insertLocalIndices (lrow, linds);
3000  }
3001  }
3002  }
3003  catch (std::exception& e) {
3004  std::ostringstream os;
3005  os << "Process " << myRank << ": copying (reading local by view, "
3006  "writing local) indices into the output graph threw an "
3007  "exception: " << e.what () << endl;
3008  cerr << os.str ();
3009  failed = true;
3010  }
3011  }
3012  }
3013  else { // graphIn.isGloballyIndexed()
3014  TEUCHOS_TEST_FOR_EXCEPTION(
3015  ! graphIn.hasColMap () && useLocalIndices, std::invalid_argument,
3016  prefix << "You asked clone() to use local indices (by setting the "
3017  "\"Locally indexed clone\" parameter to true), but the source graph "
3018  "does not yet have a column Map, so this is impossible.");
3019 
3020  // The input graph has a column Map, but is globally indexed.
3021  // That's a bit weird, but we'll run with it. In this case,
3022  // getLocalRowView won't work, but getLocalRowCopy should
3023  // still work; it will just have to convert from global to
3024  // local indices internally.
3025 
3026  try {
3027  // Make space for getLocalRowCopy to put column indices.
3028  //
3029  // This is only a hint; we may have to resize in the loop
3030  // below. getNodeMaxNumRowEntries() may return nonsense if
3031  // fill is active. The key bool in CrsGraph is
3032  // haveLocalConstants_.
3033  size_t myMaxNumRowEntries =
3034  graphIn.isFillActive () ? static_cast<size_t> (0) :
3035  graphIn.getNodeMaxNumRowEntries ();
3036 
3037  Array<LO> linds (myMaxNumRowEntries);
3038 
3039  // Copy each row into the new graph, using local indices.
3040  for (LO lrow = localMinLID; lrow <= localMaxLID; ++lrow) {
3041  size_t theNumEntries = graphIn.getNumEntriesInLocalRow (lrow);
3042  if (theNumEntries > myMaxNumRowEntries) {
3043  myMaxNumRowEntries = theNumEntries;
3044  linds.resize (myMaxNumRowEntries);
3045  }
3046  graphIn.getLocalRowCopy (lrow, linds (), theNumEntries);
3047  if (theNumEntries != 0) {
3048  clonedGraph->insertLocalIndices (lrow, linds (0, theNumEntries));
3049  }
3050  }
3051  }
3052  catch (std::exception& e) {
3053  std::ostringstream os;
3054  os << "Process " << myRank << ": copying (reading local by copy, "
3055  "writing local) indices into the output graph threw an exception: "
3056  << e.what () << endl;
3057  cerr << os.str ();
3058  failed = true;
3059  }
3060  }
3061  }
3062  else { /* useGlobalIndices */
3063  if (numRows != 0) {
3064  const GlobalOrdinal localMinGID = inputRowMap.getMinGlobalIndex ();
3065  const GlobalOrdinal localMaxGID = inputRowMap.getMaxGlobalIndex ();
3066  const bool inputRowMapIsContiguous = inputRowMap.isContiguous ();
3067 
3068  if (graphIn.isGloballyIndexed ()) {
3069  ArrayView<const GlobalOrdinal> ginds;
3070 
3071  if (inputRowMapIsContiguous) {
3072  try {
3073  for (GO grow = localMinGID; grow <= localMaxGID; ++grow) {
3074  graphIn.getGlobalRowView (grow, ginds);
3075  if (ginds.size () != 0) {
3076  clonedGraph->insertGlobalIndices (grow, ginds);
3077  }
3078  }
3079  }
3080  catch (std::exception& e) {
3081  std::ostringstream os;
3082  os << "Process " << myRank << ": copying (reading global by view, "
3083  "writing global) indices into the output graph threw an "
3084  "exception: " << e.what () << endl;
3085  cerr << os.str ();
3086  failed = true;
3087  }
3088  }
3089  else { // input row Map is not contiguous
3090  try {
3091  ArrayView<const GO> inputRowMapGIDs = inputRowMap.getNodeElementList ();
3092  for (size_type k = 0; k < numRows; ++k) {
3093  const GO grow = inputRowMapGIDs[k];
3094  graphIn.getGlobalRowView (grow, ginds);
3095  if (ginds.size () != 0) {
3096  clonedGraph->insertGlobalIndices (grow, ginds);
3097  }
3098  }
3099  }
3100  catch (std::exception& e) {
3101  std::ostringstream os;
3102  os << "Process " << myRank << ": copying (reading global by view, "
3103  "writing global) indices into the output graph threw an "
3104  "exception: " << e.what () << endl;
3105  cerr << os.str ();
3106  failed = true;
3107  }
3108  }
3109  }
3110  else { // graphIn.isLocallyIndexed()
3111  // Make space for getGlobalRowCopy to put column indices.
3112  //
3113  // This is only a hint; we may have to resize in the loop
3114  // below. getNodeMaxNumRowEntries() may return nonsense if
3115  // fill is active. The key bool in CrsGraph is
3116  // haveLocalConstants_.
3117  size_t myMaxNumRowEntries =
3118  graphIn.isFillActive () ? static_cast<size_t> (0) :
3119  graphIn.getNodeMaxNumRowEntries ();
3120 
3121  Array<GO> ginds (myMaxNumRowEntries);
3122 
3123  if (inputRowMapIsContiguous) {
3124  try {
3125  for (GO grow = localMinGID; grow <= localMaxGID; ++grow) {
3126  size_t theNumEntries = graphIn.getNumEntriesInGlobalRow (grow);
3127  if (theNumEntries > myMaxNumRowEntries) {
3128  myMaxNumRowEntries = theNumEntries;
3129  ginds.resize (myMaxNumRowEntries);
3130  }
3131  graphIn.getGlobalRowCopy (grow, ginds (), theNumEntries);
3132  if (theNumEntries != 0) {
3133  clonedGraph->insertGlobalIndices (grow, ginds (0, theNumEntries));
3134  }
3135  }
3136  }
3137  catch (std::exception& e) {
3138  std::ostringstream os;
3139  os << "Process " << myRank << ": copying (reading global by copy, "
3140  "writing global) indices into the output graph threw an "
3141  "exception: " << e.what () << endl;
3142  cerr << os.str ();
3143  failed = true;
3144  }
3145  }
3146  else { // input row Map is not contiguous
3147  try {
3148  ArrayView<const GO> inputRowMapGIDs = inputRowMap.getNodeElementList ();
3149  for (size_type k = 0; k < numRows; ++k) {
3150  const GO grow = inputRowMapGIDs[k];
3151 
3152  size_t theNumEntries = graphIn.getNumEntriesInGlobalRow (grow);
3153  if (theNumEntries > myMaxNumRowEntries) {
3154  myMaxNumRowEntries = theNumEntries;
3155  ginds.resize (myMaxNumRowEntries);
3156  }
3157  graphIn.getGlobalRowCopy (grow, ginds (), theNumEntries);
3158  if (theNumEntries != 0) {
3159  clonedGraph->insertGlobalIndices (grow, ginds (0, theNumEntries));
3160  }
3161  }
3162  }
3163  catch (std::exception& e) {
3164  std::ostringstream os;
3165  os << "Process " << myRank << ": copying (reading global by copy, "
3166  "writing global) indices into the output graph threw an "
3167  "exception: " << e.what () << endl;
3168  cerr << os.str ();
3169  failed = true;
3170  }
3171  }
3172  }
3173  } // numRows != 0
3174  }
3175 
3176  if (debug) {
3177  std::ostringstream os;
3178  os << "Process " << myRank << ": copied entries" << endl;
3179  cerr << os.str ();
3180  }
3181 
3182  if (fillCompleteClone) {
3183  RCP<ParameterList> fillparams = params.is_null () ?
3184  parameterList ("fillComplete") :
3185  sublist (params, "fillComplete");
3186  try {
3187  RCP<const output_map_type> clonedRangeMap;
3188  RCP<const output_map_type> clonedDomainMap;
3189  if (! graphIn.getRangeMap ().is_null () &&
3190  graphIn.getRangeMap () != graphIn.getRowMap ()) {
3191  clonedRangeMap =
3192  graphIn.getRangeMap ()->template clone<OutputNodeType> (nodeOut);
3193  }
3194  else {
3195  clonedRangeMap = clonedRowMap;
3196  }
3197  if (! graphIn.getDomainMap ().is_null ()
3198  && graphIn.getDomainMap () != graphIn.getRowMap ()) {
3199  clonedDomainMap =
3200  graphIn.getDomainMap ()->template clone<OutputNodeType> (nodeOut);
3201  }
3202  else {
3203  clonedDomainMap = clonedRowMap;
3204  }
3205 
3206  if (debug) {
3207  std::ostringstream os;
3208  os << "Process " << myRank << ": About to call fillComplete on "
3209  "cloned graph" << endl;
3210  cerr << os.str ();
3211  }
3212  clonedGraph->fillComplete (clonedDomainMap, clonedRangeMap, fillparams);
3213  }
3214  catch (std::exception &e) {
3215  failed = true;
3216  std::ostringstream os;
3217  os << prefix << "Process " << myRank << ": Caught the following "
3218  "exception while calling fillComplete() on clone of type"
3219  << endl << Teuchos::typeName (*clonedGraph) << endl;
3220  cerr << os.str ();
3221  }
3222  }
3223 
3224  int lclSuccess = failed ? 0 : 1;
3225  int gblSuccess = 1;
3226  reduceAll<int, int> (comm, REDUCE_MIN, lclSuccess, outArg (gblSuccess));
3227  TEUCHOS_TEST_FOR_EXCEPTION
3228  (gblSuccess != 1, std::logic_error,
3229  prefix << "Clone failed on at least one process.");
3230 
3231  if (debug) {
3232  std::ostringstream os;
3233  os << "Process " << myRank << ": Done with CrsGraph::clone" << endl;
3234  cerr << os.str ();
3235  }
3236  return clonedGraph;
3237  }
3238  }; // class CrsGraphCopier
3239  } // namespace Details
3240 #endif // TPETRA_ENABLE_DEPRECATED_CODE
3241 
3242 } // namespace Tpetra
3243 
3244 #endif // TPETRA_CRSGRAPH_DECL_HPP
Tpetra_CrsGraph_fwd.hpp
Forward declaration of Tpetra::CrsGraph.
Tpetra::CrsGraph::t_GlobalOrdinal_1D
Kokkos::View< global_ordinal_type *, execution_space > t_GlobalOrdinal_1D
Type of the k_gblInds1D_ array of global column indices.
Definition: Tpetra_CrsGraph_decl.hpp:2416
Tpetra::CrsGraph::globalNumDiags_
global_size_t globalNumDiags_
Global number of (populated) diagonal entries.
Definition: Tpetra_CrsGraph_decl.hpp:2354
Tpetra::CrsGraph::getValidParameters
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Default parameter list suitable for validation.
Definition: Tpetra_CrsGraph_def.hpp:955
Tpetra::CrsGraph::getLocalRowView
void getLocalRowView(const local_ordinal_type lclRow, Teuchos::ArrayView< const local_ordinal_type > &lclColInds) const override
Get a const, non-persisting view of the given local row's local column indices, as a Teuchos::ArrayVi...
Definition: Tpetra_CrsGraph_def.hpp:3074
Tpetra::ProfileType
ProfileType
Definition: Tpetra_ConfigDefs.hpp:130
Tpetra::CrsGraph::insertIndices
size_t insertIndices(RowInfo &rowInfo, const SLocalGlobalViews &newInds, const ELocalGlobal lg, const ELocalGlobal I)
Insert indices into the given row.
Definition: Tpetra_CrsGraph_def.hpp:2151
Tpetra::CrsGraph::getLocalDiagOffsets
void getLocalDiagOffsets(const Kokkos::View< size_t *, device_type, Kokkos::MemoryUnmanaged > &offsets) const
Get offsets of the diagonal entries in the graph.
Definition: Tpetra_CrsGraph_def.hpp:6884
Tpetra_BlockCrsMatrix_fwd.hpp
Forward declaration of Tpetra::BlockCrsMatrix.
Tpetra::CrsGraph::haveGlobalConstants
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
Definition: Tpetra_CrsGraph_decl.hpp:2103
Tpetra::CrsGraph::getDomainMap
Teuchos::RCP< const map_type > getDomainMap() const override
Returns the Map associated with the domain of this graph.
Definition: Tpetra_CrsGraph_def.hpp:1116
Tpetra::CrsGraph::packet_type
global_ordinal_type packet_type
Type of each entry of the DistObject communication buffer.
Definition: Tpetra_CrsGraph_decl.hpp:1306
Tpetra::CrsGraph::upperTriangular_
bool upperTriangular_
Whether the graph is locally upper triangular.
Definition: Tpetra_CrsGraph_decl.hpp:2541
Tpetra::CrsGraph::pack
virtual void pack(const Teuchos::ArrayView< const local_ordinal_type > &exportLIDs, Teuchos::Array< global_ordinal_type > &exports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t &constantNumPackets, Distributor &distor) const override
Pack this object's data for Import or Export.
Definition: Tpetra_CrsGraph_def.hpp:6159
Tpetra::CrsGraph::CrsGraph
CrsGraph(const CrsGraph< local_ordinal_type, global_ordinal_type, node_type > &)=default
Copy constructor (default).
Tpetra::CrsGraph::isMerged
bool isMerged() const
Whether duplicate column indices in each row have been merged.
Definition: Tpetra_CrsGraph_def.hpp:1427
Tpetra::CrsGraph::getNodePackedIndices
Teuchos::ArrayRCP< const local_ordinal_type > getNodePackedIndices() const
Get an Teuchos::ArrayRCP of the packed column-indices.
Definition: Tpetra_CrsGraph_def.hpp:2980
Tpetra::CrsGraph::hasColMap
bool hasColMap() const override
Whether the graph has a column Map.
Definition: Tpetra_CrsGraph_def.hpp:1148
Tpetra::CrsGraph::isGloballyIndexed
bool isGloballyIndexed() const override
Whether the graph's column indices are stored as global indices.
Definition: Tpetra_CrsGraph_def.hpp:1334
Tpetra::CrsMatrix
Sparse matrix that presents a row-oriented interface that lets users read or modify entries.
Definition: Tpetra_CrsMatrix_decl.hpp:429
Tpetra::Export
Communication plan for data redistribution from a (possibly) multiply-owned to a uniquely-owned distr...
Definition: Tpetra_Export_decl.hpp:124
Tpetra::CrsGraph::makeIndicesLocal
std::pair< size_t, std::string > makeIndicesLocal()
Convert column indices from global to local.
Definition: Tpetra_CrsGraph_def.hpp:5013
Tpetra::RowInfo
Allocation information for a locally owned row in a CrsGraph or CrsMatrix.
Definition: Tpetra_CrsGraph_decl.hpp:128
Tpetra::CrsGraph::nonlocals_
nonlocals_type nonlocals_
Nonlocal data given to insertGlobalIndices.
Definition: Tpetra_CrsGraph_decl.hpp:2555
Tpetra::CrsGraph::describe
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const override
Print this object to the given output stream with the given verbosity level.
Definition: Tpetra_CrsGraph_def.hpp:5494
Tpetra::CrsGraph::setAllIndices
void setAllIndices(const typename local_graph_type::row_map_type &rowPointers, const typename local_graph_type::entries_type::non_const_type &columnIndices)
Set the graph's data directly, using 1-D storage.
Definition: Tpetra_CrsGraph_def.hpp:3463
Tpetra::CrsGraph::makeColMap
void makeColMap(Teuchos::Array< int > &remotePIDs)
Make and set the graph's column Map.
Definition: Tpetra_CrsGraph_def.hpp:5302
Tpetra::CrsGraph::haveLocalConstants_
bool haveLocalConstants_
Whether this process has computed local constants.
Definition: Tpetra_CrsGraph_decl.hpp:2548
Tpetra::CrsGraph::makeImportExport
void makeImportExport(Teuchos::Array< int > &remotePIDs, const bool useRemotePIDs)
Make the Import and Export objects, if needed.
Definition: Tpetra_CrsGraph_def.hpp:5403
Tpetra::CrsGraph::getRowMap
Teuchos::RCP< const map_type > getRowMap() const override
Returns the Map that describes the row distribution in this graph.
Definition: Tpetra_CrsGraph_def.hpp:1100
Tpetra::CrsGraph::sortAndMergeRowIndices
size_t sortAndMergeRowIndices(const RowInfo &rowInfo, const bool sorted, const bool merged)
Sort and merge duplicate column indices in the given row.
Definition: Tpetra_CrsGraph_def.hpp:2490
Tpetra::CrsGraph::rangeMap_
Teuchos::RCP< const map_type > rangeMap_
The Map describing the range of the (matrix corresponding to the) graph.
Definition: Tpetra_CrsGraph_decl.hpp:2314
Tpetra::Map< LO, GO, node_type >
Tpetra::CrsGraph::getNodeMaxNumRowEntries
size_t getNodeMaxNumRowEntries() const override
Maximum number of entries in any row of the graph, on this process.
Definition: Tpetra_CrsGraph_def.hpp:1268
Tpetra::CrsGraph::removeEmptyProcessesInPlace
virtual void removeEmptyProcessesInPlace(const Teuchos::RCP< const map_type > &newMap) override
Remove processes owning zero rows from the Maps and their communicator.
Definition: Tpetra_CrsGraph_def.hpp:6786
Tpetra::CrsGraph::insertGlobalIndicesFiltered
void insertGlobalIndicesFiltered(const local_ordinal_type lclRow, const global_ordinal_type gblColInds[], const local_ordinal_type numGblColInds)
Like insertGlobalIndices(), but with column Map filtering.
Definition: Tpetra_CrsGraph_def.hpp:3337
Tpetra::CrsGraph::lowerTriangular_
bool lowerTriangular_
Whether the graph is locally lower triangular.
Definition: Tpetra_CrsGraph_decl.hpp:2539
Tpetra::Import
Communication plan for data redistribution from a uniquely-owned to a (possibly) multiply-owned distr...
Definition: Tpetra_Import_decl.hpp:116
Tpetra::CrsGraph< LO, GO, node_type >::global_ordinal_type
GO global_ordinal_type
The type of the graph's global indices.
Definition: Tpetra_CrsGraph_decl.hpp:293
Tpetra::CrsGraph::getNodeNumRows
size_t getNodeNumRows() const override
Returns the number of graph rows owned on the calling node.
Definition: Tpetra_CrsGraph_def.hpp:1023
Tpetra::CrsGraph::rowMap_
Teuchos::RCP< const map_type > rowMap_
The Map describing the distribution of rows of the graph.
Definition: Tpetra_CrsGraph_decl.hpp:2310
Tpetra::CrsGraph::importer_
Teuchos::RCP< const import_type > importer_
The Import from the domain Map to the column Map.
Definition: Tpetra_CrsGraph_decl.hpp:2324
Tpetra::CrsGraph::sortGhostsAssociatedWithEachProcessor_
bool sortGhostsAssociatedWithEachProcessor_
Whether to require makeColMap() (and therefore fillComplete()) to order column Map GIDs associated wi...
Definition: Tpetra_CrsGraph_decl.hpp:2571
Tpetra::CrsGraph::lclGraph_
local_graph_type lclGraph_
Local graph; only initialized after first fillComplete() call.
Definition: Tpetra_CrsGraph_decl.hpp:2334
Tpetra::CrsGraph::k_numAllocPerRow_
Kokkos::View< const size_t *, execution_space >::HostMirror k_numAllocPerRow_
The maximum number of entries to allow in each locally owned row, per row.
Definition: Tpetra_CrsGraph_decl.hpp:2390
Tpetra::CrsGraph::exporter_
Teuchos::RCP< const export_type > exporter_
The Export from the row Map to the range Map.
Definition: Tpetra_CrsGraph_decl.hpp:2331
Tpetra::DistObject
Base class for distributed Tpetra objects that support data redistribution.
Definition: Tpetra_DistObject_decl.hpp:329
Tpetra::CrsGraph::num_row_entries_type
Kokkos::View< size_t *, Kokkos::LayoutLeft, device_type >::HostMirror num_row_entries_type
The type of k_numRowEntries_ (see below).
Definition: Tpetra_CrsGraph_decl.hpp:2500
Tpetra::CrsGraph::haveGlobalConstants_
bool haveGlobalConstants_
Whether all processes have computed global constants.
Definition: Tpetra_CrsGraph_decl.hpp:2550
Details
Implementation details of Tpetra.
Tpetra::CrsGraph::expertStaticFillComplete
void expertStaticFillComplete(const Teuchos::RCP< const map_type > &domainMap, const Teuchos::RCP< const map_type > &rangeMap, const Teuchos::RCP< const import_type > &importer=Teuchos::null, const Teuchos::RCP< const export_type > &exporter=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Perform a fillComplete on a graph that already has data, via setAllIndices().
Definition: Tpetra_CrsGraph_def.hpp:4050
Tpetra::CrsGraph::computeLocalConstants
void computeLocalConstants(const bool computeLocalTriangularConstants)
Compute local constants, if they have not yet been computed.
Definition: Tpetra_CrsGraph_def.hpp:4946
Tpetra::CrsGraph::k_lclInds1D_
local_graph_type::entries_type::non_const_type k_lclInds1D_
Local column indices for all rows.
Definition: Tpetra_CrsGraph_decl.hpp:2413
Tpetra::CrsGraph::checkSizes
virtual bool checkSizes(const SrcDistObject &source) override
Compare the source and target (this) objects for compatibility.
Definition: Tpetra_CrsGraph_def.hpp:5613
Tpetra::CrsGraph< LO, GO, node_type >::execution_space
typename device_type::execution_space execution_space
This class' Kokkos execution space.
Definition: Tpetra_CrsGraph_decl.hpp:297
Tpetra::CrsGraph::getGlobalMaxNumRowEntries
size_t getGlobalMaxNumRowEntries() const override
Maximum number of entries in any row of the graph, over all processes in the graph's communicator.
Definition: Tpetra_CrsGraph_def.hpp:1254
Tpetra::CrsGraph::getNumEntriesInLocalRow
size_t getNumEntriesInLocalRow(local_ordinal_type localRow) const override
Get the number of entries in the given row (local index).
Definition: Tpetra_CrsGraph_def.hpp:2854
Tpetra::CrsGraph::~CrsGraph
virtual ~CrsGraph()=default
Destructor (virtual for memory safety of derived classes).
Tpetra::CrsGraph::k_rowPtrs_
local_graph_type::row_map_type::const_type k_rowPtrs_
Row offsets for "1-D" storage.
Definition: Tpetra_CrsGraph_decl.hpp:2451
Tpetra::CrsGraph::noRedundancies_
bool noRedundancies_
Whether the graph's indices are non-redundant (merged) in each row, on this process.
Definition: Tpetra_CrsGraph_decl.hpp:2546
Tpetra::CrsGraph::getRowInfoFromGlobalRowIndex
RowInfo getRowInfoFromGlobalRowIndex(const global_ordinal_type gblRow) const
Get information about the locally owned row with global index gblRow.
Definition: Tpetra_CrsGraph_def.hpp:2031
Tpetra::CrsGraph::insertGlobalIndicesIntoNonownedRows
void insertGlobalIndicesIntoNonownedRows(const global_ordinal_type gblRow, const global_ordinal_type gblColInds[], const local_ordinal_type numGblColInds)
Implementation of insertGlobalIndices for nonowned rows.
Definition: Tpetra_CrsGraph_def.hpp:3401
Tpetra::CrsGraph< LO, GO, node_type >::local_ordinal_type
LO local_ordinal_type
The type of the graph's local indices.
Definition: Tpetra_CrsGraph_decl.hpp:291
Tpetra::exportAndFillCompleteCrsGraph
Teuchos::RCP< CrsGraphType > exportAndFillCompleteCrsGraph(const Teuchos::RCP< const CrsGraphType > &sourceGraph, const Export< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > &exporter, const Teuchos::RCP< const Map< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Nonmember CrsGraph constructor that fuses Export and fillComplete().
Definition: Tpetra_CrsGraph_decl.hpp:2767
Tpetra::CrsGraph::swap
void swap(CrsGraph< local_ordinal_type, global_ordinal_type, Node > &graph)
Swaps the data from *this with the data and maps from graph.
Definition: Tpetra_CrsGraph_def.hpp:7894
Tpetra::CrsGraph::replaceColMap
void replaceColMap(const Teuchos::RCP< const map_type > &newColMap)
Replace the graph's current column Map with the given Map.
Definition: Tpetra_CrsGraph_def.hpp:4543
Tpetra::CrsGraph::globalNumEntries_
global_size_t globalNumEntries_
Global number of entries in the graph.
Definition: Tpetra_CrsGraph_decl.hpp:2349
Tpetra::CrsGraph::getGlobalNumCols
global_size_t getGlobalNumCols() const override
Returns the number of global columns in the graph.
Definition: Tpetra_CrsGraph_def.hpp:1010
Tpetra::CrsGraph::getGlobalViewNonConst
Teuchos::ArrayView< global_ordinal_type > getGlobalViewNonConst(const RowInfo &rowinfo)
Get a nonconst, nonowned, globally indexed view of the locally owned row myRow, such that rowinfo = g...
Definition: Tpetra_CrsGraph_def.hpp:1936
Tpetra::CrsGraph::isSorted
bool isSorted() const
Whether graph indices in all rows are known to be sorted.
Definition: Tpetra_CrsGraph_def.hpp:1419
Tpetra::CrsGraph::pftype_
ProfileType pftype_
Whether the graph was allocated with static or dynamic profile.
Definition: Tpetra_CrsGraph_decl.hpp:2362
Tpetra::CrsGraph::isFillActive
bool isFillActive() const
Whether resumeFill() has been called and the graph is in edit mode.
Definition: Tpetra_CrsGraph_def.hpp:1284
Tpetra::CrsGraph::CrsGraph
CrsGraph(CrsGraph< local_ordinal_type, global_ordinal_type, node_type > &&)=default
Move constructor (default).
Tpetra::CrsGraph::getNodeAllocationSize
size_t getNodeAllocationSize() const
The local number of indices allocated for the graph, over all rows on the calling (MPI) process.
Definition: Tpetra_CrsGraph_def.hpp:1342
Tpetra::FECrsGraph
A distributed graph accessed by rows (adjacency lists) and stored sparsely.
Definition: Tpetra_FECrsGraph_decl.hpp:82
Tpetra::CrsGraph::storageStatus_
::Tpetra::Details::EStorageStatus storageStatus_
Status of the graph's storage, when not in a fill-complete state.
Definition: Tpetra_CrsGraph_decl.hpp:2531
Tpetra::CrsGraph::description
std::string description() const override
Return a one-line human-readable description of this object.
Definition: Tpetra_CrsGraph_def.hpp:5471
Tpetra_CrsMatrix_fwd.hpp
Forward declaration of Tpetra::CrsMatrix.
Tpetra::Details::getGlobalNumDiags
CrsGraphType::global_ordinal_type getGlobalNumDiags(const CrsGraphType &G)
Number of populated diagonal entries in the given sparse graph, over all processes in the graph's (MP...
Definition: Tpetra_Details_getNumDiags.hpp:406
Tpetra::CrsGraph::getNumEntriesPerLocalRowUpperBound
void getNumEntriesPerLocalRowUpperBound(Teuchos::ArrayRCP< const size_t > &boundPerLocalRow, size_t &boundForAllLocalRows, bool &boundSameForAllLocalRows) const
Get an upper bound on the number of entries that can be stored in each row.
Definition: Tpetra_CrsGraph_def.hpp:3576
Tpetra::CrsGraph::getGlobalView
Teuchos::ArrayView< const global_ordinal_type > getGlobalView(const RowInfo &rowinfo) const
Get a const, nonowned, globally indexed view of the locally owned row myRow, such that rowinfo = getR...
Definition: Tpetra_CrsGraph_def.hpp:1866
Tpetra::CrsGraph::operator=
CrsGraph & operator=(const CrsGraph< local_ordinal_type, global_ordinal_type, node_type > &)=default
Assignment operator (default).
Tpetra::CrsGraph::computeGlobalConstants
void computeGlobalConstants(const bool computeLocalTriangularConstants)
Compute global constants, if they have not yet been computed.
Definition: Tpetra_CrsGraph_def.hpp:4882
Tpetra::CrsGraph< LO, GO, node_type >::node_type
node_type node_type
This class' Kokkos Node type.
Definition: Tpetra_CrsGraph_decl.hpp:303
Tpetra::CrsGraph::reindexColumns
void reindexColumns(const Teuchos::RCP< const map_type > &newColMap, const Teuchos::RCP< const import_type > &newImport=Teuchos::null, const bool sortIndicesInEachRow=true)
Reindex the column indices in place, and replace the column Map. Optionally, replace the Import objec...
Definition: Tpetra_CrsGraph_def.hpp:4562
Tpetra::CrsGraph::isLocallyIndexed
bool isLocallyIndexed() const override
Whether the graph's column indices are stored as local indices.
Definition: Tpetra_CrsGraph_def.hpp:1326
Tpetra::Distributor
Sets up and executes a communication plan for a Tpetra DistObject.
Definition: Tpetra_Distributor.hpp:192
Tpetra::CrsGraph::getProfileType
ProfileType getProfileType() const
Returns true if the graph was allocated with static data structures.
Definition: Tpetra_CrsGraph_def.hpp:1178
Tpetra::CrsGraph::getExporter
Teuchos::RCP< const export_type > getExporter() const override
Returns the exporter associated with this graph.
Definition: Tpetra_CrsGraph_def.hpp:1140
Tpetra::CrsGraph::getNodeNumEntries
size_t getNodeNumEntries() const override
The local number of entries in the graph.
Definition: Tpetra_CrsGraph_def.hpp:1200
Tpetra::CrsGraph< LO, GO, node_type >::device_type
typename Node::device_type device_type
This class' Kokkos device type.
Definition: Tpetra_CrsGraph_decl.hpp:295
Tpetra::CrsGraph::import_type
::Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > import_type
The Import specialization used by this class.
Definition: Tpetra_CrsGraph_decl.hpp:323
Tpetra_Util.hpp
Stand-alone utility functions and macros.
Tpetra::CrsGraph::getNumAllocatedEntriesInGlobalRow
size_t getNumAllocatedEntriesInGlobalRow(global_ordinal_type globalRow) const
Current number of allocated entries in the given row on the calling (MPI) process,...
Definition: Tpetra_CrsGraph_def.hpp:2869
Tpetra::CrsGraph::useAtomicUpdatesByDefault
static const bool useAtomicUpdatesByDefault
Whether transformLocalValues should use atomic updates by default.
Definition: Tpetra_CrsGraph_decl.hpp:2040
Tpetra::CrsGraph::domainMap_
Teuchos::RCP< const map_type > domainMap_
The Map describing the domain of the (matrix corresponding to the) graph.
Definition: Tpetra_CrsGraph_decl.hpp:2316
Tpetra::CrsGraph::insertLocalIndices
void insertLocalIndices(const local_ordinal_type localRow, const Teuchos::ArrayView< const local_ordinal_type > &indices)
Insert local indices into the graph.
Definition: Tpetra_CrsGraph_def.hpp:3157
Tpetra::CrsGraph::getGlobalNumRows
global_size_t getGlobalNumRows() const override
Returns the number of global rows in the graph.
Definition: Tpetra_CrsGraph_def.hpp:1002
Tpetra::CrsGraph::getGlobalRowCopy
void getGlobalRowCopy(global_ordinal_type gblRow, const Teuchos::ArrayView< global_ordinal_type > &gblColInds, size_t &numColInds) const override
Get a copy of the given row, using global indices.
Definition: Tpetra_CrsGraph_def.hpp:3037
Tpetra::CrsGraph::getComm
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const override
Returns the communicator.
Definition: Tpetra_CrsGraph_def.hpp:1395
Tpetra::CrsGraph::setLocallyModified
void setLocallyModified()
Report that we made a local modification to its structure.
Definition: Tpetra_CrsGraph_def.hpp:1435
Tpetra::CrsGraph::getGlobalNumEntries
global_size_t getGlobalNumEntries() const override
Returns the global number of entries in the graph.
Definition: Tpetra_CrsGraph_def.hpp:1186
Tpetra::CrsGraph::globalMaxNumRowEntries_
global_size_t globalMaxNumRowEntries_
Global maximum of the number of entries in each row.
Definition: Tpetra_CrsGraph_decl.hpp:2359
Tpetra::CrsGraph::numAllocForAllRows_
size_t numAllocForAllRows_
The maximum number of entries to allow in each locally owned row.
Definition: Tpetra_CrsGraph_decl.hpp:2401
Tpetra::CrsGraph::k_numRowEntries_
num_row_entries_type k_numRowEntries_
The number of local entries in each locally owned row.
Definition: Tpetra_CrsGraph_decl.hpp:2518
Tpetra::CrsGraph::exportAndFillComplete
void exportAndFillComplete(Teuchos::RCP< CrsGraph< local_ordinal_type, global_ordinal_type, Node > > &destGraph, const export_type &exporter, const Teuchos::RCP< const map_type > &domainMap=Teuchos::null, const Teuchos::RCP< const map_type > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null) const
Export from this to the given destination graph, and make the result fill complete.
Definition: Tpetra_CrsGraph_def.hpp:7868
Tpetra::CrsGraph::getLocalGraph
local_graph_type getLocalGraph() const
Get the local graph.
Definition: Tpetra_CrsGraph_def.hpp:4874
Tpetra::CrsGraph::colMap_
Teuchos::RCP< const map_type > colMap_
The Map describing the distribution of columns of the graph.
Definition: Tpetra_CrsGraph_decl.hpp:2312
Tpetra::CrsGraph::importAndFillComplete
void importAndFillComplete(Teuchos::RCP< CrsGraph< local_ordinal_type, global_ordinal_type, Node > > &destGraph, const import_type &importer, const Teuchos::RCP< const map_type > &domainMap, const Teuchos::RCP< const map_type > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null) const
Import from this to the given destination graph, and make the result fill complete.
Definition: Tpetra_CrsGraph_def.hpp:7843
Tpetra::CrsGraph::isFillComplete
bool isFillComplete() const override
Whether fillComplete() has been called and the graph is in compute mode.
Definition: Tpetra_CrsGraph_def.hpp:1276
Tpetra::CrsGraph::getLocalViewNonConst
Teuchos::ArrayView< local_ordinal_type > getLocalViewNonConst(const RowInfo &rowinfo)
Get a nonconst, nonowned, locally indexed view of the locally owned row myRow, such that rowinfo = ge...
Definition: Tpetra_CrsGraph_def.hpp:1699
Tpetra::createCrsGraph
Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > createCrsGraph(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t maxNumEntriesPerRow=0, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Nonmember function to create an empty CrsGraph given a row Map and the max number of entries allowed ...
Definition: Tpetra_CrsGraph_decl.hpp:2583
Tpetra::CrsGraph::getLocalRowCopy
void getLocalRowCopy(local_ordinal_type lclRow, const Teuchos::ArrayView< local_ordinal_type > &lclColInds, size_t &numColInds) const override
Get a copy of the given row, using local indices.
Definition: Tpetra_CrsGraph_def.hpp:2989
Tpetra::CrsGraph
A distributed graph accessed by rows (adjacency lists) and stored sparsely.
Definition: Tpetra_CrsGraph_decl.hpp:278
Tpetra::CrsGraph< LO, GO, node_type >::local_graph_type
Kokkos::StaticCrsGraph< local_ordinal_type, Kokkos::LayoutLeft, execution_space > local_graph_type
The type of the part of the sparse graph on each MPI process.
Definition: Tpetra_CrsGraph_decl.hpp:308
Tpetra::Details::unpackCrsGraphAndCombine
void unpackCrsGraphAndCombine(CrsGraph< LO, GO, NT > &sourceGraph, const Teuchos::ArrayView< const typename CrsGraph< LO, GO, NT >::packet_type > &imports, const Teuchos::ArrayView< const size_t > &numPacketsPerLID, const Teuchos::ArrayView< const LO > &importLIDs, size_t constantNumPackets, Distributor &distor, CombineMode combineMode)
Unpack the imported column indices and combine into graph.
Tpetra::DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node >::buffer_device_type
Kokkos::Device< typename device_type::execution_space, buffer_memory_space > buffer_device_type
Kokkos::Device specialization for communication buffers.
Definition: Tpetra_DistObject_decl.hpp:742
Tpetra::CrsGraph::getIndexBase
global_ordinal_type getIndexBase() const override
Returns the index base for global indices for this graph.
Definition: Tpetra_CrsGraph_def.hpp:1403
Tpetra::CrsGraph::globalAssemble
void globalAssemble()
Communicate nonlocal contributions to other processes.
Definition: Tpetra_CrsGraph_def.hpp:3685
Tpetra::CrsGraph::getLocalViewRawConst
local_ordinal_type getLocalViewRawConst(const local_ordinal_type *&lclInds, local_ordinal_type &capacity, const RowInfo &rowInfo) const
Get a pointer to the local column indices of a locally owned row, using the result of getRowInfo.
Definition: Tpetra_CrsGraph_def.hpp:1655
Tpetra::CrsGraph::gblInds2D_
Teuchos::ArrayRCP< Teuchos::Array< global_ordinal_type > > gblInds2D_
Global column indices for all rows.
Definition: Tpetra_CrsGraph_decl.hpp:2491
Tpetra::CrsGraph::setDomainRangeMaps
void setDomainRangeMaps(const Teuchos::RCP< const map_type > &domainMap, const Teuchos::RCP< const map_type > &rangeMap)
Definition: Tpetra_CrsGraph_def.hpp:2529
Tpetra::CrsGraph::getGlobalRowView
void getGlobalRowView(const global_ordinal_type gblRow, Teuchos::ArrayView< const global_ordinal_type > &gblColInds) const override
Get a const, non-persisting view of the given global row's global column indices, as a Teuchos::Array...
Definition: Tpetra_CrsGraph_def.hpp:3118
Tpetra::CrsGraph::removeLocalIndices
void removeLocalIndices(local_ordinal_type localRow)
Remove all graph indices from the specified local row.
Definition: Tpetra_CrsGraph_def.hpp:3420
Tpetra::CrsGraph::nodeMaxNumRowEntries_
size_t nodeMaxNumRowEntries_
Local maximum of the number of entries in each row.
Definition: Tpetra_CrsGraph_decl.hpp:2344
Tpetra::CrsGraph::getNodeRowPtrs
Teuchos::ArrayRCP< const size_t > getNodeRowPtrs() const
Get a host view of the row offsets.
Definition: Tpetra_CrsGraph_def.hpp:2899
Tpetra::CrsGraph::getNodeNumCols
size_t getNodeNumCols() const override
Returns the number of columns connected to the locally owned rows of this graph.
Definition: Tpetra_CrsGraph_def.hpp:1033
Tpetra::CrsGraph::replaceDomainMapAndImporter
void replaceDomainMapAndImporter(const Teuchos::RCP< const map_type > &newDomainMap, const Teuchos::RCP< const import_type > &newImporter)
Replace the current domain Map and Import with the given parameters.
Definition: Tpetra_CrsGraph_def.hpp:4831
Tpetra::CrsGraph::indicesAreSorted_
bool indicesAreSorted_
Whether the graph's indices are sorted in each row, on this process.
Definition: Tpetra_CrsGraph_decl.hpp:2543
Tpetra::CrsGraph::export_type
::Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node > export_type
The Export specialization used by this class.
Definition: Tpetra_CrsGraph_decl.hpp:325
Tpetra::CrsGraph::lclInds2D_
Teuchos::ArrayRCP< Teuchos::Array< local_ordinal_type > > lclInds2D_
Local column indices for all rows.
Definition: Tpetra_CrsGraph_decl.hpp:2478
Tpetra::CrsGraph::getRangeMap
Teuchos::RCP< const map_type > getRangeMap() const override
Returns the Map associated with the domain of this graph.
Definition: Tpetra_CrsGraph_def.hpp:1124
Tpetra::global_size_t
size_t global_size_t
Global size_t object.
Definition: Tpetra_ConfigDefs.hpp:109
Tpetra::CrsGraph::isStorageOptimized
bool isStorageOptimized() const
Returns true if storage has been optimized.
Definition: Tpetra_CrsGraph_def.hpp:1156
Tpetra::CrsGraph< LO, GO, node_type >::buffer_device_type
typename dist_object_type::buffer_device_type buffer_device_type
Kokkos::Device specialization for communication buffers.
Definition: Tpetra_CrsGraph_decl.hpp:1304
Tpetra::CrsGraph::getNumAllocatedEntriesInLocalRow
size_t getNumAllocatedEntriesInLocalRow(local_ordinal_type localRow) const
Current number of allocated entries in the given row on the calling (MPI) process,...
Definition: Tpetra_CrsGraph_def.hpp:2884
Tpetra
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Tpetra::CrsGraph::findLocalIndices
size_t findLocalIndices(const RowInfo &rowInfo, const Teuchos::ArrayView< const local_ordinal_type > &indices, std::function< void(const size_t, const size_t, const size_t)> fun) const
Finds indices in the given row.
Definition: Tpetra_CrsGraph_def.hpp:2411
Tpetra::CrsGraph::getLocalView
Teuchos::ArrayView< const local_ordinal_type > getLocalView(const RowInfo &rowinfo) const
Get a const, nonowned, locally indexed view of the locally owned row myRow, such that rowinfo = getRo...
Definition: Tpetra_CrsGraph_def.hpp:1619
Tpetra::CrsGraph::supportsRowViews
bool supportsRowViews() const override
Whether this class implements getLocalRowView() and getGlobalRowView() (it does).
Definition: Tpetra_CrsGraph_def.hpp:7182
Tpetra::SrcDistObject
Abstract base class for objects that can be the source of an Import or Export operation.
Definition: Tpetra_SrcDistObject.hpp:89
Tpetra::CrsGraph::nodeNumDiags_
size_t nodeNumDiags_
Local number of (populated) diagonal entries.
Definition: Tpetra_CrsGraph_decl.hpp:2339
Tpetra::CrsGraph::checkInternalState
void checkInternalState() const
Throw an exception if the internal state is not consistent.
Definition: Tpetra_CrsGraph_def.hpp:2559
Tpetra::CrsGraph::getColMap
Teuchos::RCP< const map_type > getColMap() const override
Returns the Map that describes the column distribution in this graph.
Definition: Tpetra_CrsGraph_def.hpp:1108
Tpetra::CrsGraph::resumeFill
void resumeFill(const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Resume fill operations.
Definition: Tpetra_CrsGraph_def.hpp:3847
Tpetra::CrsGraph::getGlobalViewRawConst
local_ordinal_type getGlobalViewRawConst(const global_ordinal_type *&gblInds, local_ordinal_type &capacity, const RowInfo &rowInfo) const
Get a pointer to the global column indices of a locally owned row, using the result of getRowInfoFrom...
Definition: Tpetra_CrsGraph_def.hpp:1893
Tpetra::CrsGraph::isIdenticalTo
bool isIdenticalTo(const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > &graph) const
Create a cloned CrsGraph for a different Node type.
Definition: Tpetra_CrsGraph_def.hpp:7949
Tpetra::CrsGraph::k_gblInds1D_
t_GlobalOrdinal_1D k_gblInds1D_
Global column indices for all rows.
Definition: Tpetra_CrsGraph_decl.hpp:2425
Tpetra::CrsGraph::insertGlobalIndices
void insertGlobalIndices(const global_ordinal_type globalRow, const Teuchos::ArrayView< const global_ordinal_type > &indices)
Insert global indices into the graph.
Definition: Tpetra_CrsGraph_def.hpp:3326
Tpetra::importAndFillCompleteCrsGraph
Teuchos::RCP< CrsGraphType > importAndFillCompleteCrsGraph(const Teuchos::RCP< const CrsGraphType > &sourceGraph, const Import< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > &importer, const Teuchos::RCP< const Map< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Nonmember CrsGraph constructor that fuses Import and fillComplete().
Definition: Tpetra_CrsGraph_decl.hpp:2643
Tpetra::CrsGraph::setParameterList
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &params) override
Set the given list of parameters (must be nonnull).
Definition: Tpetra_CrsGraph_def.hpp:991
Tpetra::RowGraph
An abstract interface for graphs accessed by rows.
Definition: Tpetra_RowGraph_decl.hpp:71
Tpetra::CrsGraph::insertGlobalIndicesImpl
size_t insertGlobalIndicesImpl(const local_ordinal_type lclRow, const global_ordinal_type inputGblColInds[], const size_t numInputInds)
Insert global indices, using an input local row index.
Definition: Tpetra_CrsGraph_def.hpp:2258
Tpetra::CrsGraph::getNumEntriesInGlobalRow
size_t getNumEntriesInGlobalRow(global_ordinal_type globalRow) const override
Returns the current number of entries on this node in the specified global row.
Definition: Tpetra_CrsGraph_def.hpp:2839
Tpetra::CrsGraph::fillComplete
void fillComplete(const Teuchos::RCP< const map_type > &domainMap, const Teuchos::RCP< const map_type > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Tell the graph that you are done changing its structure.
Definition: Tpetra_CrsGraph_def.hpp:3890
Tpetra::Details::EStorageStatus
EStorageStatus
Status of the graph's or matrix's storage, when not in a fill-complete state.
Definition: Tpetra_CrsGraph_decl.hpp:180
Tpetra::CrsGraph::getRowInfo
RowInfo getRowInfo(const local_ordinal_type myRow) const
Get information about the locally owned row with local index myRow.
Definition: Tpetra_CrsGraph_def.hpp:1963
Tpetra::CombineMode
CombineMode
Rule for combining data in an Import or Export.
Definition: Tpetra_CombineMode.hpp:94
Tpetra::CrsGraph::getImporter
Teuchos::RCP< const import_type > getImporter() const override
Returns the importer associated with this graph.
Definition: Tpetra_CrsGraph_def.hpp:1132