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

Constructor & Destructor Documentation

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

Destructor.

Definition at line 83 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 266 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 64 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 65 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 66 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 73 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 74 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 75 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 77 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 320 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 330 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 348 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 363 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 377 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 168 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 172 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 184 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 186 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 192 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 194 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 199 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 201 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 214 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 216 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 218 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 231 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 237 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 243 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 244 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 245 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 247 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 248 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 250 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 251 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 252 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 254 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 255 of file MueLu_Zoltan2GraphAdapter.hpp.

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

Definition at line 257 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 258 of file MueLu_Zoltan2GraphAdapter.hpp.


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