[ create a new paste ] login | about

Link: http://codepad.org/KtmbXkLa    [ raw code | fork ]

dreamlax - C++, pasted on Apr 1:
#include <boost/pending/disjoint_sets.hpp>
#include <boost/property_map.hpp>
#include <vector>

using namespace boost;

//Rank:key(set's element type) value(integer)
//Parent:key, value (set's value type)

std::vector<int> rank_vec;

struct VecMap
{
  typedef int value_type;
  typedef int key_type;
  typedef  read_write_property_map_tag category;
  typedef int* reference;
  std::vector<int> vec_store;

};

void put(VecMap& rmap, int key, int val)
{
  rmap.vec_store[key] = val;
}

int get(VecMap& rmap, int key)
{
  return rmap.vec_store[key];
}


int main()
{
  VecMap rank_map;
  VecMap parent_map;
  rank_map.vec_store.resize(5);
  parent_map.vec_store.resize(5);
  disjoint_sets<VecMap, VecMap> ds(rank_map, parent_map);
  for(int i =0; i < 5; i++)
    {
      ds.make_set(i);
    }
  return 0;
}


Output:
No errors or program output.


Create a new paste based on this one


Comments: