コード例 #1
0
ファイル: maxmin.cpp プロジェクト: luizabeltrame/simgrid
/* @brief Remove a constraint 
 * Currently this is dead code, but it is exposed in maxmin.h
 * 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.
 */
inline void lmm_constraint_free(lmm_system_t sys,lmm_constraint_t cnst)
{
  xbt_assert(!xbt_swag_size(&(cnst->active_element_set)),"Removing constraint but it still has active elements");
  xbt_assert(!xbt_swag_size(&(cnst->enabled_element_set)),"Removing constraint but it still has enabled elements");
  xbt_assert(!xbt_swag_size(&(cnst->disabled_element_set)),"Removing constraint but it still has disabled elements");
  remove_constraint(sys, cnst);
  lmm_cnst_free(sys, cnst);
}
コード例 #2
0
ファイル: maxmin.cpp プロジェクト: frs69wq/simgrid
void lmm_system_free(lmm_system_t sys)
{
  lmm_variable_t var = NULL;
  lmm_constraint_t cnst = NULL;

  while ((var = (lmm_variable_t) extract_variable(sys))) {
    XBT_WARN
        ("Variable %p (%d) still in LMM system when freing it: this may be a bug",
         var, var->id_int);
    lmm_var_free(sys, var);
  }

  while ((cnst = (lmm_constraint_t) extract_constraint(sys)))
    lmm_cnst_free(sys, cnst);

  xbt_mallocator_free(sys->variable_mallocator);
  free(sys);
}
コード例 #3
0
ファイル: maxmin.cpp プロジェクト: luizabeltrame/simgrid
void lmm_system_free(lmm_system_t sys)
{
  lmm_variable_t var = nullptr;
  lmm_constraint_t cnst = nullptr;

  if (!sys)
    return;

  while ((var = (lmm_variable_t) extract_variable(sys))) {
    XBT_WARN("Variable %d still in system when freing it: this may be a bug", var->id_int);
    lmm_var_free(sys, var);
  }
  while ((cnst = (lmm_constraint_t) extract_constraint(sys)))
    lmm_cnst_free(sys, cnst);

  xbt_mallocator_free(sys->variable_mallocator);
  free(sys);
}
コード例 #4
0
ファイル: maxmin.cpp プロジェクト: frs69wq/simgrid
XBT_INLINE void lmm_constraint_free(lmm_system_t sys,
                                    lmm_constraint_t cnst)
{
  remove_constraint(sys, cnst);
  lmm_cnst_free(sys, cnst);
}