3 /* A few tests for the maxmin library */
5 /* Copyright (c) 2004 Arnaud Legrand. All rights reserved. */
7 /* This program is free software; you can redistribute it and/or modify it
8 * under the terms of the license (GNU LGPL) which comes with this package. */
16 #include "surf/maxmin.h"
19 #include "xbt/module.h"
20 XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test,"Messages specific for surf example");
22 #define PRINT_VAR(var) DEBUG1(#var " = %g\n",lmm_variable_getvalue(var));
26 /* ==l1== L2 ==L3== */
33 lmm_system_t Sys = NULL ;
34 lmm_constraint_t L1 = NULL;
35 lmm_constraint_t L2 = NULL;
36 lmm_constraint_t L3 = NULL;
38 lmm_variable_t R_1_2_3 = NULL;
39 lmm_variable_t R_1 = NULL;
40 lmm_variable_t R_2 = NULL;
41 lmm_variable_t R_3 = NULL;
43 Sys = lmm_system_new();
44 L1 = lmm_constraint_new(Sys, (void *) "L1", 1.0);
45 L2 = lmm_constraint_new(Sys, (void *) "L2", 10.0);
46 L3 = lmm_constraint_new(Sys, (void *) "L3", 1.0);
48 R_1_2_3 = lmm_variable_new(Sys, (void *) "R 1->2->3", 1.0 , -1.0 , 3);
49 R_1 = lmm_variable_new(Sys, (void *) "R 1", 1.0 , -1.0 , 1);
50 R_2 = lmm_variable_new(Sys, (void *) "R 2", 1.0 , -1.0 , 1);
51 R_3 = lmm_variable_new(Sys, (void *) "R 3", 1.0 , -1.0 , 1);
53 lmm_expand(Sys, L1, R_1_2_3, 1.0);
54 lmm_expand(Sys, L2, R_1_2_3, 1.0);
55 lmm_expand(Sys, L3, R_1_2_3, 1.0);
57 lmm_expand(Sys, L1, R_1, 1.0);
59 lmm_expand(Sys, L2, R_2, 1.0);
61 lmm_expand(Sys, L3, R_3, 1.0);
78 lmm_update_variable_weight(Sys,R_1_2_3,.5);
98 int main(int argc, char **argv)
100 xbt_init(&argc,argv);
102 DEBUG0("***** Test 1 ***** \n");
104 /* DEBUG0("***** Test 2 ***** \n"); */