diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-01-16 17:19:42 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-01-16 17:19:42 +0000 |
commit | 924c8ef21aadf46e7c3f6280e482d8c66a6216b1 (patch) | |
tree | 3c2b095bfece8901cf6988202d2ec8f5a7dd6731 /src/ats | |
parent | adda534763a0981d3be3de39b6006737cab98425 (diff) | |
download | gnunet-924c8ef21aadf46e7c3f6280e482d8c66a6216b1.tar.gz gnunet-924c8ef21aadf46e7c3f6280e482d8c66a6216b1.zip |
- minor
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/gnunet-service-ats_addresses_mlp.c | 9 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_addresses_mlp.h | 7 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/ats/gnunet-service-ats_addresses_mlp.c b/src/ats/gnunet-service-ats_addresses_mlp.c index c0d4dc08e..aa72b9d90 100644 --- a/src/ats/gnunet-service-ats_addresses_mlp.c +++ b/src/ats/gnunet-service-ats_addresses_mlp.c | |||
@@ -63,7 +63,7 @@ mlp_create_problem (struct GAS_MLP_Handle *mlp) | |||
63 | mlp->c_d = col; | 63 | mlp->c_d = col; |
64 | /* Column name */ | 64 | /* Column name */ |
65 | glp_set_col_name (mlp->prob, col, "d"); | 65 | glp_set_col_name (mlp->prob, col, "d"); |
66 | /* Column coffiecient */ | 66 | /* Column objective function coefficient */ |
67 | glp_set_obj_coef (mlp->prob, col, mlp->co_D); | 67 | glp_set_obj_coef (mlp->prob, col, mlp->co_D); |
68 | /* Column lower bound = 0.0 */ | 68 | /* Column lower bound = 0.0 */ |
69 | glp_set_col_bnds (mlp->prob, col, GLP_LO, 0.0, 0.0); | 69 | glp_set_col_bnds (mlp->prob, col, GLP_LO, 0.0, 0.0); |
@@ -74,7 +74,7 @@ mlp_create_problem (struct GAS_MLP_Handle *mlp) | |||
74 | mlp->c_u = col; | 74 | mlp->c_u = col; |
75 | /* Column name */ | 75 | /* Column name */ |
76 | glp_set_col_name (mlp->prob, col, "u"); | 76 | glp_set_col_name (mlp->prob, col, "u"); |
77 | /* Column coffiecient */ | 77 | /* Column objective function coefficient */ |
78 | glp_set_obj_coef (mlp->prob, col, mlp->co_U); | 78 | glp_set_obj_coef (mlp->prob, col, mlp->co_U); |
79 | /* Column lower bound = 0.0 */ | 79 | /* Column lower bound = 0.0 */ |
80 | glp_set_col_bnds (mlp->prob, col, GLP_LO, 0.0, 0.0); | 80 | glp_set_col_bnds (mlp->prob, col, GLP_LO, 0.0, 0.0); |
@@ -85,17 +85,16 @@ mlp_create_problem (struct GAS_MLP_Handle *mlp) | |||
85 | mlp->c_r = col; | 85 | mlp->c_r = col; |
86 | /* Column name */ | 86 | /* Column name */ |
87 | glp_set_col_name (mlp->prob, col, "r"); | 87 | glp_set_col_name (mlp->prob, col, "r"); |
88 | /* Column coffiecient */ | 88 | /* Column objective function coefficient */ |
89 | glp_set_obj_coef (mlp->prob, col, mlp->co_R); | 89 | glp_set_obj_coef (mlp->prob, col, mlp->co_R); |
90 | /* Column lower bound = 0.0 */ | 90 | /* Column lower bound = 0.0 */ |
91 | glp_set_col_bnds (mlp->prob, col, GLP_LO, 0.0, 0.0); | 91 | glp_set_col_bnds (mlp->prob, col, GLP_LO, 0.0, 0.0); |
92 | 92 | ||
93 | /* Quality metric columns */ | 93 | /* Quality metric columns */ |
94 | col = glp_add_cols(mlp->prob, mlp->m); | 94 | col = glp_add_cols(mlp->prob, mlp->m); |
95 | mlp->c_q_start = col; | ||
96 | mlp->c_q_end = col + mlp->m; | ||
97 | for (c = 0; c < mlp->m; c++) | 95 | for (c = 0; c < mlp->m; c++) |
98 | { | 96 | { |
97 | mlp->c_q[c] = col + c; | ||
99 | GNUNET_asprintf (&name, "q_%u", mlp->q[c]); | 98 | GNUNET_asprintf (&name, "q_%u", mlp->q[c]); |
100 | glp_set_col_name (mlp->prob, col + c, name); | 99 | glp_set_col_name (mlp->prob, col + c, name); |
101 | glp_set_col_bnds (mlp->prob, col + c, GLP_LO, 0.0, 0.0); | 100 | glp_set_col_bnds (mlp->prob, col + c, GLP_LO, 0.0, 0.0); |
diff --git a/src/ats/gnunet-service-ats_addresses_mlp.h b/src/ats/gnunet-service-ats_addresses_mlp.h index 62df7a733..4b4b93319 100644 --- a/src/ats/gnunet-service-ats_addresses_mlp.h +++ b/src/ats/gnunet-service-ats_addresses_mlp.h | |||
@@ -141,11 +141,8 @@ struct GAS_MLP_Handle | |||
141 | * contains mapping to GNUNET_ATS_Property*/ | 141 | * contains mapping to GNUNET_ATS_Property*/ |
142 | int q[GNUNET_ATS_QualityPropertiesCount]; | 142 | int q[GNUNET_ATS_QualityPropertiesCount]; |
143 | 143 | ||
144 | /* column index first quality metric (q_1) column */ | 144 | /* column index quality metrics */ |
145 | int c_q_start; | 145 | int c_q[GNUNET_ATS_QualityPropertiesCount]; |
146 | |||
147 | /* column index last quality metric (q_n) column */ | ||
148 | int c_q_end; | ||
149 | 146 | ||
150 | /* quality metric coefficients*/ | 147 | /* quality metric coefficients*/ |
151 | double co_Q[GNUNET_ATS_QualityPropertiesCount]; | 148 | double co_Q[GNUNET_ATS_QualityPropertiesCount]; |