MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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. More...
 
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. More...
 
 MueLuGraphBaseAdapter (const RCP< const User > &ingraph, int nVtxWeights=0, int nEdgeWeights=0)
 Constructor for graph with no weights or coordinates. More...
 
void setWeights (const scalar_t *val, int stride, int idx)
 Provide a pointer to weights for the primary entity type. More...
 
void setVertexWeights (const scalar_t *val, int stride, int idx)
 Provide a pointer to vertex weights. More...
 
void setWeightIsDegree (int idx)
 Specify an index for which the weight should be the degree of the entity. More...
 
void setVertexWeightIsDegree (int idx)
 Specify an index for which the vertex weight should be the degree of the vertex. More...
 
void setEdgeWeights (const scalar_t *val, int stride, int idx)
 Provide a pointer to edge weights. More...
 
RCP< const xgraph_t > getXpetraGraph () const
 Access to Xpetra-wrapped user's graph. More...
 
RCP< const User > getUserGraph () const
 Access to user's graph. More...
 
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 86 of file MueLu_Zoltan2GraphAdapter.hpp.

Constructor & Destructor Documentation

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

Destructor.

Definition at line 120 of file MueLu_Zoltan2GraphAdapter.hpp.

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 303 of file MueLu_Zoltan2GraphAdapter.hpp.

Member Function Documentation

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 101 of file MueLu_Zoltan2GraphAdapter.hpp.

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 102 of file MueLu_Zoltan2GraphAdapter.hpp.

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 103 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 110 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 111 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 112 of file MueLu_Zoltan2GraphAdapter.hpp.

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 114 of file MueLu_Zoltan2GraphAdapter.hpp.

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 is k, then val[n * k] is the weight for the n th entity for index .
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 357 of file MueLu_Zoltan2GraphAdapter.hpp.

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 is k, then val[n * k] is the weight for the n th vertex for index .
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 367 of file MueLu_Zoltan2GraphAdapter.hpp.

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 385 of file MueLu_Zoltan2GraphAdapter.hpp.

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 400 of file MueLu_Zoltan2GraphAdapter.hpp.

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 is k, then val[n * k] is the weight for the n th edge for index .
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 414 of file MueLu_Zoltan2GraphAdapter.hpp.

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 205 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Access to user's graph.

Definition at line 209 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 221 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 223 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 229 of file MueLu_Zoltan2GraphAdapter.hpp.

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 231 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 236 of file MueLu_Zoltan2GraphAdapter.hpp.

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 238 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 251 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 253 of file MueLu_Zoltan2GraphAdapter.hpp.

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 255 of file MueLu_Zoltan2GraphAdapter.hpp.

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 268 of file MueLu_Zoltan2GraphAdapter.hpp.

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 274 of file MueLu_Zoltan2GraphAdapter.hpp.

Member Data Documentation

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

Definition at line 280 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 281 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 282 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 284 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 285 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 287 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 288 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 289 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 291 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 292 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 294 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 295 of file MueLu_Zoltan2GraphAdapter.hpp.


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