MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu::MueLuGraphBaseAdapter< User, UserCoord > Class Template Reference

#include <MueLu_Zoltan2GraphAdapter.hpp>

Inheritance diagram for MueLu::MueLuGraphBaseAdapter< User, UserCoord >:

Public Member Functions

const Teuchos::RCP< const Teuchos::Comm< int > > getComm () const
 MueLu::GraphBase Compatibility Layer.
 
const Teuchos::RCP< const Xpetra::Map< lno_t, gno_t, node_t > > getRowMap () const
 
const RCP< const Xpetra::Map< lno_t, gno_t, node_t > > getColMap () const
 
size_t getLocalNumEntries () const
 
size_t getLocalNumRows () const
 
size_t getLocalNumCols () const
 
void getLocalRowView (lno_t LocalRow, Teuchos::ArrayView< const lno_t > &indices) const
 
 ~MueLuGraphBaseAdapter ()
 Destructor.
 
 MueLuGraphBaseAdapter (const RCP< const User > &ingraph, int nVtxWeights=0, int nEdgeWeights=0)
 Constructor for graph with no weights or coordinates.
 
void setWeights (const scalar_t *val, int stride, int idx)
 Provide a pointer to weights for the primary entity type.
 
void setVertexWeights (const scalar_t *val, int stride, int idx)
 Provide a pointer to vertex weights.
 
void setWeightIsDegree (int idx)
 Specify an index for which the weight should be the degree of the entity.
 
void setVertexWeightIsDegree (int idx)
 Specify an index for which the vertex weight should be the degree of the vertex.
 
void setEdgeWeights (const scalar_t *val, int stride, int idx)
 Provide a pointer to edge weights.
 
RCP< const xgraph_t > getXpetraGraph () const
 Access to Xpetra-wrapped user's graph.
 
RCP< const User > getUserGraph () const
 Access to user's graph.
 
size_t getLocalNumVertices () const
 
void getVertexIDsView (const gno_t *&ids) const
 
size_t getLocalNumEdges () const
 
void getEdgesView (const offset_t *&offsets, const gno_t *&adjIds) const
 
int getNumWeightsPerVertex () const
 
void getVertexWeightsView (const scalar_t *&weights, int &stride, int idx) const
 
bool useDegreeAsVertexWeight (int idx) const
 
int getNumWeightsPerEdge () const
 
void getEdgeWeightsView (const scalar_t *&weights, int &stride, int idx) const
 
template<typename Adapter >
void applyPartitioningSolution (const User &in, User *&out, const Zoltan2::PartitioningSolution< Adapter > &solution) const
 
template<typename Adapter >
void applyPartitioningSolution (const User &in, RCP< User > &out, const Zoltan2::PartitioningSolution< Adapter > &solution) const
 

Private Attributes

RCP< const User > ingraph_
 
RCP< const xgraph_t > graph_
 
RCP< const Teuchos::Comm< int > > comm_
 
ArrayRCP< const offset_t > offs_
 
ArrayRCP< const gno_t > adjids_
 
int nWeightsPerVertex_
 
ArrayRCP< Zoltan2::StridedData< lno_t, scalar_t > > vertexWeights_
 
ArrayRCP< bool > vertexDegreeWeight_
 
int nWeightsPerEdge_
 
ArrayRCP< Zoltan2::StridedData< lno_t, scalar_t > > edgeWeights_
 
int coordinateDim_
 
ArrayRCP< Zoltan2::StridedData< lno_t, scalar_t > > coords_
 

Detailed Description

template<typename User, typename UserCoord = User>
class MueLu::MueLuGraphBaseAdapter< User, UserCoord >

Definition at line 90 of file MueLu_Zoltan2GraphAdapter.hpp.

Constructor & Destructor Documentation

◆ ~MueLuGraphBaseAdapter()

template<typename User , typename UserCoord = User>
MueLu::MueLuGraphBaseAdapter< User, UserCoord >::~MueLuGraphBaseAdapter ( )
inline

Destructor.

Definition at line 127 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ MueLuGraphBaseAdapter()

template<typename User , typename UserCoord >
MueLu::MueLuGraphBaseAdapter< User, UserCoord >::MueLuGraphBaseAdapter ( const RCP< const User > &  ingraph,
int  nVtxWeights = 0,
int  nEdgeWeights = 0 
)

Constructor for graph with no weights or coordinates.

Parameters
ingraphthe Epetra_CrsGraph, Tpetra::CrsGraph or Xpetra::CrsGraph
numVtxWeightsthe number of weights per vertex (default = 0)
numEdgeWeightsthe number of weights per edge (default = 0)

Most adapters do not have RCPs in their interface. This one does because the user is obviously a Trilinos user.

Definition at line 323 of file MueLu_Zoltan2GraphAdapter.hpp.

Member Function Documentation

◆ getComm()

template<typename User , typename UserCoord = User>
const Teuchos::RCP< const Teuchos::Comm< int > > MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getComm ( ) const
inline

MueLu::GraphBase Compatibility Layer.

Definition at line 106 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getRowMap()

template<typename User , typename UserCoord = User>
const Teuchos::RCP< const Xpetra::Map< lno_t, gno_t, node_t > > MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getRowMap ( ) const
inline

Definition at line 107 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getColMap()

template<typename User , typename UserCoord = User>
const RCP< const Xpetra::Map< lno_t, gno_t, node_t > > MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getColMap ( ) const
inline

Definition at line 108 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getLocalNumEntries()

template<typename User , typename UserCoord = User>
size_t MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getLocalNumEntries ( ) const
inline

Definition at line 115 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getLocalNumRows()

template<typename User , typename UserCoord = User>
size_t MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getLocalNumRows ( ) const
inline

Definition at line 116 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getLocalNumCols()

template<typename User , typename UserCoord = User>
size_t MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getLocalNumCols ( ) const
inline

Definition at line 117 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getLocalRowView()

template<typename User , typename UserCoord = User>
void MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getLocalRowView ( lno_t  LocalRow,
Teuchos::ArrayView< const lno_t > &  indices 
) const
inline

Definition at line 119 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ setWeights()

template<typename User , typename UserCoord >
void MueLu::MueLuGraphBaseAdapter< User, UserCoord >::setWeights ( const scalar_t *  val,
int  stride,
int  idx 
)

Provide a pointer to weights for the primary entity type.

Parameters
valA pointer to the weights for index idx.
strideA stride for the val array. If \stride is k, then val[n * k] is the weight for the n th entity for index \idx.
idxA number from 0 to one less than weight idx specified in the constructor.

The order of the weights should match the order that entities appear in the input data structure.

Definition at line 372 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ setVertexWeights()

template<typename User , typename UserCoord >
void MueLu::MueLuGraphBaseAdapter< User, UserCoord >::setVertexWeights ( const scalar_t *  val,
int  stride,
int  idx 
)

Provide a pointer to vertex weights.

Parameters
valA pointer to the weights for index idx.
strideA stride for the val array. If \stride is k, then val[n * k] is the weight for the n th vertex for index \idx.
idxA number from 0 to one less than number of vertex weights specified in the constructor.

The order of the vertex weights should match the order that vertices appear in the input data structure.

TheGraph->getRowMap()->getLocalElementList()

Definition at line 383 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ setWeightIsDegree()

template<typename User , typename UserCoord >
void MueLu::MueLuGraphBaseAdapter< User, UserCoord >::setWeightIsDegree ( int  idx)

Specify an index for which the weight should be the degree of the entity.

Parameters
idxZoltan2 will use the entity's degree as the entity weight for index idx.

Definition at line 403 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ setVertexWeightIsDegree()

template<typename User , typename UserCoord >
void MueLu::MueLuGraphBaseAdapter< User, UserCoord >::setVertexWeightIsDegree ( int  idx)

Specify an index for which the vertex weight should be the degree of the vertex.

Parameters
idxZoltan2 will use the vertex's degree as the vertex weight for index idx.

Definition at line 419 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ setEdgeWeights()

template<typename User , typename UserCoord >
void MueLu::MueLuGraphBaseAdapter< User, UserCoord >::setEdgeWeights ( const scalar_t *  val,
int  stride,
int  idx 
)

Provide a pointer to edge weights.

Parameters
valA pointer to the weights for index idx.
strideA stride for the val array. If \stride is k, then val[n * k] is the weight for the n th edge for index \idx.
dimA number from 0 to one less than the number of edge weights specified in the constructor.

The order of the edge weights should follow the order that the the vertices and edges appear in the input data structure.

By vertex:

TheGraph->getRowMap()->getLocalElementList()

Then by vertex neighbor:

TheGraph->getLocalRowView(vertexNum, neighborList);

Definition at line 435 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getXpetraGraph()

template<typename User , typename UserCoord = User>
RCP< const xgraph_t > MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getXpetraGraph ( ) const
inline

Access to Xpetra-wrapped user's graph.

Definition at line 212 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getUserGraph()

template<typename User , typename UserCoord = User>
RCP< const User > MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getUserGraph ( ) const
inline

Access to user's graph.

Definition at line 216 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getLocalNumVertices()

template<typename User , typename UserCoord = User>
size_t MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getLocalNumVertices ( ) const
inline

Definition at line 228 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getVertexIDsView()

template<typename User , typename UserCoord = User>
void MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getVertexIDsView ( const gno_t *&  ids) const
inline

Definition at line 230 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getLocalNumEdges()

template<typename User , typename UserCoord = User>
size_t MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getLocalNumEdges ( ) const
inline

Definition at line 237 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getEdgesView()

template<typename User , typename UserCoord = User>
void MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getEdgesView ( const offset_t *&  offsets,
const gno_t *&  adjIds 
) const
inline

Definition at line 239 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getNumWeightsPerVertex()

template<typename User , typename UserCoord = User>
int MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getNumWeightsPerVertex ( ) const
inline

Definition at line 245 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getVertexWeightsView()

template<typename User , typename UserCoord = User>
void MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getVertexWeightsView ( const scalar_t *&  weights,
int &  stride,
int  idx 
) const
inline

Definition at line 247 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ useDegreeAsVertexWeight()

template<typename User , typename UserCoord = User>
bool MueLu::MueLuGraphBaseAdapter< User, UserCoord >::useDegreeAsVertexWeight ( int  idx) const
inline

Definition at line 263 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getNumWeightsPerEdge()

template<typename User , typename UserCoord = User>
int MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getNumWeightsPerEdge ( ) const
inline

Definition at line 265 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ getEdgeWeightsView()

template<typename User , typename UserCoord = User>
void MueLu::MueLuGraphBaseAdapter< User, UserCoord >::getEdgeWeightsView ( const scalar_t *&  weights,
int &  stride,
int  idx 
) const
inline

Definition at line 267 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ applyPartitioningSolution() [1/2]

template<typename User , typename UserCoord = User>
template<typename Adapter >
void MueLu::MueLuGraphBaseAdapter< User, UserCoord >::applyPartitioningSolution ( const User &  in,
User *&  out,
const Zoltan2::PartitioningSolution< Adapter > &  solution 
) const
inline

Definition at line 284 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ applyPartitioningSolution() [2/2]

template<typename User , typename UserCoord = User>
template<typename Adapter >
void MueLu::MueLuGraphBaseAdapter< User, UserCoord >::applyPartitioningSolution ( const User &  in,
RCP< User > &  out,
const Zoltan2::PartitioningSolution< Adapter > &  solution 
) const
inline

Definition at line 290 of file MueLu_Zoltan2GraphAdapter.hpp.

Member Data Documentation

◆ ingraph_

template<typename User , typename UserCoord = User>
RCP<const User > MueLu::MueLuGraphBaseAdapter< User, UserCoord >::ingraph_
private

Definition at line 298 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ graph_

template<typename User , typename UserCoord = User>
RCP<const xgraph_t > MueLu::MueLuGraphBaseAdapter< User, UserCoord >::graph_
private

Definition at line 299 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ comm_

template<typename User , typename UserCoord = User>
RCP<const Teuchos::Comm<int> > MueLu::MueLuGraphBaseAdapter< User, UserCoord >::comm_
private

Definition at line 300 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ offs_

template<typename User , typename UserCoord = User>
ArrayRCP<const offset_t> MueLu::MueLuGraphBaseAdapter< User, UserCoord >::offs_
private

Definition at line 302 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ adjids_

template<typename User , typename UserCoord = User>
ArrayRCP<const gno_t> MueLu::MueLuGraphBaseAdapter< User, UserCoord >::adjids_
private

Definition at line 303 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ nWeightsPerVertex_

template<typename User , typename UserCoord = User>
int MueLu::MueLuGraphBaseAdapter< User, UserCoord >::nWeightsPerVertex_
private

Definition at line 305 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ vertexWeights_

template<typename User , typename UserCoord = User>
ArrayRCP<Zoltan2::StridedData<lno_t, scalar_t> > MueLu::MueLuGraphBaseAdapter< User, UserCoord >::vertexWeights_
private

Definition at line 306 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ vertexDegreeWeight_

template<typename User , typename UserCoord = User>
ArrayRCP<bool> MueLu::MueLuGraphBaseAdapter< User, UserCoord >::vertexDegreeWeight_
private

Definition at line 307 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ nWeightsPerEdge_

template<typename User , typename UserCoord = User>
int MueLu::MueLuGraphBaseAdapter< User, UserCoord >::nWeightsPerEdge_
private

Definition at line 309 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ edgeWeights_

template<typename User , typename UserCoord = User>
ArrayRCP<Zoltan2::StridedData<lno_t, scalar_t> > MueLu::MueLuGraphBaseAdapter< User, UserCoord >::edgeWeights_
private

Definition at line 310 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ coordinateDim_

template<typename User , typename UserCoord = User>
int MueLu::MueLuGraphBaseAdapter< User, UserCoord >::coordinateDim_
private

Definition at line 312 of file MueLu_Zoltan2GraphAdapter.hpp.

◆ coords_

template<typename User , typename UserCoord = User>
ArrayRCP<Zoltan2::StridedData<lno_t, scalar_t> > MueLu::MueLuGraphBaseAdapter< User, UserCoord >::coords_
private

Definition at line 313 of file MueLu_Zoltan2GraphAdapter.hpp.


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