50 #ifndef ZOLTAN2_GREEDYMWM_HPP__
51 #define ZOLTAN2_GREEDYMWM_HPP__
69 template <
typename vtx_t,
typename wgt_t>
76 template <
typename vtx_t,
typename wgt_t>
84 template <
typename vtx_t,
typename wgt_t>
96 std::vector<triplet_t> edges(idx[tnVtx]);
100 for (
int i=0; i<tnVtx; i++){
101 for (
int jj=idx[i]; jj<idx[i+1]; jj++){
106 edges[k].val = wgt[k];
113 std::sort (edges.begin(), edges.end(), compare_triplets<vtx_t,wgt_t>);
117 for (
typename std::vector<triplet_t>::iterator it=edges.begin();
118 it!=edges.end(); ++it){
123 if ((match[it->i] == it->i) && (match[it->j] == it->j )){
124 match[it->i] = it->j;
125 match[it->j] = it->i;
vtx_t GreedyMWM(int *idx, vtx_t *adj, wgt_t *wgt, vtx_t tnVtx, vtx_t *match)
static bool compare_triplets(GMWM_triplet< vtx_t, wgt_t > a, GMWM_triplet< vtx_t, wgt_t > b)