Tpetra parallel linear algebra Version of the Day
Loading...
Searching...
No Matches
Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node > Class Template Referenceabstract

An abstract interface for graphs accessed by rows. More...

#include <Tpetra_RowGraph_decl.hpp>

Inheritance diagram for Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >:

Public Member Functions

Graph query methods
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm () const =0
 The communicator over which this graph is distributed.
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap () const =0
 The Map that describes this graph's distribution of rows over processes.
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap () const =0
 The Map that describes this graph's distribution of columns over processes.
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap () const =0
 The Map associated with the domain of this graph.
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap () const =0
 The Map associated with the range of this graph.
virtual Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter () const =0
 This graph's Import object.
virtual Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter () const =0
 This graph's Export object.
virtual global_size_t getGlobalNumRows () const =0
 Returns the number of global rows in the graph.
virtual global_size_t getGlobalNumCols () const =0
 Returns the number of global columns in the graph.
virtual size_t getLocalNumRows () const =0
 Returns the number of rows owned on the calling node.
virtual size_t getLocalNumCols () const =0
 Returns the number of columns connected to the locally owned rows of this graph.
virtual GlobalOrdinal getIndexBase () const =0
 Returns the index base for global indices for this graph.
virtual global_size_t getGlobalNumEntries () const =0
 Returns the global number of entries in the graph.
virtual size_t getLocalNumEntries () const =0
 Returns the local number of entries in the graph.
virtual size_t getNumEntriesInGlobalRow (GlobalOrdinal globalRow) const =0
 Returns the current number of entries on this node in the specified global row.
virtual size_t getNumEntriesInLocalRow (LocalOrdinal localRow) const =0
 Returns the current number of entries on this node in the specified local row.
virtual size_t getGlobalMaxNumRowEntries () const =0
 Returns the maximum number of entries across all rows/columns on all nodes.
virtual size_t getLocalMaxNumRowEntries () const =0
 Returns the maximum number of entries across all rows/columns on this node.
virtual bool hasColMap () const =0
 Whether the graph has a well-defined column Map.
virtual bool isLocallyIndexed () const =0
 If graph indices are in the local range, this function returns true. Otherwise, this function returns false. *‍/.
virtual bool isGloballyIndexed () const =0
 If graph indices are in the global range, this function returns true. Otherwise, this function returns false. *‍/.
virtual bool isFillComplete () const =0
 Whether fillComplete() has been called (without an intervening resumeFill()).
Access to entries in a row
virtual void getGlobalRowCopy (const GlobalOrdinal gblRow, nonconst_global_inds_host_view_type &gblColInds, size_t &numColInds) const =0
 Get a copy of the global column indices in a given row of the graph.
virtual void getLocalRowCopy (const LocalOrdinal lclRow, nonconst_local_inds_host_view_type &lclColInds, size_t &numColInds) const =0
 Get a copy of the local column indices in a given row of the graph.
virtual bool supportsRowViews () const
 Whether this class implements getLocalRowView() and getGlobalRowView().
virtual void getLocalRowView (const LocalOrdinal lclRow, local_inds_host_view_type &lclColInds) const =0
 Get a constant, nonpersisting, locally indexed view of the given row of the graph.
virtual void getGlobalRowView (const GlobalOrdinal gblRow, global_inds_host_view_type &gblColInds) const =0
 Get a const, non-persisting view of the given global row's global column indices, as a Teuchos::ArrayView.
Implementation of Packable interface
virtual void pack (const Teuchos::ArrayView< const LocalOrdinal > &exportLIDs, Teuchos::Array< GlobalOrdinal > &exports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t &constantNumPackets) const
 Pack this object's data for Import or Export.

Typedefs

typedef LocalOrdinal local_ordinal_type
 The type of local indices in the graph.
typedef GlobalOrdinal global_ordinal_type
 The type of global indices in the graph.
typedef Node node_type
 The Kokkos Node type.
virtual ~RowGraph ()
 Destructor (virtual for memory safety of derived classes).

Detailed Description

template<class LocalOrdinal, class GlobalOrdinal, class Node>
class Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >

An abstract interface for graphs accessed by rows.

This class is to CrsGraph, what RowMatrix is to CrsMatrix. CrsGraph is an implementation of RowGraph.

Template Parameters
LocalOrdinalThe type of local indices. See the documentation of Map for requirements.
GlobalOrdinalThe type of global indices. See the documentation of Map for requirements.
NodeThe Kokkos Node type. See the documentation of Map for requirements.

Definition at line 37 of file Tpetra_RowGraph_decl.hpp.

Member Typedef Documentation

◆ local_ordinal_type

template<class LocalOrdinal, class GlobalOrdinal, class Node>
typedef LocalOrdinal Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::local_ordinal_type

The type of local indices in the graph.

Definition at line 44 of file Tpetra_RowGraph_decl.hpp.

◆ global_ordinal_type

template<class LocalOrdinal, class GlobalOrdinal, class Node>
typedef GlobalOrdinal Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::global_ordinal_type

The type of global indices in the graph.

Definition at line 46 of file Tpetra_RowGraph_decl.hpp.

◆ node_type

template<class LocalOrdinal, class GlobalOrdinal, class Node>
typedef Node Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::node_type

The Kokkos Node type.

Definition at line 48 of file Tpetra_RowGraph_decl.hpp.

Constructor & Destructor Documentation

◆ ~RowGraph()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::~RowGraph ( )
inlinevirtual

Destructor (virtual for memory safety of derived classes).

Definition at line 75 of file Tpetra_RowGraph_decl.hpp.

Member Function Documentation

◆ getComm()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual Teuchos::RCP< const Teuchos::Comm< int > > Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::getComm ( ) const
pure virtual

◆ getRowMap()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::getRowMap ( ) const
pure virtual

◆ getColMap()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::getColMap ( ) const
pure virtual

◆ getDomainMap()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::getDomainMap ( ) const
pure virtual

◆ getRangeMap()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::getRangeMap ( ) const
pure virtual

◆ getImporter()

◆ getExporter()

◆ getGlobalNumRows()

◆ getGlobalNumCols()

◆ getLocalNumRows()

◆ getLocalNumCols()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual size_t Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::getLocalNumCols ( ) const
pure virtual

◆ getIndexBase()

◆ getGlobalNumEntries()

◆ getLocalNumEntries()

◆ getNumEntriesInGlobalRow()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual size_t Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::getNumEntriesInGlobalRow ( GlobalOrdinal globalRow) const
pure virtual

Returns the current number of entries on this node in the specified global row.

Returns Teuchos::OrdinalTraits<size_t>::invalid() if the specified global row does not belong to this graph.

Implemented in Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >, Tpetra::device_type< LocalOrdinal, GlobalOrdinal, Node >, Tpetra::execution_space< LocalOrdinal, GlobalOrdinal, Node >, and Tpetra::local_graph_device_type< LocalOrdinal, GlobalOrdinal, Node >.

◆ getNumEntriesInLocalRow()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual size_t Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::getNumEntriesInLocalRow ( LocalOrdinal localRow) const
pure virtual

Returns the current number of entries on this node in the specified local row.

Returns Teuchos::OrdinalTraits<size_t>::invalid() if the specified local row is not valid for this graph.

Implemented in Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >, Tpetra::device_type< LocalOrdinal, GlobalOrdinal, Node >, Tpetra::execution_space< LocalOrdinal, GlobalOrdinal, Node >, and Tpetra::local_graph_device_type< LocalOrdinal, GlobalOrdinal, Node >.

◆ getGlobalMaxNumRowEntries()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual size_t Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::getGlobalMaxNumRowEntries ( ) const
pure virtual

◆ getLocalMaxNumRowEntries()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual size_t Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::getLocalMaxNumRowEntries ( ) const
pure virtual

◆ hasColMap()

◆ isLocallyIndexed()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual bool Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::isLocallyIndexed ( ) const
pure virtual

◆ isGloballyIndexed()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual bool Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::isGloballyIndexed ( ) const
pure virtual

◆ isFillComplete()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual bool Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::isFillComplete ( ) const
pure virtual

◆ getGlobalRowCopy()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual void Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::getGlobalRowCopy ( const GlobalOrdinal gblRow,
nonconst_global_inds_host_view_type & gblColInds,
size_t & numColInds ) const
pure virtual

Get a copy of the global column indices in a given row of the graph.

Given the global index of a row of the graph, get a copy of all the global column indices in that row that the calling process stores.

Parameters
gblRow[in] Global index of the row.
gblColInds[in/out] On output: All the global column indices in that row on the calling process.
numColInds[out] Number of indices in the row on the calling process.
Precondition
getRowMap()->isNodeGlobalElement(gblRow) is true.
gblColInds.size() >= getNumEntriesInGlobalRow(gblRow) is true.

Implemented in Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >, Tpetra::device_type< LocalOrdinal, GlobalOrdinal, Node >, Tpetra::execution_space< LocalOrdinal, GlobalOrdinal, Node >, and Tpetra::local_graph_device_type< LocalOrdinal, GlobalOrdinal, Node >.

◆ getLocalRowCopy()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual void Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::getLocalRowCopy ( const LocalOrdinal lclRow,
nonconst_local_inds_host_view_type & lclColInds,
size_t & numColInds ) const
pure virtual

Get a copy of the local column indices in a given row of the graph.

Given the local index of a row of the graph, get a copy of all the local column indices in that row that the calling process stores.

Parameters
lclRow[in] Local index of the row.
lclColInds[in/out] On output: All the local column indices in that row on the calling process.
numColInds[out] Number of indices in the row on the calling process.
Precondition
hasColMap() is true.
getRowMap()->isNodeLocalElement(lclRow) is true.
lclColInds.size() >= getNumEntriesInLocalRow(lclRow) is true.

Implemented in Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >, Tpetra::device_type< LocalOrdinal, GlobalOrdinal, Node >, Tpetra::execution_space< LocalOrdinal, GlobalOrdinal, Node >, and Tpetra::local_graph_device_type< LocalOrdinal, GlobalOrdinal, Node >.

◆ supportsRowViews()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual bool Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::supportsRowViews ( ) const
inlinevirtual

◆ getLocalRowView()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual void Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::getLocalRowView ( const LocalOrdinal lclRow,
local_inds_host_view_type & lclColInds ) const
pure virtual

Get a constant, nonpersisting, locally indexed view of the given row of the graph.

The returned views of the column indices are not guaranteed to persist beyond the lifetime of this. Furthermore, some RowGraph implementations allow changing the values, or the indices and values. Any such changes invalidate the returned views.

This method only gets the entries in the given row that are stored on the calling process. Note that if the graph has an overlapping row Map, it is possible that the calling process does not store all the entries in that row.

Precondition
isLocallyIndexed () && supportsRowViews ()
Postcondition
indices.size () == getNumEntriesInGlobalRow (LocalRow)
Parameters
lclRow[in] Local index of the row.
lclColInds[out] Local indices of the columns in the row. If the given row is not a valid row index on the calling process, then the result has no entries (its size is zero).

Subclasses are expected to implement this method. We would have made this method pure virtual, but that would have broken backwards compatibility, since we added the method at least one major release after introducing this class.

Implemented in Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >, Tpetra::device_type< LocalOrdinal, GlobalOrdinal, Node >, Tpetra::execution_space< LocalOrdinal, GlobalOrdinal, Node >, and Tpetra::local_graph_device_type< LocalOrdinal, GlobalOrdinal, Node >.

◆ getGlobalRowView()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
virtual void Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::getGlobalRowView ( const GlobalOrdinal gblRow,
global_inds_host_view_type & gblColInds ) const
pure virtual

Get a const, non-persisting view of the given global row's global column indices, as a Teuchos::ArrayView.

Parameters
gblRow[in] Global index of the row.
gblColInds[out] Global column indices in the row. If the given row is not a valid row index on the calling process, then the result has no entries (its size is zero).
Precondition
! isLocallyIndexed()
Postcondition
gblColInds.size() == getNumEntriesInGlobalRow(gblRow)

Subclasses are expected to implement this method. We would have made this method pure virtual, but that would have broken backwards compatibility, since we added the method at least one major release after introducing this class.

Implemented in Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >, Tpetra::device_type< LocalOrdinal, GlobalOrdinal, Node >, Tpetra::execution_space< LocalOrdinal, GlobalOrdinal, Node >, and Tpetra::local_graph_device_type< LocalOrdinal, GlobalOrdinal, Node >.

◆ pack()

template<class LocalOrdinal, class GlobalOrdinal, class Node>
void Tpetra::RowGraph< LocalOrdinal, GlobalOrdinal, Node >::pack ( const Teuchos::ArrayView< const LocalOrdinal > & exportLIDs,
Teuchos::Array< GlobalOrdinal > & exports,
const Teuchos::ArrayView< size_t > & numPacketsPerLID,
size_t & constantNumPackets ) const
virtual

The documentation for this class was generated from the following files: