:!!,!= !!−1,!−1+!(!,!−1)∗!!−1,!−1−!!,!−1 double heatmap[10]; double heatmap_tmp[10]; #pragma func main() = heatspread( initmap( heatmap ) ) void main() { … for (int iter=0; iter<100; iter++) // 100 iterations { heatspread(*heatmap); memcpy(heatmap, heatmap_tmp, 10); } }
#pragma func heatspread(heatmap) = zipWith (+) (heatcell( neighbours(heatmap) )) (heatmap) void heatspread(double** heatmap) { for (int x=0; x<10; y++) { double dphi = heatcell( neighbours(heatmap, x) ); heatmap_tmp[x] = heatmap[x] + dphi; } } ... workflow data in data out