78 size_t max_frequency = 0;
79 size_t current_frequency = 0;
81 most_frequent_velocity.
vx = FLT_MAX;
82 most_frequent_velocity.
vy = FLT_MAX;
83 most_frequent_velocity.
vz = FLT_MAX;
84 current_velocity.
vx = FLT_MAX;
85 current_velocity.
vy = FLT_MAX;
86 current_velocity.
vz = FLT_MAX;
88 for(
auto it = v.begin() ; it != v.end(); it++)
95 if(max_frequency < current_frequency)
97 max_frequency = current_frequency;
98 most_frequent_velocity.
vx = current_velocity.
vx;
99 most_frequent_velocity.
vy = current_velocity.
vy;
100 most_frequent_velocity.
vz = current_velocity.
vz;
102 current_frequency = 1;
103 current_velocity.
vx = (*it).vx;
104 current_velocity.
vy = (*it).vy;
105 current_velocity.
vz = (*it).vz;
109 if(max_frequency < current_frequency)
111 max_frequency = current_frequency;
112 most_frequent_velocity.
vx = current_velocity.
vx;
113 most_frequent_velocity.
vy = current_velocity.
vy;
114 most_frequent_velocity.
vz = current_velocity.
vz;
116 v1 = most_frequent_velocity.
vx;
117 v2 = most_frequent_velocity.
vy;
118 v3 = most_frequent_velocity.
vz;
119 freq = max_frequency;
125 std::vector<Velocity> vel;
126 vel.resize(*size_idx);
127 for(
size_t i = 0; i < (size_t) *size_idx ; i++)
129 const int index_in_v = idx[i]-1;
130 assert(index_in_v >= 0);
131 assert(index_in_v < *numnod);
132 vel[i].vx = v[3*index_in_v];
133 vel[i].vy = v[3*index_in_v+1];
134 vel[i].vz = v[3*index_in_v+2];