+#include "surf/datatypes.h"
+#include <math.h>
+
+
+/** @addtogroup SURF_lmm
+ * @details
+ * A linear maxmin solver to resolves inequations systems.
+ *
+ * A system is composed of variables, constraints and elements linking them.
+ * Constraint:
+ * - bound (set)
+ * - shared (set)
+ * - usage (computed)
+ * Variable:
+ * - weight (set)
+ * - bound (set)
+ * - value (computed)
+ * Element:
+ * - value (set)
+ *
+ * A possible system could be:
+ * - three variables: `var1`, `var2`, `var3`
+ * - two constraints: `cons1`, `cons2`
+ * - four elements linking:
+ * - `elem1` linking `var1` and `cons1`
+ * - `elem2` linking `var2` and `cons1`
+ * - `elem3` linking `var2` and `cons2`
+ * - `elem4` linking `var3` and `cons2`
+ *
+ * And the corresponding inequations will be:
+ *
+ * var1.value <= var1.bound
+ * var2.value <= var2.bound
+ * var3.value <= var3.bound
+ * var1.weight * var1.value * elem1.value + var2.weight * var2.value * elem2.value <= cons1.bound
+ * var2.weight * var2.value * elem3.value + var3.weight * var3.value * elem4.value <= cons2.bound
+ *
+ * where `var1.value`, `var2.value` and `var3.value` are the unknown values
+ *
+ * if a constraint is not shared the sum is replace by a max
+ *
+ * Its usefull for the sharing of resources for various models.
+ * For instance for the network model the link are associated
+ * to consrtaint and the communications to variables.
+ */
+
+extern double sg_maxmin_precision;
+#define MAXMIN_PRECISION sg_maxmin_precision
+static XBT_INLINE void double_update(double *variable, double value)
+{
+ *variable -= value;
+ if (*variable < MAXMIN_PRECISION)
+ *variable = 0.0;
+}
+
+static XBT_INLINE int double_positive(double value)
+{
+ return (value > MAXMIN_PRECISION);
+}
+
+static XBT_INLINE int double_equals(double value1, double value2)
+{
+ return (fabs(value1 - value2) < MAXMIN_PRECISION);
+}
+
+SG_BEGIN_DECL()
+
+/** @{ @ingroup SURF_lmm */
+/**
+ * @brief Create a new Linear MaxMim system
+ *
+ * @param selective_update [description]
+ */
+XBT_PUBLIC(lmm_system_t) lmm_system_new(int selective_update);
+
+/**
+ * @brief Free an existing Linear MaxMin system
+ *
+ * @param sys The lmm system to free
+ */
+XBT_PUBLIC(void) lmm_system_free(lmm_system_t sys);