Changeset: a61b9b5e7b84 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a61b9b5e7b84
Modified Files:
monetdb5/modules/mal/Tests/array04.mal
monetdb5/modules/mal/Tests/array04.stable.err
monetdb5/modules/mal/Tests/array04.stable.out
Branch: sciql
Log Message:
updated the tests for array.sum and array.avg, approved stable.{err,out}
diffs (truncated from 317 to 300 lines):
diff --git a/monetdb5/modules/mal/Tests/array04.mal
b/monetdb5/modules/mal/Tests/array04.mal
--- a/monetdb5/modules/mal/Tests/array04.mal
+++ b/monetdb5/modules/mal/Tests/array04.mal
@@ -1,54 +1,84 @@
# tiling operations over fixed arrays
-#create array v(i int dimension[0:1:6], v int default 37)
-i:= array.series(0,1,6,1,1);
-v:= array.filler(i, 37);
-io.print(i,v);
-
-#select sum(V) from V group by V[x:x+2]
-template:= array.series(0@0,1@0,2@0,1,1);
-io.print(template);
-
-g:= array.tiles(v,template);
-io.print(g);
-
-gs:= array.sum(v,template);
-io.print(gs);
+##create array v(i int dimension[0:1:6], v int default 37)
+#i:= array.series(0,1,6,1,1);
+#v:= array.filler(i, 37);
+#io.print(i,v);
+#
+##select sum(V) from V group by V[x:x+2]
+#template:= array.series(0@0,1@0,2@0,1,1);
+#io.print(template);
+#
+#g:= array.tiles(v,template);
+#io.print(g);
#create array M(x int dimension[0:1:4], y int dimension[0:1:4], v int default
37);
mx:= array.series(0,1,4,4,1);
my:= array.series(0,1,4,1,4);
mv:= array.filler(mx,37);
-io.print(mx,my,mv);
-#select sum(M) from M group by M[x:x+2][y:y+2]
-t0:= array.series(0,1,2,2,1);
-t1:= array.series(0,1,2,1,2);
+##select sum(M) from M group by M[x:x+2][y:y+2]
+#t0:= array.series(0,1,2,2,1);
+#t1:= array.series(0,1,2,1,2);
+#io.print(t0,t1);
+#
+#gs:= array.sum(mv, mx, my, t0, t1, 4, 4);
+#io.print(gs);
+#ga:= array.avg(mv, mx, my, t0, t1, 4, 4);
+#io.print(ga);
+
+#select sum(M) from M group by M[x-1:x+2][y-2:y+1]
+t0:= array.series(-1,1,2,3,1);
+t1:= array.series(-2,1,1,1,3);
io.print(t0,t1);
-template:= array.map(mx,my,t0,t1);
-io.print(template);
+gs:= array.sum(mv, mx, my, t0, t1, 4, 4);
+ga:= array.avg(mv, mx, my, t0, t1, 4, 4);
+io.print(mx, my, mv, gs, ga);
-g:= array.tiles(mv,template);
-io.print(g);
+#create array M(x int dimension[0:1:4], y int dimension[0:1:4], v int default
x*4+y);
+mv := bat.new(:oid,:int);
+mv := bat.append(mv,0);
+mv := bat.append(mv,1);
+mv := bat.append(mv,2);
+mv := bat.append(mv,3);
+mv := bat.append(mv,4);
+mv := bat.append(mv,5);
+mv := bat.append(mv,6);
+mv := bat.append(mv,7);
+mv := bat.append(mv,8);
+mv := bat.append(mv,9);
+mv := bat.append(mv,10);
+mv := bat.append(mv,11);
+mv := bat.append(mv,12);
+mv := bat.append(mv,13);
+mv := bat.append(mv,14);
+mv := bat.append(mv,15);
+gs:= array.sum(mv, mx, my, t0, t1, 4, 4);
+ga:= array.avg(mv, mx, my, t0, t1, 4, 4);
+io.print(mx, my, mv, gs, ga);
-gs:= array.sum(mv,template);
-io.print(gs);
+#template:= array.map(mx,my,t0,t1);
+#io.print(template);
+#
+#g:= array.tiles(mv,template);
+#io.print(g);
+#
+## first create the larger array N[-1:1:5][-1:1:5]
+#nx:= array.series(-1,1,5,6,1);
+#ny:= array.series(-1,1,5,1,6);
+#nv:= array.filler(nx,nil:int);
+#io.print(nx,ny,nv);
+#
+##derive the mapping from cell id in N into M
+#map:= array.embed(nx,ny,mx,my);
+#io.print(map);
+#rv:= array.replace(nv,map,mv);
+#io.print(rv);
+#
+##now produce the tiled sum over the enlarged one
+#template:= array.map(nx,ny,t0,t1);
+#io.print(template);
+#gs:= array.sum(nv,template);
+#io.print(gs);
-# first create the larger array N[-1:1:5][-1:1:5]
-nx:= array.series(-1,1,5,6,1);
-ny:= array.series(-1,1,5,1,6);
-nv:= array.filler(nx,nil:int);
-io.print(nx,ny,nv);
-
-#derive the mapping from cell id in N into M
-map:= array.embed(nx,ny,mx,my);
-io.print(map);
-rv:= array.replace(nv,map,mv);
-io.print(rv);
-
-#now produce the tiled sum over the enlarged one
-template:= array.map(nx,ny,t0,t1);
-io.print(template);
-gs:= array.sum(nv,template);
-io.print(gs);
diff --git a/monetdb5/modules/mal/Tests/array04.stable.err
b/monetdb5/modules/mal/Tests/array04.stable.err
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/array04.stable.err
@@ -0,0 +1,31 @@
+stderr of test 'array04` in directory 'modules/mal` itself:
+
+
+# 16:46:12 >
+# 16:46:12 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"gdk_dbfarm=/export/scratch0/zhang/monet-install/sciql/debug/var/MonetDB"
"--set" "mapi_open=true" "--set" "mapi_port=39905" "--set" "monet_prompt="
"--trace" "--forcemito" "--set" "mal_listing=2" "--dbname=mTests_modules_mal"
"array04.mal"
+# 16:46:12 >
+
+# builtin opt gdk_dbname = demo
+# builtin opt gdk_dbfarm =
/export/scratch0/zhang/monet-install/sciql/debug/var/monetdb5/dbfarm
+# builtin opt gdk_debug = 0
+# builtin opt gdk_alloc_map = no
+# builtin opt gdk_vmtrim = yes
+# builtin opt monet_prompt = >
+# builtin opt monet_daemon = no
+# builtin opt mapi_port = 50000
+# builtin opt mapi_open = false
+# builtin opt mapi_autosense = false
+# builtin opt sql_optimizer = default_pipe
+# builtin opt sql_debug = 0
+# cmdline opt gdk_nr_threads = 0
+# cmdline opt gdk_dbfarm =
/export/scratch0/zhang/monet-install/sciql/debug/var/MonetDB
+# cmdline opt mapi_open = true
+# cmdline opt mapi_port = 39905
+# cmdline opt monet_prompt =
+# cmdline opt mal_listing = 2
+# cmdline opt gdk_dbname = mTests_modules_mal
+
+# 16:46:12 >
+# 16:46:12 > "Done."
+# 16:46:12 >
+
diff --git a/monetdb5/modules/mal/Tests/array04.stable.out
b/monetdb5/modules/mal/Tests/array04.stable.out
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/Tests/array04.stable.out
@@ -0,0 +1,147 @@
+stdout of test 'array04` in directory 'modules/mal` itself:
+
+
+# 16:46:12 >
+# 16:46:12 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"gdk_dbfarm=/export/scratch0/zhang/monet-install/sciql/debug/var/MonetDB"
"--set" "mapi_open=true" "--set" "mapi_port=39905" "--set" "monet_prompt="
"--trace" "--forcemito" "--set" "mal_listing=2" "--dbname=mTests_modules_mal"
"array04.mal"
+# 16:46:12 >
+
+# MonetDB 5 server v11.8.0
+# This is an unreleased version
+# Serving database 'mTests_modules_mal', using 4 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically
linked
+# Found 7.749 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2011 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://jarl.ins.cwi.nl:39905/
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+function user.main():void;
+# tiling operations over fixed arrays
+##create array v(i int dimension[0:1:6], v int default 37)
+#i:= array.series(0,1,6,1,1);
+#v:= array.filler(i, 37);
+#io.print(i,v);
+##select sum(V) from V group by V[x:x+2]
+#template:= array.series(0@0,1@0,2@0,1,1);
+#io.print(template);
+#g:= array.tiles(v,template);
+#io.print(g);
+#create array M(x int dimension[0:1:4], y int dimension[0:1:4], v int default
37);
+ mx := array.series(0,1,4,4,1);
+ my := array.series(0,1,4,1,4);
+ mv := array.filler(mx,37);
+##select sum(M) from M group by M[x:x+2][y:y+2]
+#t0:= array.series(0,1,2,2,1);
+#t1:= array.series(0,1,2,1,2);
+#io.print(t0,t1);
+#gs:= array.sum(mv, mx, my, t0, t1, 4, 4);
+#io.print(gs);
+#ga:= array.avg(mv, mx, my, t0, t1, 4, 4);
+#io.print(ga);
+#select sum(M) from M group by M[x-1:x+2][y-2:y+1]
+ t0 := array.series(-1,1,2,3,1);
+ t1 := array.series(-2,1,1,1,3);
+ io.print(t0,t1);
+ gs := array.sum(mv,mx,my,t0,t1,4,4);
+ ga := array.avg(mv,mx,my,t0,t1,4,4);
+ io.print(mx,my,mv,gs,ga);
+#create array M(x int dimension[0:1:4], y int dimension[0:1:4], v int default
x*4+y);
+ mv := bat.new(:oid,:int);
+ mv := bat.append(mv,0);
+ mv := bat.append(mv,1);
+ mv := bat.append(mv,2);
+ mv := bat.append(mv,3);
+ mv := bat.append(mv,4);
+ mv := bat.append(mv,5);
+ mv := bat.append(mv,6);
+ mv := bat.append(mv,7);
+ mv := bat.append(mv,8);
+ mv := bat.append(mv,9);
+ mv := bat.append(mv,10);
+ mv := bat.append(mv,11);
+ mv := bat.append(mv,12);
+ mv := bat.append(mv,13);
+ mv := bat.append(mv,14);
+ mv := bat.append(mv,15);
+ gs := array.sum(mv,mx,my,t0,t1,4,4);
+ ga := array.avg(mv,mx,my,t0,t1,4,4);
+ io.print(mx,my,mv,gs,ga);
+#template:= array.map(mx,my,t0,t1);
+#io.print(template);
+#g:= array.tiles(mv,template);
+#io.print(g);
+## first create the larger array N[-1:1:5][-1:1:5]
+#nx:= array.series(-1,1,5,6,1);
+#ny:= array.series(-1,1,5,1,6);
+#nv:= array.filler(nx,nil:int);
+#io.print(nx,ny,nv);
+##derive the mapping from cell id in N into M
+#map:= array.embed(nx,ny,mx,my);
+#io.print(map);
+#rv:= array.replace(nv,map,mv);
+#io.print(rv);
+##now produce the tiled sum over the enlarged one
+#template:= array.map(nx,ny,t0,t1);
+#io.print(template);
+#gs:= array.sum(nv,template);
+#io.print(gs);
+end main;
+#-------------------------#
+# h t t # name
+# void int int # type
+#-------------------------#
+[ 0@0, -1, -2 ]
+[ 1@0, -1, -1 ]
+[ 2@0, -1, 0 ]
+[ 3@0, 0, -2 ]
+[ 4@0, 0, -1 ]
+[ 5@0, 0, 0 ]
+[ 6@0, 1, -2 ]
+[ 7@0, 1, -1 ]
+[ 8@0, 1, 0 ]
+#-------------------------------------------------#
+# h t t t t t # name
+# void int int int int dbl # type
+#-------------------------------------------------#
+[ 0@0, 0, 0, 37, 74, 37 ]
+[ 1@0, 0, 1, 37, 148, 37 ]
+[ 2@0, 0, 2, 37, 222, 37 ]
+[ 3@0, 0, 3, 37, 222, 37 ]
+[ 4@0, 1, 0, 37, 111, 37 ]
+[ 5@0, 1, 1, 37, 222, 37 ]
+[ 6@0, 1, 2, 37, 333, 37 ]
+[ 7@0, 1, 3, 37, 333, 37 ]
+[ 8@0, 2, 0, 37, 111, 37 ]
+[ 9@0, 2, 1, 37, 222, 37 ]
+[ 10@0, 2, 2, 37, 333, 37 ]
+[ 11@0, 2, 3, 37, 333, 37 ]
+[ 12@0, 3, 0, 37, 74, 37 ]
+[ 13@0, 3, 1, 37, 148, 37 ]
+[ 14@0, 3, 2, 37, 222, 37 ]
+[ 15@0, 3, 3, 37, 222, 37 ]
+#-------------------------------------------------#
+# h t t t t t # name
+# void int int int int dbl # type
+#-------------------------------------------------#
+[ 0@0, 0, 0, 0, 4, 2 ]
+[ 1@0, 0, 1, 1, 10, 2.5 ]
+[ 2@0, 0, 2, 2, 18, 3 ]
+[ 3@0, 0, 3, 3, 24, 4 ]
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list