XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_maxmin, surf, "Logging specific to SURF (maxmin)");
-typedef struct s_dyn_light {
+struct s_dyn_light_t {
int *data;
int pos;
int size;
-} s_dyn_light_t;
+};
typedef s_dyn_light_t* dyn_light_t;
double sg_maxmin_precision = 0.00001; /* Change this with --cfg=maxmin/precision:VALUE */
}
/* @brief Remove a constraint
- * Currently this is dead code, but it is exposed in maxmin.h
+ * Currently this is dead code, but it is exposed in maxmin.hpp
* Apparently, this call was designed assuming that constraint would no more have elements in it.
* If not the case, assertion will fail, and you need to add calls e.g. to lmm_shrink before effectively removing it.
*/
lmm_variable_t var = (lmm_variable_t)xbt_mallocator_get(sys->variable_mallocator);
var->id = id;
var->id_int = Global_debug_id++;
- var->cnsts = (s_lmm_element_t *) xbt_realloc(var->cnsts, number_of_constraints * sizeof(s_lmm_element_t));
+ var->cnsts = static_cast<s_lmm_element_t*>(xbt_realloc(var->cnsts, number_of_constraints * sizeof(s_lmm_element_t)));
for (int i = 0; i < number_of_constraints; i++) {
var->cnsts[i].enabled_element_set_hookup.next = nullptr;
var->cnsts[i].enabled_element_set_hookup.prev = nullptr;
}
}
- s_lmm_constraint_light_t *cnst_light_tab =
- (s_lmm_constraint_light_t *)xbt_malloc0(xbt_swag_size(cnst_list)*sizeof(s_lmm_constraint_light_t));
+ s_lmm_constraint_light_t* cnst_light_tab =
+ static_cast<s_lmm_constraint_light_t*>(xbt_malloc0(xbt_swag_size(cnst_list) * sizeof(s_lmm_constraint_light_t)));
int cnst_light_num = 0;
dyn_light_t saturated_constraint_set = xbt_new0(s_dyn_light_t,1);
saturated_constraint_set->size = 5;
*/
static void lmm_remove_all_modified_set(lmm_system_t sys)
{
- //We cleverly un-flag all variables just by incrementing sys->visited_counter
- //In effect, the var->visited value will no more be equal to sys->visited counter
- //To be clean, when visited counter has wrapped around, we force these var->visited values so that variables that
- //were in the modified a long (long long) time ago are not wrongly skipped here, which would lead to very nasty bugs
- //(i.e. not readibily reproducible, and requiring a lot of run time before happening).
+ // We cleverly un-flag all variables just by incrementing sys->visited_counter
+ // In effect, the var->visited value will no more be equal to sys->visited counter
+ // To be clean, when visited counter has wrapped around, we force these var->visited values so that variables that
+ // were in the modified a long long time ago are not wrongly skipped here, which would lead to very nasty bugs
+ // (i.e. not readibily reproducible, and requiring a lot of run time before happening).
if (++sys->visited_counter == 1) {
/* the counter wrapped around, reset each variable->visited */
void *_var;