- Main Page
- Classes
- Files

- File List

# OptFrame/Parallel/MapReduce++/SeqMR/mapreduce.hpp

    00001 #ifndef MAPREDUCE_HPP
    00002 #define MAPREDUCE_HPP
    00003
    00005 template<class KeyA, class A, class KeyB, class B, class C>
    00006 class SeqMR_MapReduce : public MapReduce<KeyA,A,KeyB,B,C>
    00007 {
    00008 public:
    00010         virtual vector< pair<KeyB,C> > run( Mapper<KeyA,A,KeyB,B,C> & mapper, Reducer<KeyA,A,KeyB,B,C> & reducer, vector< pair<KeyA,A> > & as)
    00011         {
    00012                 //cout << "Input  :\t" << as << endl;
    00013 #ifndef MRI_USE_MULTIMAP
    00014                 vector< pair<KeyB,B> > bs = mapper.run( as );
    00015 #else
    00016                 multimap<KeyB,B> bs = mapper.run( as );
    00017 #endif
    00018                 //cout << "Mapped :\t" << bs << endl;
    00019                 vector< pair<KeyB,C> > cs = reducer.run( bs );
    00020                 //cout << "Reduced:\t" << cs << endl;
    00021                 return cs;
    00022         };
    00023 };
    00024
    00026 class SeqMR_StrMapReduce : public SeqMR_MapReduce<string,string,string,string,string> {};
    00027
    00028 #endif /* MAPREDUCE_HPP */

All Classes Functions