Example #1
0
  /**
   * \brief If the distance is smaller then update
   */
  void apply(icontext_type& context, vertex_type& vertex,
             const gather_type& total) {
    changed = false;
    if(context.iteration() == 0) {
    	changed = true;
    	vertex.data().dist = 0;
    	context.setUpdateFlag(changed);
    	return;
    	//lastchange = vertex.data().dist;
    }
    if(vertex.data().dist > total.dist) {
      changed = true;
      vertex.data().dist = total.dist;
      //lastchange = vertex.data().dist;
    }

    context.setUpdateFlag(changed);
    //std::cout << "vid=" << vertex.id() << ", val=" << vertex.data().dist << "\n";
  }