THUKEG / saedb

the SAE platform
http://thukeg.github.com/saedb/
11 stars 19 forks source link

implemented map reduce vertex interface #33

Closed neozhangthe1 closed 11 years ago

neozhangthe1 commented 11 years ago

Usage:

struct float_max{
    float value;

    float_max(): value(0){ }
    float_max(float value){
        this->value = value;
    }

    float_max& operator+=(const float_max& other){
        this->value = std::max(this->value, other.value);
        return *this;
    }
};

float_max floatMaxAggregator(const graph_type::vertex_type& vertex){
    return float_max(vertex.data());
}

max_pagerank = engine->map_reduce_vertices<float_max>(floatMaxAggregator);
wweic commented 11 years ago

aggregator.hpp is forgotten, pls check it.

wweic commented 11 years ago

merged manually. do some retab.