PROFILE_FLAG = -pg
endif
-CXXFLAGS = -Wall $(OPTIMIZE_FLAG) $(PROFILE_FLAG) $(VERBOSE_FLAG)
+CXXFLAGS = -Wconversion -Wall $(OPTIMIZE_FLAG) $(PROFILE_FLAG) $(VERBOSE_FLAG)
all: mtp mtp_example mtp_stress_test
scalar_t noisy_score(scalar_t true_score, scalar_t erroneous_score,
scalar_t score_noise, scalar_t flip_noise) {
if(drand48() < flip_noise) {
- return erroneous_score + score_noise * (2.0 * drand48() - 1.0);
+ return erroneous_score + score_noise * (2.0f * scalar_t(drand48()) - 1.0f);
} else {
- return true_score + score_noise * (2.0 * drand48() - 1.0);
+ return true_score + score_noise * (2.0f * scalar_t(drand48()) - 1.0f);
}
}
// Then, we specify for every location and time step what is the
// detection score there.
- scalar_t flip_noise = 0.05;
- scalar_t score_noise = 0.0;
+ scalar_t flip_noise = 0.05f;
+ scalar_t score_noise = 0.0f;
// We first put a background noise, with negative scores at every
// location.
for(int k = 0; k < _nb_vertices; k++) {
v = _vertices + k;
for(e = v->leaving_edge_list_root; e; e = e->next_leaving_edge) {
- tv = e->terminal_vertex - _vertices;
+ tv = int(e->terminal_vertex - _vertices);
nb_predecessors[tv]++;
}
}
v = _vertices + without_predecessors[l];
v->distance_from_source = rank;
for(e = v->leaving_edge_list_root; e; e = e->next_leaving_edge) {
- tv = e->terminal_vertex - _vertices;
+ tv = int(e->terminal_vertex - _vertices);
nb_predecessors[tv]--;
ASSERT(nb_predecessors[tv] >= 0);
if(nb_predecessors[tv] == 0) {
int l = 0, nb_occupied_next;
if(path) {
- path->nodes[l++] = e->origin_vertex - _vertices;
+ path->nodes[l++] = int(e->origin_vertex - _vertices);
path->length = e->length;
} else l++;
while(e->terminal_vertex != _sink) {
if(path) {
- path->nodes[l++] = e->terminal_vertex - _vertices;
+ path->nodes[l++] = int(e->terminal_vertex - _vertices);
path->length += e->length;
} else l++;
}
if(path) {
- path->nodes[l++] = e->terminal_vertex - _vertices;
+ path->nodes[l++] = int(e->terminal_vertex - _vertices);
path->length += e->length;
} else l++;
for(int t = 0; t < nb_time_steps; t++) {
for(int l = 0; l < nb_locations; l++) {
- tracker->detection_scores[t][l] = drand48() - 0.95;
+ tracker->detection_scores[t][l] = scalar_t(drand48()) - 0.95f;
}
}