Revert "Merge branch 'smail' into lbaumberger"
This reverts commit1cf29bfdd8, reversing changes made to1b79bd15f4.
This commit is contained in:
+8
-9
@@ -1,11 +1,12 @@
|
||||
#include "forces.hpp"
|
||||
#include <math.h>
|
||||
|
||||
// # Done
|
||||
// # 8 flops = 5 MULTs, 2 ADD, 1 SQRT
|
||||
double w(Vector2d e, Vector2d f) {
|
||||
if (e.dot(f) >= f.norm() * cos_phi)
|
||||
return 1.0;
|
||||
return c;
|
||||
else
|
||||
return c;
|
||||
}
|
||||
|
||||
// # 2 DIVs
|
||||
@@ -26,10 +27,8 @@ void compute_acceleration_term(Pedestrian *p) {
|
||||
Vector2d desired_velocity = p->e * p->desired_v0;
|
||||
// $\vec{v}_{\alpha}(t)$
|
||||
Vector2d actual_velocity = p->curr_vel;
|
||||
|
||||
double tau_alpha_inv = 1 / tau_alpha;
|
||||
|
||||
p->F_i += (desired_velocity - actual_velocity) * tau_alpha_inv;
|
||||
// # 6 flops = 4 ADDs, 2 DIVs
|
||||
p->f_i += (desired_velocity - actual_velocity) / tau_alpha;
|
||||
}
|
||||
|
||||
// # 55(N - 1) = 55N - 55 flops
|
||||
@@ -102,12 +101,12 @@ void compute_repulsive_effects_from_pedestrians(Pedestrian *pedestrians, Pedestr
|
||||
// # 48 n_obstacles flops = 192 flops
|
||||
void compute_repulsive_effects_from_borders(Board &board, Pedestrian *p) {
|
||||
|
||||
Vector2d *borders = B.borders;
|
||||
int n_borders = B.n_borders;
|
||||
Obstacle *obstacles = board.obstacles;
|
||||
int n_borders = board.n_obstacles;
|
||||
|
||||
for (int i = 0; i < n_borders; i++) {
|
||||
|
||||
Vector2d border = borders[i];
|
||||
Obstacle obstacle = obstacles[i];
|
||||
|
||||
// # 17 flops
|
||||
// $\vec{r}_{\alpha B}$
|
||||
|
||||
Reference in New Issue
Block a user