From 3bc582417561f5b1f9b3aff6d5d76aa57cb2fcf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20G=C3=A9rard?= Date: Mon, 21 Nov 2011 02:01:14 +0100 Subject: [PATCH] Old pip using array slices. --- test/image_filters/pip_slice.ept | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/image_filters/pip_slice.ept diff --git a/test/image_filters/pip_slice.ept b/test/image_filters/pip_slice.ept new file mode 100644 index 0000000..c93f11b --- /dev/null +++ b/test/image_filters/pip_slice.ept @@ -0,0 +1,19 @@ +fun pip_line<> (line1 :int^m1; line2 :int^m2) returns (r :int^m1) +let + r = line1[0 .. y-1] @ line2 @ line1[y+m2 .. m1-1] +tel + +fun pip<> (t1 :int^n1^m1; t2 :int^n2^m2) returns (r :int^n1^m1) +var t12 :int^m1^n2; +let + t12 = map<> (pip_line<>) (t1[x..x+n2-1], t2); + r = t1[0 .. x-1] @ t12 @ t1[x+n2 .. n1-1]; +tel + +node main() returns (r :int^10^10) +var x,y:int; +let + x = 0 fby x+1; + y = x*x; + r = pip<<10,10,2,2,3,3>>(x^10^10,y^2^2); +tel