I am looking for a reference to a solution of the multivariate piecewise linear interpolation. I am not quite sure how to generalize a well-known dynamic programming Segmented Least Squares algorithm.
The exact version I'd like is this. Let B be a box $[1,a_1]\times[1,a_2]\times ... \times[1,a_k]\subset\mathbb{Z}^k$, and consider a function $f:B\to\mathbb{R}$, that is given to us at some points of the box. Also, given to us some penalty factor $P>0$. The problem is to find $k$ partitions $1=b_{i0}\lt b_{i1}\lt b_{i2}\lt ...\lt b_{in_k}=a_k$ of the segments $[1,a_i]$ into subintervals so that when the function is interpolated at each $k$-dimensional segment $[b_{1j_1},b_{1(j_1+1)}-1]\times[b_{2j_2},b_{2(j_2+1)}-1]\times ...\times[b_{kj_k},b_{k(j_k+1)}-1]$ the value sum of errors for each segment + $P\times \#segments$ is minimized.
I would be happy with a 3-dimensional version (function of 2 variables), which I think will be easy to generalize.