45 #ifndef _ZOLTAN2_INCDEGREE_HPP_
46 #define _ZOLTAN2_INCDEGREE_HPP_
58 bool comp(std::pair<lno_t,lno_t> a, std::pair<lno_t,lno_t> b)
60 return (a.first < b.first);
65 template <
typename Adapter>
70 const RCP<Teuchos::ParameterList> &pl,
71 const RCP<Teuchos::Comm<int> > &comm
74 #ifndef INCLUDE_ZOLTAN2_EXPERIMENTAL
78 "experimental software "
79 "while it is being developed and tested.")
82 #else //INCLUDE_ZOLTAN2_EXPERIMENTAL
86 typedef typename Adapter::gid_t gid_t;
94 perm = (lno_t *) (solution->getPermutationRCP().getRawPtr());
97 ArrayView<const lno_t> edgeIds;
98 ArrayView<const lno_t> offsets;
99 ArrayView<StridedData<lno_t, scalar_t> > wgts;
100 model->getLocalEdgeList(edgeIds, offsets, wgts);
103 std::vector<std::pair<lno_t, lno_t> > degrees(nVtx);
104 for (lno_t i=0; i<nVtx; i++){
105 degrees[i].first = offsets[i+1] - offsets[i];
106 degrees[i].second = i;
110 std::sort(degrees.begin(), degrees.end(),
comp);
113 for (lno_t i=0; i<nVtx; i++){
114 perm[i] = degrees[i].second;
118 #endif // INCLUDE_ZOLTAN2_EXPERIMENTAL
int AlgIncDegree(const RCP< GraphModel< Adapter > > &model, const RCP< OrderingSolution< typename Adapter::gid_t, typename Adapter::lno_t > > &solution, const RCP< Teuchos::ParameterList > &pl, const RCP< Teuchos::Comm< int > > &comm)
Defines the OrderingSolution class.
bool comp(std::pair< lno_t, lno_t > a, std::pair< lno_t, lno_t > b)
#define Z2_THROW_EXPERIMENTAL(mystr)
Throw an error when experimental code is requested but not compiled.
GraphModel defines the interface required for graph models.
Defines the GraphModel interface.
The class containing ordering solutions and metrics.