1 /* A few tests for the maxmin library */
3 /* Authors: Arnaud Legrand */
5 /* This program is free software; you can redistribute it and/or modify it
6 under the terms of the license (GNU LGPL) which comes with this package. */
10 #include "surf/maxmin.h"
14 /* ==l1== L2 ==L3== */
18 lmm_system_t Sys = NULL ;
19 lmm_constraint_t L1 = NULL;
20 lmm_constraint_t L2 = NULL;
21 lmm_constraint_t L3 = NULL;
23 lmm_variable_t R_1_2_3 = NULL;
24 lmm_variable_t R_1 = NULL;
25 lmm_variable_t R_2 = NULL;
26 lmm_variable_t R_3 = NULL;
32 Sys = lmm_system_new();
33 L1 = lmm_constraint_new(Sys, (void *) "L1", 1.0);
34 L2 = lmm_constraint_new(Sys, (void *) "L2", 10.0);
35 L3 = lmm_constraint_new(Sys, (void *) "L3", 1.0);
37 R_1_2_3 = lmm_variable_new(Sys, (void *) "R 1->2->3", 1.0 , -1.0 , 3);
38 R_1 = lmm_variable_new(Sys, (void *) "R 1", 1.0 , -1.0 , 1);
39 R_2 = lmm_variable_new(Sys, (void *) "R 2", 1.0 , -1.0 , 1);
40 R_3 = lmm_variable_new(Sys, (void *) "R 3", 1.0 , -1.0 , 1);
42 lmm_expand(Sys, L1, R_1_2_3, 1.0);
43 lmm_expand(Sys, L2, R_1_2_3, 1.0);
44 lmm_expand(Sys, L3, R_1_2_3, 1.0);
46 lmm_expand(Sys, L1, R_1, 1.0);
48 lmm_expand(Sys, L2, R_2, 1.0);
50 lmm_expand(Sys, L3, R_3, 1.0);
52 #define AFFICHE(var) printf(#var " = %Lg\n",lmm_variable_getvalue(var));
68 lmm_update_variable_weight(R_1_2_3,.5);
81 int main(int argc, char **argv)