From 66f223d3faa3b2cbea3a5884599d533f33bb5abf Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 21 Apr 2011 08:48:19 +0000 Subject: --- src/transport/test_transport_ats_perf.c | 97 +++++++++++++-------------------- 1 file changed, 39 insertions(+), 58 deletions(-) (limited to 'src/transport') diff --git a/src/transport/test_transport_ats_perf.c b/src/transport/test_transport_ats_perf.c index 51828bcdd..0b0c3634e 100644 --- a/src/transport/test_transport_ats_perf.c +++ b/src/transport/test_transport_ats_perf.c @@ -26,12 +26,12 @@ #include "gauger.h" #include -#define VERBOSE GNUNET_NO +#define VERBOSE GNUNET_YES #define EXECS 5 - +#if HAVE_LIBGLPK static int executions = EXECS; static uint64_t exec_time[EXECS]; @@ -40,8 +40,6 @@ static uint64_t sim_with_opt_avg; static uint64_t mlp_no_opt_avg; static uint64_t mlp_with_opt_avg; -#if HAVE_LIBGLPK - static glp_prob * prob; static struct GNUNET_TIME_Absolute start; @@ -55,6 +53,7 @@ void solve_mlp(int presolve) glp_iocp opt_mlp; glp_init_iocp(&opt_mlp); opt_mlp.msg_lev = GLP_MSG_OFF; + opt_mlp.presolve = GLP_OFF; result = glp_intopt (prob, &opt_mlp); solution = glp_mip_status (prob); @@ -70,12 +69,39 @@ void solve_lp(int presolve) opt_lp.msg_lev = GLP_MSG_OFF; if (presolve==GNUNET_YES) opt_lp.presolve = GLP_ON; + else opt_lp.presolve = GLP_OFF; result = glp_simplex(prob, &opt_lp); solution = glp_get_status (prob); GNUNET_assert ((solution == 5) && (result==0)); } +/* Modify quality constraint */ +void modify_qm(int start, int length, int values_to_change) +{ + //int * ind = GNUNET_malloc (length * sizeof (int)); + //double *val = GNUNET_malloc (length * sizeof (double)); + int ind[1000]; + double val[1000]; + + int res = 0; + int c = start, c2=1; + while (c<=(start+values_to_change)) + { + res = glp_get_mat_row(prob, c, ind, val); + + printf("%i %i \n", c, res); + for (c2=0; c2