this repo has no description
at develop 763 B view raw
1include "fzn_piecewise_linear.mzn"; 2include "fzn_piecewise_linear_reif.mzn"; 3 4/** @group globals 5 Return a piecewise-linear interpolation 6 of the given point sequence as a function of \a x 7*/ 8function var float: piecewise_linear(var float: x, array[int] of float: xi, array[int] of float: vi) ::promise_total = 9 let { 10 var float: res, 11 constraint piecewise_linear(x,res,xi,vi), 12 } in res; 13 14 15/** @group globals 16 Constrains \a y(\a x) to be a piecewise-linear interpolation of 17 the provided point sequence. 18*/ 19predicate piecewise_linear(var float: x, var float: y, 20 array[int] of float: xi, array[int] of float: vi) = 21 fzn_piecewise_linear(x, y, xi, vi); 22 23%-----------------------------------------------------------------------------%