/*
* SDP specific variables.
*/
-#include <declarations.h>
+#include <csdp/declarations.h>
static void create_cross_link(struct constraintmatrix *myconstraints, int k);
double tmp_k;
struct sparseblock *p;
- char *tmp;
+ char *tmp = NULL;
FILE *stdout_sav;
int ret;
var_list = &(sys->variable_set);
i=0;
xbt_swag_foreach(var, var_list) {
- if(var->weight) i++;
+ if(var->weight != 0.0) i++;
}
flows=i;
DEBUG1("Variable set : %d", xbt_swag_size(var_list));
+ DEBUG1("Flows : %d", flows);
+
+ if(flows == 0)
+ return;
+
+
xbt_swag_foreach(var, var_list) {
var->value = 0.0;
if(var->weight) var->index = i--;
cnst_list=&(sys->active_constraint_set);
DEBUG1("Active constraints : %d", xbt_swag_size(cnst_list));
+ DEBUG1("Links : %d", links);
/*
* Those fields are the top level description of the platform furnished in the xml file.
*/
tmp_k = (double) log((double)flows)/log(2.0);
K = (int) ceil(tmp_k);
-
+ if(K == 0) K = 1;
+ DEBUG1("Value of K = %d", K);
/*
* The number of variables in the SDP program.
*/
nb_cnsts = nb_cnsts_capacity + nb_cnsts_struct + nb_cnsts_positivy;
CDEBUG1(surf_sdp_out,"Number of constraints = %d", nb_cnsts);
+ DEBUG1("Number of constraints in the SDP program : %d", nb_cnsts);
/*
* Keep track of which blocks have off diagonal entries.
DEBUG0("Printing SDPA...");
tmp=strdup("SURF-PROPORTIONNAL.sdpa");
write_prob(tmp,total_block_size,nb_var,C,a,constraints);
- free(tmp);
+ //free(tmp);
}
/*
if(XBT_LOG_ISENABLED(surf_sdp, xbt_log_priority_debug)) {
tmp=strdup("SURF-PROPORTIONNAL.sol");
write_sol(tmp,total_block_size, nb_var, X, y, Z);
- free(tmp);
+ //free(tmp);
}
/*
*/
free_prob(total_block_size, nb_var, C, a, constraints, X, y, Z);
+ free(isdiag);
+ free(tempdiag);
+ free(tmp);
- free(isdiag);
- free(tempdiag);
- free(tmp);
- free(a);
- free(y);
-
- // fclose(sdpout);
- free(isdiag);
- sys->modified = 0;
+ sys->modified = 0;
- if(XBT_LOG_ISENABLED(surf_sdp, xbt_log_priority_debug)) {
- lmm_print(sys);
- }
+ if(XBT_LOG_ISENABLED(surf_sdp, xbt_log_priority_debug)) {
+ lmm_print(sys);
+ }
}