Update of /cvsroot/monetdb/MonetDB5/src/optimizer/Tests
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25089/optimizer/Tests

Modified Files:
        All 
Added Files:
        inline02.mal inline03.mal inline04.mal inline05.mal 
        inline06.mal inliners.mal 
Removed Files:
        remap01.mal remap02.mal remap03.mal remap04.mal remap05.mal 
Log Message:
preparing for handling multiplexed inline functions.
minor code cleanup, saving 1.5 page of code.


Index: All
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/optimizer/Tests/All,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- All 23 Dec 2007 09:50:37 -0000      1.56
+++ All 24 Dec 2007 12:28:25 -0000      1.57
@@ -31,11 +31,6 @@
 cst01
 
 remap
-#remap01
-#remap02
-#remap03
-#remap04
-#remap05
 
 #mat00
 #mat01
@@ -68,6 +63,11 @@
 
 inline00
 inline01
+#inline02
+#inline03
+#inline04
+#inline05
+#inline06
 
 CXerror1
 #the remainder are snippets used in the reference manual

--- NEW FILE: inline02.mal ---
# remapping inline functions
function foo{inline}(a:int,b:int):int;
        c:= a+b;
        return c;
end foo;

function qry();
        b:= bat.new(:oid,:int);
        bat.insert(b,[EMAIL PROTECTED],1);
        z:bat[:oid,:int]:= mal.multiplex("user","foo",b,b);
        z:bat[:oid,:int]:= mal.multiplex("user","foo",b,2);
end qry;

        optimizer.inline("user","qry");
        mdb.list("user","qry");

--- NEW FILE: inline05.mal ---
# remapping inline functions
# the crucial part is to recognize valid inlines
function foo{inline}(a:int,b:int):int;
        c:= a+b;
        io.print(c); # this has a memory-less side effect
        return foo:=1;
end foo;

function qry();
        b:= bat.new(:oid,:int);
        bat.insert(b,[EMAIL PROTECTED],1);
        z:bat[:oid,:int]:= mal.multiplex("user","foo",b,b);
        z:bat[:oid,:int]:= mal.multiplex("user","foo",b,2);
end qry;

        optimizer.inline("user","qry");
        mdb.list("user","qry");

--- NEW FILE: inline04.mal ---
# remapping inline functions
# the crucial part is to recognize valid inlines
# here the inlined function contains more then
# just multiplex callable functions.
function foo{inline}(a:int,b:int):int;
        c:= a+b;
        base:=1;
barrier loop:= true;
        c:= c *c;
        base:= base+1;
        redo loop:= base <3;
exit loop;
        return c;
end foo;
function qry();
        b:= bat.new(:oid,:int);
        bat.insert(b,[EMAIL PROTECTED],1);
        z:bat[:oid,:int]:= mal.multiplex("user","foo",b,b);
        z:bat[:oid,:int]:= mal.multiplex("user","foo",b,2);
end qry;

        optimizer.inline("user","qry");
        mdb.list("user","qry");

--- NEW FILE: inline06.mal ---
# remapping inline functions
# the crucial part is to recognize valid inlines
function foo{inline}(a:int,b:int):int;
        c:= a+b;
        base:=mmath.rand(c); # this has a memory-side effect
        c:= c*base;
        return c;
end foo;

function qry();
        b:= bat.new(:oid,:int);
        bat.insert(b,[EMAIL PROTECTED],1);
        z:bat[:oid,:int]:= mal.multiplex("user","foo",b,b);
        z:bat[:oid,:int]:= mal.multiplex("user","foo",b,2);
end qry;

        optimizer.inline("user","qry");
        mdb.list("user","qry");

--- NEW FILE: inline03.mal ---
# remapping inline functions
# the crucial part is to recognize valid inlines
function foo{inline}(a:int,b:int):int;
        base:=1;
        c:= a+b;
        c:= c *base;
        return c;
end foo;

function qry();
        b:= bat.new(:oid,:int);
        bat.insert(b,[EMAIL PROTECTED],1);
        z:bat[:oid,:int]:= mal.multiplex("user","foo",b,b);
        z:bat[:oid,:int]:= mal.multiplex("user","foo",b,2);
end qry;
        optimizer.inline("user","qry");
        mdb.list("user","qry");

--- remap01.mal DELETED ---

--- remap04.mal DELETED ---

--- remap05.mal DELETED ---

--- NEW FILE: inliners.mal ---

#SELECT  p.objID, p.run
#FROM fGetNearbyObjEq(195,2.5,0.5) n, PhotoPrimary p 
#WHERE n.objID=p.objID;

function sql_cache.s0_1(A0:sht,A1:sht,A2:sht):void;
    _11:bat[:oid,:sht]{rows=200276,bid=6912}  := 
sql.bind("sys","photoobjall","mode",0);
    _18:bat[:oid,:sht]{rows=0,bid=9517}  := 
sql.bind("sys","photoobjall","mode",1);
    _21:bat[:oid,:sht]{rows=0,bid=9518}  := 
sql.bind("sys","photoobjall","mode",2);
    _26:bat[:oid,:oid]{rows=0,bid=9502}  := 
sql.bind_dbat("sys","photoobjall",0);
    _32:bat[:oid,:lng]{rows=200276,bid=7122}  := 
sql.bind("sys","photoobjall","objid",0);
    _33:bat[:oid,:lng]{rows=0,bid=9503}  := 
sql.bind("sys","photoobjall","objid",1);
    _35:bat[:oid,:lng]{rows=0,bid=9504}  := 
sql.bind("sys","photoobjall","objid",2);
    _45:bat[:oid,:sht]{rows=200276,bid=6927}  := 
sql.bind("sys","photoobjall","run",0);
    _47:bat[:oid,:sht]{rows=0,bid=9507}  := 
sql.bind("sys","photoobjall","run",1);
    _49:bat[:oid,:sht]{rows=0,bid=9508}  := 
sql.bind("sys","photoobjall","run",2);
    _4 := calc.dbl(A0);
    _5 := calc.dbl(1,A1);
    _7 := calc.dbl(1,A2);
    _8 := sql_cache.fgetnearbyobjeq(_4,_5,_7);
    _10:bat[:oid,:lng]  := sql.columnBind(_8,"objid");
    _17{rows=100139} := algebra.uselect(_11,1);
    _11:bat[:oid,:sht]{rows=200276,bid=6912}  := nil;
    _19{rows=0} := algebra.uselect(_18,1);
    _18:bat[:oid,:sht]{rows=0,bid=9517}  := nil;
    _20{rows=100139} := algebra.kunion(_17,_19);
    _17{rows=100139} := nil;
    _19{rows=0} := nil;
    _23{rows=100139} := algebra.kdifference(_20,_21);
    _20{rows=100139} := nil;
    _24{rows=0} := algebra.uselect(_21,1);
    _21:bat[:oid,:sht]{rows=0,bid=9518}  := nil;
    _25{rows=100139} := algebra.kunion(_23,_24);
    _23{rows=100139} := nil;
    _24{rows=0} := nil;
    _27{rows=0} := bat.reverse(_26);
    _26:bat[:oid,:oid]{rows=0,bid=9502}  := nil;
    _28{rows=100139} := algebra.kdifference(_25,_27);
    _25{rows=100139} := nil;
    _27{rows=0} := nil;
    _30{rows=100139} := algebra.markT(_28,[EMAIL PROTECTED]);
    _28{rows=100139} := nil;
    _31{rows=100139} := bat.reverse(_30);
    _30{rows=100139} := nil;
    _34{rows=200276} := algebra.kunion(_32,_33);
    _32:bat[:oid,:lng]{rows=200276,bid=7122}  := nil;
    _33:bat[:oid,:lng]{rows=0,bid=9503}  := nil;
    _36{rows=200276} := algebra.kdifference(_34,_35);
    _34{rows=200276} := nil;
    _37{rows=200276} := algebra.kunion(_36,_35);
    _36{rows=200276} := nil;
    _35:bat[:oid,:lng]{rows=0,bid=9504}  := nil;
    _38{rows=100139} := algebra.join(_31,_37);
    _31{rows=100139} := bat.reduce(_31);
    _37{rows=200276} := bat.reduce(_37);
    _39{rows=100139} := bat.reverse(_38);
    _38{rows=100139} := nil;
    _40 := algebra.join(_10,_39);
    _10:bat[:oid,:lng]  := nil;
    _39{rows=100139} := nil;
    _41 := bat.reverse(_40);
    _40 := nil;
    _42 := algebra.markT(_41,[EMAIL PROTECTED]);
    _41 := nil;
    _43 := bat.reverse(_42);
    _42 := nil;
    _44 := algebra.joinPath(_43,_31,_37);
    _43 := bat.reduce(_43);
    _31{rows=100139} := bat.reduce(_31);
    _37{rows=200276} := nil;
    _48{rows=200276} := algebra.kunion(_45,_47);
    _45:bat[:oid,:sht]{rows=200276,bid=6927}  := nil;
    _47:bat[:oid,:sht]{rows=0,bid=9507}  := nil;
    _50{rows=200276} := algebra.kdifference(_48,_49);
    _48{rows=200276} := nil;
    _51{rows=200276} := algebra.kunion(_50,_49);
    _50{rows=200276} := nil;
    _49:bat[:oid,:sht]{rows=0,bid=9508}  := nil;
    _52 := algebra.joinPath(_43,_31,_51);
    _43 := nil;
    _31{rows=100139} := nil;
    _51{rows=200276} := nil;
    _53 := sql.resultSet(2,1,_44);
    sql.rsColumn(_53,"sys.p","objid","bigint",64,0,_44);
    _44 := nil;
    sql.rsColumn(_53,"sys.p","run","smallint",16,0,_52);
    _52 := nil;
    sql.exportResult(_53,"");
end s0_1;


function sql_cache.fgetnearbyobjeq(pra:dbl,pdec:dbl,pr:dbl):BAT;
    theta := nil:dbl;
    _7 := calc.dbl(0,60);
    _9 := calc./(pr,_7);
    theta := _9;
    _11 := sql_cache.getnearbyobjectsmode(pra,pdec,theta,1);
    _13:bat[:oid,:lng]  := sql.columnBind(_11,"objid");
    _14 := bat.reverse(_13);
    _15 := bat.reverse(_14);
    _14 := nil;
    _17 := algebra.markT(_15,[EMAIL PROTECTED]);
    _15 := nil;
    _18 := bat.reverse(_17);
    _17 := nil;
    _19 := algebra.join(_18,_13);
    _18 := bat.reduce(_18);
    _13:bat[:oid,:lng]  := nil;
    _21:bat[:oid,:dbl]  := sql.columnBind(_11,"distance");
    _22 := algebra.join(_18,_21);
    _18 := nil;
    _21:bat[:oid,:dbl]  := nil;
    _23 := bat.new(nil:str,nil);
    bat.insert(_23,"objid",_19);
    _19 := nil;
    bat.insert(_23,"distance",_22);
    _22 := nil;
    return _28 := _23;
    _23 := nil;
end fgetnearbyobjeq;


function 
sql_cache.getnearbyobjectsmode(pra:dbl,pdec:dbl,ptheta:dbl,pmode:sht):BAT;
    _14:bat[:oid,:dbl]{rows=1,bid=8696}  := 
sql.bind("sys","zoneheight","value",0);
    _19:bat[:oid,:dbl]{rows=0,bid=11320}  := 
sql.bind("sys","zoneheight","value",1);
    _22:bat[:oid,:dbl]{rows=0,bid=11323}  := 
sql.bind("sys","zoneheight","value",2);
    _26:bat[:oid,:oid]{rows=0,bid=11316}  := 
sql.bind_dbat("sys","zoneheight",0);
    _54:bat[:oid,:dbl]{rows=200276,bid=8774}  := 
sql.bind("sys","zoneindex","x",0);
    _57:bat[:oid,:dbl]{rows=0,bid=11232}  := sql.bind("sys","zoneindex","x",1);
    _59:bat[:oid,:dbl]{rows=0,bid=11233}  := sql.bind("sys","zoneindex","x",2);
    _62:bat[:oid,:oid]{rows=0,bid=11222}  := sql.bind_dbat("sys","zoneindex",0);
    _65:bat[:oid,:dbl]{rows=200276,bid=8582}  := 
sql.bind("sys","zoneindex","dec",0);
    _67:bat[:oid,:dbl]{rows=0,bid=11229}  := 
sql.bind("sys","zoneindex","dec",1);
    _69:bat[:oid,:dbl]{rows=0,bid=11230}  := 
sql.bind("sys","zoneindex","dec",2);
    _72:bat[:oid,:oid]{rows=0,bid=11222}  := sql.bind_dbat("sys","zoneindex",0);
    _75:bat[:oid,:dbl]{rows=200276,bid=8573}  := 
sql.bind("sys","zoneindex","ra",0);
    _77:bat[:oid,:dbl]{rows=0,bid=11227}  := sql.bind("sys","zoneindex","ra",1);
    _79:bat[:oid,:dbl]{rows=0,bid=11228}  := sql.bind("sys","zoneindex","ra",2);
    _82:bat[:oid,:oid]{rows=0,bid=11222}  := sql.bind_dbat("sys","zoneindex",0);
    _85:bat[:oid,:sht]{rows=200276,bid=11231}  := 
sql.bind("sys","zoneindex","mode",0);
    _87:bat[:oid,:sht]{rows=0,bid=11238}  := 
sql.bind("sys","zoneindex","mode",1);
    _89:bat[:oid,:sht]{rows=0,bid=11239}  := 
sql.bind("sys","zoneindex","mode",2);
    _92:bat[:oid,:oid]{rows=0,bid=11222}  := sql.bind_dbat("sys","zoneindex",0);
    _95:bat[:oid,:int]{rows=200276,bid=8807}  := 
sql.bind("sys","zoneindex","zone",0);
    _97:bat[:oid,:int]{rows=0,bid=11225}  := 
sql.bind("sys","zoneindex","zone",1);
    _99:bat[:oid,:int]{rows=0,bid=11226}  := 
sql.bind("sys","zoneindex","zone",2);
    _102:bat[:oid,:oid]{rows=0,bid=11222}  := 
sql.bind_dbat("sys","zoneindex",0);
    _117:bat[:oid,:dbl]{rows=200276,bid=8741}  := 
sql.bind("sys","zoneindex","y",0);
    _119:bat[:oid,:dbl]{rows=0,bid=11234}  := sql.bind("sys","zoneindex","y",1);
    _121:bat[:oid,:dbl]{rows=0,bid=11235}  := sql.bind("sys","zoneindex","y",2);
    _124:bat[:oid,:oid]{rows=0,bid=11222}  := 
sql.bind_dbat("sys","zoneindex",0);
    _129:bat[:oid,:dbl]{rows=200276,bid=8732}  := 
sql.bind("sys","zoneindex","z",0);
    _131:bat[:oid,:dbl]{rows=0,bid=11236}  := sql.bind("sys","zoneindex","z",1);
    _133:bat[:oid,:dbl]{rows=0,bid=11237}  := sql.bind("sys","zoneindex","z",2);
    _136:bat[:oid,:oid]{rows=0,bid=11222}  := 
sql.bind_dbat("sys","zoneindex",0);
    _149:bat[:oid,:lng]{rows=200276,bid=8555}  := 
sql.bind("sys","zoneindex","objid",0);
    _151:bat[:oid,:lng]{rows=0,bid=11223}  := 
sql.bind("sys","zoneindex","objid",1);
    _153:bat[:oid,:lng]{rows=0,bid=11224}  := 
sql.bind("sys","zoneindex","objid",2);
    _156:bat[:oid,:oid]{rows=0,bid=11222}  := 
sql.bind_dbat("sys","zoneindex",0);
    alpha1 := nil:dbl;
    zheight := alpha1;
    x1 := alpha1;
    y1 := alpha1;
    z1 := alpha1;
    zmin := nil:int;
    zmax := zmin;
    _21{rows=1} := algebra.kunion(_14,_19);
    _14:bat[:oid,:dbl]{rows=1,bid=8696}  := nil;
    _19:bat[:oid,:dbl]{rows=0,bid=11320}  := nil;
    _24{rows=1} := algebra.kdifference(_21,_22);
    _21{rows=1} := nil;
    _25{rows=1} := algebra.kunion(_24,_22);
    _24{rows=1} := nil;
    _22:bat[:oid,:dbl]{rows=0,bid=11323}  := nil;
    _27{rows=0} := bat.reverse(_26);
    _26:bat[:oid,:oid]{rows=0,bid=11316}  := nil;
    _28{rows=1} := algebra.kdifference(_25,_27);
    _25{rows=1} := nil;
    _27{rows=0} := nil;
    _29{rows=1} := bat.reverse(_28);
    _30{rows=1} := bat.reverse(_29);
    _29{rows=1} := nil;
    _32{rows=1} := algebra.markT(_30,[EMAIL PROTECTED]);
    _30{rows=1} := nil;
    _33{rows=1} := bat.reverse(_32);
    _32{rows=1} := nil;
    _34{rows=1} := algebra.join(_33,_28);
    _33{rows=1} := nil;
    _28{rows=1} := nil;
    _35 := algebra.selectNotNil(_34);
    _34{rows=1} := nil;
    _36 := aggr.min(_35);
    _35 := nil;
    zheight := _36;
    _37 := sql_cache.alpha(ptheta,pdec);
    alpha1 := _37;
    _38 := sql_cache.radians(pdec);
    _39 := mmath.cos(_38);
    _40 := sql_cache.radians(pra);
    _41 := mmath.cos(_40);
    _42 := calc.*(_39,_41);
    x1 := _42;
    _43 := mmath.sin(_40);
    _44 := calc.*(_39,_43);
    y1 := _44;
    _45 := mmath.sin(_38);
    z1 := _45;
    _46 := calc.-(pdec,ptheta);
    _47 := calc./(_46,zheight);
    _48 := mmath.floor(_47);
    _49 := calc.int(_48);
    zmin := _49;
    _50 := calc.+(pdec,ptheta);
    _51 := calc./(_50,zheight);
    _52 := mmath.floor(_51);
    _53 := calc.int(_52);
    zmax := _53;
    _58{rows=200276} := algebra.kunion(_54,_57);
    _54:bat[:oid,:dbl]{rows=200276,bid=8774}  := nil;
    _57:bat[:oid,:dbl]{rows=0,bid=11232}  := nil;
    _60{rows=200276} := algebra.kdifference(_58,_59);
    _58{rows=200276} := nil;
    _61{rows=200276} := algebra.kunion(_60,_59);
    _60{rows=200276} := nil;
    _59:bat[:oid,:dbl]{rows=0,bid=11233}  := nil;
    _63{rows=0} := bat.reverse(_62);
    _62:bat[:oid,:oid]{rows=0,bid=11222}  := nil;
    _64{rows=200276} := algebra.kdifference(_61,_63);
    _61{rows=200276} := nil;
    _63{rows=0} := nil;
    _68{rows=200276} := algebra.kunion(_65,_67);
    _65:bat[:oid,:dbl]{rows=200276,bid=8582}  := nil;
    _67:bat[:oid,:dbl]{rows=0,bid=11229}  := nil;
    _70{rows=200276} := algebra.kdifference(_68,_69);
    _68{rows=200276} := nil;
    _71{rows=200276} := algebra.kunion(_70,_69);
    _70{rows=200276} := nil;
    _69:bat[:oid,:dbl]{rows=0,bid=11230}  := nil;
    _73{rows=0} := bat.reverse(_72);
    _72:bat[:oid,:oid]{rows=0,bid=11222}  := nil;
    _74{rows=200276} := algebra.kdifference(_71,_73);
    _71{rows=200276} := nil;
    _73{rows=0} := nil;
    _78{rows=200276} := algebra.kunion(_75,_77);
    _75:bat[:oid,:dbl]{rows=200276,bid=8573}  := nil;
    _77:bat[:oid,:dbl]{rows=0,bid=11227}  := nil;
    _80{rows=200276} := algebra.kdifference(_78,_79);
    _78{rows=200276} := nil;
    _81{rows=200276} := algebra.kunion(_80,_79);
    _80{rows=200276} := nil;
    _79:bat[:oid,:dbl]{rows=0,bid=11228}  := nil;
    _83{rows=0} := bat.reverse(_82);
    _82:bat[:oid,:oid]{rows=0,bid=11222}  := nil;
    _84{rows=200276} := algebra.kdifference(_81,_83);
    _81{rows=200276} := nil;
    _83{rows=0} := nil;
    _88{rows=200276} := algebra.kunion(_85,_87);
    _85:bat[:oid,:sht]{rows=200276,bid=11231}  := nil;
    _87:bat[:oid,:sht]{rows=0,bid=11238}  := nil;
    _90{rows=200276} := algebra.kdifference(_88,_89);
    _88{rows=200276} := nil;
    _91{rows=200276} := algebra.kunion(_90,_89);
    _90{rows=200276} := nil;
    _89:bat[:oid,:sht]{rows=0,bid=11239}  := nil;
    _93{rows=0} := bat.reverse(_92);
    _92:bat[:oid,:oid]{rows=0,bid=11222}  := nil;
    _94{rows=200276} := algebra.kdifference(_91,_93);
    _91{rows=200276} := nil;
    _93{rows=0} := nil;
    _98{rows=200276} := algebra.kunion(_95,_97);
    _95:bat[:oid,:int]{rows=200276,bid=8807}  := nil;
    _97:bat[:oid,:int]{rows=0,bid=11225}  := nil;
    _100{rows=200276} := algebra.kdifference(_98,_99);
    _98{rows=200276} := nil;
    _101{rows=200276} := algebra.kunion(_100,_99);
    _100{rows=200276} := nil;
    _99:bat[:oid,:int]{rows=0,bid=11226}  := nil;
    _103{rows=0} := bat.reverse(_102);
    _102:bat[:oid,:oid]{rows=0,bid=11222}  := nil;
    _104{rows=200276} := algebra.kdifference(_101,_103);
    _101{rows=200276} := nil;
    _103{rows=0} := nil;
    _105{rows=100139} := algebra.uselect(_104,zmin,zmax,true,true);
    _104{rows=200276} := nil;
    _107{rows=100139} := algebra.semijoin(_94,_105);
    _94{rows=200276} := nil;
    _105{rows=100139} := nil;
    _108{rows=50070} := algebra.uselect(_107,pmode,pmode,true,true);
    _107{rows=100139} := nil;
    _109{rows=50070} := algebra.semijoin(_84,_108);
    _84{rows=200276} := nil;
    _108{rows=50070} := nil;
    _110 := calc.-(pra,alpha1);
    _111 := calc.+(pra,alpha1);
    _112{rows=25036} := algebra.uselect(_109,_110,_111,true,true);
    _109{rows=50070} := nil;
    _113{rows=25036} := algebra.semijoin(_74,_112);
    _74{rows=200276} := nil;
    _112{rows=25036} := nil;
    _114{rows=12519} := algebra.uselect(_113,_46,_50,true,true);
    _113{rows=25036} := nil;
    _115{rows=12519} := algebra.semijoin(_64,_114);
    _64{rows=200276} := bat.reduce(_64);
    _114{rows=12519} := bat.reduce(_114);
    _116:bat[:oid,:dbl]{rows=12519}  := algebra.reuse(_115);
    _116:bat[:oid,:dbl]{rows=12519}  := batcalc.*(_116,x1,_115);
    _115{rows=12519} := nil;
    _120{rows=200276} := algebra.kunion(_117,_119);
    _117:bat[:oid,:dbl]{rows=200276,bid=8741}  := nil;
    _119:bat[:oid,:dbl]{rows=0,bid=11234}  := nil;
    _122{rows=200276} := algebra.kdifference(_120,_121);
    _120{rows=200276} := nil;
    _123{rows=200276} := algebra.kunion(_122,_121);
    _122{rows=200276} := nil;
    _121:bat[:oid,:dbl]{rows=0,bid=11235}  := nil;
    _125{rows=0} := bat.reverse(_124);
    _124:bat[:oid,:oid]{rows=0,bid=11222}  := nil;
    _126{rows=200276} := algebra.kdifference(_123,_125);
    _123{rows=200276} := nil;
    _125{rows=0} := nil;
    _127{rows=12519} := algebra.semijoin(_126,_114);
    _126{rows=200276} := bat.reduce(_126);
    _114{rows=12519} := bat.reduce(_114);
    _128:bat[:oid,:dbl]{rows=12519}  := algebra.reuse(_127);
    _128:bat[:oid,:dbl]{rows=12519}  := batcalc.*(_128,y1,_127);
    _127{rows=12519} := nil;
    _116:bat[:oid,:dbl]{rows=12519}  := batcalc.+(_116,_116,_128);
    _128:bat[:oid,:dbl]{rows=12519}  := nil;
    _132{rows=200276} := algebra.kunion(_129,_131);
    _129:bat[:oid,:dbl]{rows=200276,bid=8732}  := nil;
    _131:bat[:oid,:dbl]{rows=0,bid=11236}  := nil;
    _134{rows=200276} := algebra.kdifference(_132,_133);
    _132{rows=200276} := nil;
    _135{rows=200276} := algebra.kunion(_134,_133);
    _134{rows=200276} := nil;
    _133:bat[:oid,:dbl]{rows=0,bid=11237}  := nil;
    _137{rows=0} := bat.reverse(_136);
    _136:bat[:oid,:oid]{rows=0,bid=11222}  := nil;
    _138{rows=200276} := algebra.kdifference(_135,_137);
    _135{rows=200276} := nil;
    _137{rows=0} := nil;
    _139{rows=12519} := algebra.semijoin(_138,_114);
    _138{rows=200276} := bat.reduce(_138);
    _114{rows=12519} := nil;
    _140:bat[:oid,:dbl]{rows=12519}  := algebra.reuse(_139);
    _140:bat[:oid,:dbl]{rows=12519}  := batcalc.*(_140,z1,_139);
    _139{rows=12519} := nil;
    _116:bat[:oid,:dbl]{rows=12519}  := batcalc.+(_116,_116,_140);
    _140:bat[:oid,:dbl]{rows=12519}  := nil;
    _141 := sql_cache.radians(ptheta);
    _142 := mmath.cos(_141);
    _143{rows=6260} := algebra.uselect(_116,_142,nil:dbl,false,false);
    _116:bat[:oid,:dbl]{rows=12519}  := nil;
    _145{rows=6260} := bat.reverse(_143);
    _143{rows=6260} := nil;
    _146{rows=6260} := bat.reverse(_145);
    _145{rows=6260} := nil;
    _147{rows=6260} := algebra.markT(_146,[EMAIL PROTECTED]);
    _146{rows=6260} := nil;
    _148{rows=6260} := bat.reverse(_147);
    _147{rows=6260} := nil;
    _152{rows=200276} := algebra.kunion(_149,_151);
    _149:bat[:oid,:lng]{rows=200276,bid=8555}  := nil;
    _151:bat[:oid,:lng]{rows=0,bid=11223}  := nil;
    _154{rows=200276} := algebra.kdifference(_152,_153);
    _152{rows=200276} := nil;
    _155{rows=200276} := algebra.kunion(_154,_153);
    _154{rows=200276} := nil;
    _153:bat[:oid,:lng]{rows=0,bid=11224}  := nil;
    _157{rows=0} := bat.reverse(_156);
    _156:bat[:oid,:oid]{rows=0,bid=11222}  := nil;
    _158{rows=200276} := algebra.kdifference(_155,_157);
    _155{rows=200276} := nil;
    _157{rows=0} := nil;
    _159{rows=6260} := algebra.join(_148,_158);
    _148{rows=6260} := bat.reduce(_148);
    _158{rows=200276} := nil;
    _161 := calc.dbl(0);
    _162{rows=6260} := algebra.project(_148,_161);
    _163{rows=6260} := algebra.join(_148,_64);
    _148{rows=6260} := bat.reduce(_148);
    _64{rows=200276} := bat.reduce(_64);
    _164:bat[:oid,:dbl]{rows=6260}  := algebra.reuse(_163);
    _164:bat[:oid,:dbl]{rows=6260}  := batcalc.*(_164,x1,_163);
    _163{rows=6260} := nil;
    _165{rows=6260} := algebra.join(_148,_126);
    _148{rows=6260} := bat.reduce(_148);
    _126{rows=200276} := bat.reduce(_126);
    _166:bat[:oid,:dbl]{rows=6260}  := algebra.reuse(_165);
    _166:bat[:oid,:dbl]{rows=6260}  := batcalc.*(_166,y1,_165);
    _165{rows=6260} := nil;
    _164:bat[:oid,:dbl]{rows=6260}  := batcalc.+(_164,_164,_166);
    _166:bat[:oid,:dbl]{rows=6260}  := nil;
    _167{rows=6260} := algebra.join(_148,_138);
    _148{rows=6260} := bat.reduce(_148);
    _138{rows=200276} := bat.reduce(_138);
    _168:bat[:oid,:dbl]{rows=6260}  := algebra.reuse(_167);
    _168:bat[:oid,:dbl]{rows=6260}  := batcalc.*(_168,z1,_167);
    _167{rows=6260} := nil;
    _164:bat[:oid,:dbl]{rows=6260}  := batcalc.+(_164,_164,_168);
    _168:bat[:oid,:dbl]{rows=6260}  := nil;
    _188 := bat.new(nil:oid,nil:dbl);
barrier (_190,_191,_192):= bat.newIterator(_164);
    _193 := mmath.acos(_192);
    bat.insert(_188,_191,_193);
    redo (_190,_191,_192):= bat.hasMoreElements(_164);
catch MALException:str ;
    redo (_190,_191,_192):= bat.hasMoreElements(_164);
exit MALException:str ;
exit (_190,_191,_192);
    _196 := bat.new(nil:oid,nil:dbl);
barrier (_197,_198,_199):= bat.newIterator(_188);
    _200 := sql_cache.degrees(_199);
    bat.insert(_196,_198,_200);
    redo (_197,_198,_199):= bat.hasMoreElements(_188);
catch MALException:str ;
    redo (_197,_198,_199):= bat.hasMoreElements(_188);
exit MALException:str ;
exit (_197,_198,_199);
    _169{rows=6260} := algebra.join(_148,_64);
    _148{rows=6260} := bat.reduce(_148);
    _170:bat[:oid,:dbl]{rows=6260}  := algebra.reuse(_169);
    _170:bat[:oid,:dbl]{rows=6260}  := batcalc.*(_170,x1,_169);
    _171{rows=6260} := algebra.join(_148,_126);
    _148{rows=6260} := bat.reduce(_148);
    _172:bat[:oid,:dbl]{rows=6260}  := algebra.reuse(_171);
    _172:bat[:oid,:dbl]{rows=6260}  := batcalc.*(_172,y1,_171);
    _170:bat[:oid,:dbl]{rows=6260}  := batcalc.+(_170,_170,_172);
    _173{rows=6260} := algebra.join(_148,_138);
    _174:bat[:oid,:dbl]{rows=6260}  := algebra.reuse(_173);
    _174:bat[:oid,:dbl]{rows=6260}  := batcalc.*(_174,z1,_173);
    _170:bat[:oid,:dbl]{rows=6260}  := batcalc.+(_170,_170,_174);
    _176 := calc.dbl(1);
    _177{rows=3131} := algebra.uselect(_170,nil:dbl,_176,false,false);
    _178 := algebra.semijoin(_196,_177);
    bat.replace(_162,_178,true);
    _180 := bat.new(nil:str,nil);
    bat.insert(_180,"objid",_159);
    bat.insert(_180,"distance",_162);
    return _186 := _180;
end getnearbyobjectsmode;


function sql_cache.alpha{inline}(theta:dbl,decl:dbl):dbl;
    _3 := calc.abs(decl);
    _4 := calc.+(_3,theta);
    _6 := calc.dbl(1,899);
    _8 := calc.>(_4,_6);
barrier _9 := _8;
    _11 := calc.dbl(0,180);
    return _13 := _11;
exit _9;
barrier _14 := calc.not(_8);
    _15 := sql_cache.radians(theta);
    _16 := mmath.sin(_15);
    _17 := calc.-(decl,theta);
    _18 := sql_cache.radians(_17);
    _19 := mmath.cos(_18);
    _20 := calc.+(decl,theta);
    _21 := sql_cache.radians(_20);
    _22 := mmath.cos(_21);
    _23 := calc.*(_19,_22);
    _24 := calc.abs(_23);
    _25 := mmath.sqrt(_24);
    _26 := calc./(_16,_25);
    _27 := mmath.atan(_26);
    _28 := calc.abs(_27);
    _29 := sql_cache.degrees(_28);
    return _30 := _29;
exit _14;
end alpha;


function sql_cache.radians{inline}d:dbl):dbl;
    _2 := mmath.pi();
    _3 := calc.*(d,_2);
    _5 := calc.dbl(180);
    _6 := calc./(_3,_5);
    return _7 := _6;
end radians;


function sql_cache.degrees{inline}(r:dbl):dbl;
    _3 := calc.dbl(180);
    _4 := calc.*(r,_3);
    _5 := mmath.pi();
    _6 := calc./(_4,_5);
    return _7 := _6;
end degrees;

optimizer.inline("sql_cache","alpha");

--- remap02.mal DELETED ---

--- remap03.mal DELETED ---


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to