8 template <
class T_Cage>
11 typedef unsigned VertexID;
13 typedef typename Cage::GraphPolicy GraphPolicy;
15 typedef typename Cage::Event Event;
16 typedef typename GraphPolicy::VertexProperty VertexProperty;
19 VertexProperty &vertexProperty;
24 vertexProperty(vertexProperty),
32 VertexProperty& operator()(){
33 return vertexProperty;
38 vertexProperty = other.vertexProperty;
44 size_t nInEdges()
const {
45 return cage.getInEdges(*this).size();
48 size_t nOutEdges()
const {
49 return cage.getOutEdges(*this).size();
64 template <
class T_Data>
65 void spread(
const T_Data& data, std::vector<Event> &events){
66 cage.spread(*
this, data, events);
69 template <
class T_Data>
70 void spread(
const T_Data& data){
71 cage.spread(*
this, data);
75 template <
class T_Data>
76 void collect(T_Data& data){
77 cage.collect(*
this, data);
81 template <
class T_Data,
class T_Functor>
82 void forward(T_Data& data, T_Functor f){
83 cage.collect(*
this, data);
85 cage.spread(*
this, data);
89 template <
class T_Data>
90 void forward(T_Data& data){
91 assert(nInEdges() == nOutEdges());
92 cage.collect(*
this, data);
93 cage.spread(*
this, data);
109 template <
typename T_Op>
110 typename T_Op::result_type
accumulate(
const T_Op op,
const typename T_Op::result_type init){
111 std::vector<typename T_Op::result_type> data (nInEdges());
112 cage.collect(*
this, data);
113 return std::accumulate(data.begin(), data.end(), init, op);
T_Op::result_type accumulate(const T_Op op, const typename T_Op::result_type init)
Collects from each incoming edge one elements and reduces them by the binary operator op...
Definition: Vertex.hpp:110