Changeset: 11f6359798e9 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=11f6359798e9 Modified Files: monetdb5/modules/mal/Tests/array00.mal monetdb5/modules/mal/Tests/array00.stable.err monetdb5/modules/mal/Tests/array00.stable.out monetdb5/modules/mal/Tests/array01.mal monetdb5/modules/mal/Tests/array01.stable.err monetdb5/modules/mal/Tests/array01.stable.out monetdb5/modules/mal/array.mx Branch: sciql Log Message:
New primitives for SciQL Added method to create a dimension column using the Start-Step-Stop. Added method to extract the cell ids from an array based on a subset of the index vectors. diffs (truncated from 905 to 300 lines): diff --git a/monetdb5/modules/mal/Tests/array00.mal b/monetdb5/modules/mal/Tests/array00.mal --- a/monetdb5/modules/mal/Tests/array00.mal +++ b/monetdb5/modules/mal/Tests/array00.mal @@ -1,16 +1,22 @@ #create the dimensions for a few arrays -#create array v(i int dimension[0:4:1]) -vi:= array.dimension(1,4,1,0); -io.print(vi); +#create array v(i int dimension[0:1:4]) +v:= array.series(0,1,4,1,1); +io.print(v); -#create array m(x int dimension[0:3:1], y int dimension[0:3:1], int 333); -mx:= array.dimension(1,3,3,0); -my:= array.dimension(3,3,1,0); +#create array m(x int dimension[0:1:3], y int dimension[0:1:3], int default 333); +mx:= array.series(0,1,3,3,1); +my:= array.series(0,1,3,1,3); +mv:= array.filler(mx,333); +io.print(mx,my,mv); + +#create array m(x int dimension[0:2:6], y int dimension[0:1:4], int default 333); +mx:= array.series(0,2,6,4,1); +my:= array.series(0,1,4,1,3); mv:= array.filler(mx,333); io.print(mx,my,mv); #create array u(x int dimension[0:*:1]); #any * implies this one -ux:= array.dimension(0,0,0,0); +ux:= array.series(0,0,0,0,0); io.print(ux); diff --git a/monetdb5/modules/mal/Tests/array00.stable.err b/monetdb5/modules/mal/Tests/array00.stable.err new file mode 100644 --- /dev/null +++ b/monetdb5/modules/mal/Tests/array00.stable.err @@ -0,0 +1,31 @@ +stderr of test 'array00` in directory 'modules/mal` itself: + + +# 10:51:36 > +# 10:51:36 > mserver5 --debug=10 --set gdk_nr_threads=0 --set "gdk_dbfarm=/ufs/mk/sciql//Linux/var/MonetDB" --set mapi_open=true --set mapi_port=38302 --set monet_prompt= --trace --forcemito --set mal_listing=2 --dbname=mTests_modules_mal array00.mal +# 10:51:36 > + +# builtin opt gdk_dbname = demo +# builtin opt gdk_dbfarm = /ufs/mk/sciql//Linux/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 = /ufs/mk/sciql//Linux/var/MonetDB +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 38302 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbname = mTests_modules_mal + +# 10:51:36 > +# 10:51:36 > Done. +# 10:51:36 > + diff --git a/monetdb5/modules/mal/Tests/array00.stable.out b/monetdb5/modules/mal/Tests/array00.stable.out new file mode 100644 --- /dev/null +++ b/monetdb5/modules/mal/Tests/array00.stable.out @@ -0,0 +1,63 @@ +stdout of test 'array00` in directory 'modules/mal` itself: + + +# 10:51:36 > +# 10:51:36 > mserver5 --debug=10 --set gdk_nr_threads=0 --set "gdk_dbfarm=/ufs/mk/sciql//Linux/var/MonetDB" --set mapi_open=true --set mapi_port=38302 --set monet_prompt= --trace --forcemito --set mal_listing=2 --dbname=mTests_modules_mal array00.mal +# 10:51:36 > + +# MonetDB 5 server v11.4.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://monetdb.cwi.nl/ for further information +# Listening for connection requests on mapi:monetdb://eir.ins.cwi.nl:38302/ +# MonetDB/GIS module loaded +# MonetDB/SQL module loaded +function user.main():void; +#create the dimensions for a few arrays +#create array v(i int dimension[0:4:1]) + vi := array.dimension(1,4,1,0); + io.print(vi); +#create array m(x int dimension[0:3:1], y int dimension[0:3:1], int 333); + mx := array.dimension(1,3,3,0); + my := array.dimension(3,3,1,0); + mv := array.filler(mx,333); + io.print(mx,my,mv); +#create array u(x int dimension[0:*:1]); +#any * implies this one + ux := array.dimension(0,0,0,0); + io.print(ux); +end main; +#-----------------# +# h t # name +# void int # type +#-----------------# +[ 0@0, 0 ] +[ 1@0, 1 ] +[ 2@0, 2 ] +[ 3@0, 3 ] +#---------------------------------# +# h t t t # name +# void int int int # type +#---------------------------------# +[ 0@0, 0, 0, 333 ] +[ 1@0, 0, 1, 333 ] +[ 2@0, 0, 2, 333 ] +[ 3@0, 1, 0, 333 ] +[ 4@0, 1, 1, 333 ] +[ 5@0, 1, 2, 333 ] +[ 6@0, 2, 0, 333 ] +[ 7@0, 2, 1, 333 ] +[ 8@0, 2, 2, 333 ] +#-----------------# +# h t # name +# void int # type +#-----------------# + +# 10:51:36 > +# 10:51:36 > Done. +# 10:51:36 > + diff --git a/monetdb5/modules/mal/Tests/array01.mal b/monetdb5/modules/mal/Tests/array01.mal --- a/monetdb5/modules/mal/Tests/array01.mal +++ b/monetdb5/modules/mal/Tests/array01.mal @@ -1,32 +1,48 @@ #extraction of cell positions from arrays -#create array v(i int dimension[1:3:1]) -vi:= array.dimension(1,2,1,1); -io.print(vi); +#create array v(i int dimension[0:1:4]) +v:= array.series(0,1,4,1,1); +io.print(v); -#create array m(x int dimension[0:4:1], y int dimension[0:4:1], int 333); -mx:= array.dimension(1,4,4,0); -my:= array.dimension(4,4,1,0); +#create array M(x int dimension[0:2:6], y int dimension[0:1:4], int default 333); +mx:= array.series(0,2,6,4,1); +my:= array.series(0,1,4,1,3); mv:= array.filler(mx,333); io.print(mx,my,mv); #extract the indices from both +#do a point select +x:= bat.new(:oid,:int); +bat.insert(x, 0@0,1); +io.print(x); +y:= bat.new(:oid,:int); +bat.insert(y, 0@0,2); +io.print(y); -x1:= array.map(vi,vi); +#fetch the position of an element in a vector +z1:= array.map(v,x); +io.print(z1); +z1:= array.map(v,y); +io.print(z1); + +#get the original cell oids +x1:= array.map(v,v); io.print(x1); x2:= array.map(mx,my,mx,my); io.print(x2); -x3:= array.map(mx,my,vi,vi); +# select a slice M[2][0:1:3] +x3:= array.map(mx,my,y,v); +io.print(x3); +# select a slice M[0:1:3][2] +x3:= array.map(mx,my,v,y); io.print(x3); -x4:= array.map(vi,mx); +# select a slice A[0:1:3][0:2:6] +x4:= array.map(v,mx); io.print(x4); -x5:= array.map(vi,vi,mx,my); +# select a slice [0:1:3][0:2:6] +x5:= array.map(v,v,mx,my); io.print(x5); - -# try out some errors - -e0:= array.map(vi,vi,vi); diff --git a/monetdb5/modules/mal/Tests/array01.stable.err b/monetdb5/modules/mal/Tests/array01.stable.err new file mode 100644 --- /dev/null +++ b/monetdb5/modules/mal/Tests/array01.stable.err @@ -0,0 +1,31 @@ +stderr of test 'array01` in directory 'modules/mal` itself: + + +# 20:40:09 > +# 20:40:09 > mserver5 --debug=10 --set gdk_nr_threads=0 --set "gdk_dbfarm=/ufs/mk/sciql//Linux/var/MonetDB" --set mapi_open=true --set mapi_port=37449 --set monet_prompt= --trace --forcemito --set mal_listing=2 --dbname=mTests_modules_mal array01.mal +# 20:40:09 > + +# builtin opt gdk_dbname = demo +# builtin opt gdk_dbfarm = /ufs/mk/sciql//Linux/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 = /ufs/mk/sciql//Linux/var/MonetDB +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 37449 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbname = mTests_modules_mal + +# 20:40:09 > +# 20:40:09 > Done. +# 20:40:09 > + diff --git a/monetdb5/modules/mal/Tests/array01.stable.out b/monetdb5/modules/mal/Tests/array01.stable.out new file mode 100644 --- /dev/null +++ b/monetdb5/modules/mal/Tests/array01.stable.out @@ -0,0 +1,158 @@ +stdout of test 'array01` in directory 'modules/mal` itself: + + +# 20:40:09 > +# 20:40:09 > mserver5 --debug=10 --set gdk_nr_threads=0 --set "gdk_dbfarm=/ufs/mk/sciql//Linux/var/MonetDB" --set mapi_open=true --set mapi_port=37449 --set monet_prompt= --trace --forcemito --set mal_listing=2 --dbname=mTests_modules_mal array01.mal +# 20:40:09 > + +# MonetDB 5 server v11.4.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://monetdb.cwi.nl/ for further information +# Listening for connection requests on mapi:monetdb://eir.ins.cwi.nl:37449/ +# MonetDB/GIS module loaded +# MonetDB/SQL module loaded +function user.main():void; +#extraction of cell positions from arrays +#create array v(i int dimension[0:1:4]) + v := array.series(0,1,4,1,1); + io.print(v); +#create array M(x int dimension[0:2:6], y int dimension[0:1:4], int default 333); + mx := array.series(0,2,6,4,1); + my := array.series(0,1,4,1,3); + mv := array.filler(mx,333); + io.print(mx,my,mv); +#extract the indices from both +#do a point select + x := bat.new(:oid,:int); + bat.insert(x,0@0,1); + io.print(x); + y := bat.new(:oid,:int); + bat.insert(y,0@0,2); + io.print(y); +#fetch the position of an element in a vector + z1 := array.map(v,x); + io.print(z1); + z1 := array.map(v,y); + io.print(z1); +#get the original cell oids + x1 := array.map(v,v); + io.print(x1); + x2 := array.map(mx,my,mx,my); + io.print(x2); +# select a slice M[2][0:1:3] + x3 := array.map(mx,my,y,v); + io.print(x3); +# select a slice M[0:1:3][2] + x3 := array.map(mx,my,v,y); + io.print(x3); +# select a slice A[0:1:3][0:2:6] + x4 := array.map(v,mx); + io.print(x4); +# select a slice [0:1:3][0:2:6] _______________________________________________ Checkin-list mailing list [email protected] http://mail.monetdb.org/mailman/listinfo/checkin-list
