Update of /cvsroot/monetdb/pathfinder/compiler/mil
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29486/mil

Modified Files:
        mil.c milgen.brg milprint.c 
Log Message:
- Implement pf:product(), pf:log() and pf:sqrt() for the algebra version.
  There is one remaining problem pf:product(()) returns 0 instead of 1.



U milprint.c
Index: milprint.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/milprint.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- milprint.c  6 Feb 2009 13:02:08 -0000       1.92
+++ milprint.c  10 Mar 2009 12:20:44 -0000      1.93
@@ -81,6 +81,7 @@
                  | expression '.max ()'                     <m_max>
                  | expression '.min ()'                     <m_min>
                  | expression '.sum ()'                     <m_sum>
+                 | expression '.prod ()'                    <m_prod>
                  | expression 'bat ()'                      <m_bat>
                  | expression '.CTgroup ()'                 <m_ctgroup>
                  | expression '.CTmap ()'                   <m_ctmap>
@@ -116,6 +117,8 @@
                  | '[abs](' expression ')'                  <m_mabs>
                  | '[ceil](' expression ')'                 <m_mceiling>
                  | '[floor](' expression ')'                <m_mfloor>
+                 | '[log](' expression ')'                  <m_mlog>
+                 | '[sqrt](' expression ')'                 <m_msqrt>
                  | '[round_up](' expression ')'             <m_mround_up>
                  | '>(' expression ',' expression ')'       <m_gt>
                  | '<=(' expression ',' expression ')'      <m_le>
@@ -156,6 +159,7 @@
                  | '{max}(' expression ')'                  <m_gmax>
                  | '{min}(' expression ')'                  <m_gmin>
                  | '{sum}(' expression ')'                  <m_gsum>
+                 | '{prod}(' expression ')'                 <m_gprod>
                  | '{sum}(' expression ',' expression ')'   <m_egsum>
                  | 'usec ()'                                <m_usec>
                  | 'new_ws ('exp')'                         <m_new_ws>
@@ -330,6 +334,8 @@
     , [m_mabs]         = "[abs]"
     , [m_mceiling]     = "[ceil]"
     , [m_mfloor]       = "[floor]"
+    , [m_mlog]         = "[log]"
+    , [m_msqrt]        = "[sqrt]"
     , [m_mround_up]    = "[round_up]"
     , [m_gt]           = ">"
     , [m_le]           = "<="
@@ -419,9 +425,11 @@
     , [m_gmax]     = "{max}"
     , [m_min]      = "min"
     , [m_gmin]     = "{min}"
-    , [m_sum]      = "sum"
     , [m_gsum]     = "{sum}"
     , [m_egsum]    = "{sum}"
+    , [m_prod]     = "prod"
+    , [m_gprod]    = "{prod}"
+    , [m_gprod]    = "{prod}"
     , [m_bat]      = "bat"
     , [m_catch]    = "CATCH"
     , [m_error]    = "ERROR"
@@ -815,6 +823,8 @@
         case m_min:
         /* expression : expression '.sum' */
         case m_sum:
+        /* expression : expression '.prod' */
+        case m_prod:
         /* expression : expression 'bat()' */
         case m_bat:
         /* expression '.CTgroup ()' */
@@ -1006,6 +1016,8 @@
         case m_gmin:
         /* expression: '{sum}(' expression ')' */
         case m_gsum:
+        /* expression: '{prod}(' expression ')' */
+        case m_gprod:
 #ifdef HAVE_GEOXML
         /* expression : '[create_wkb] '(' expression ')' */
         case m_mgeo_create_wkb:
@@ -1054,6 +1066,10 @@
         case m_mceiling:
         /* expression : '[floor](' expression ')' */
         case m_mfloor:
+        /* expression : '[log](' expression ')' */
+        case m_mlog:
+        /* expression : '[sqrt](' expression ')' */
+        case m_msqrt:
         /* expression : '[round_up](' expression ')' */
         case m_mround_up:
         /* expression : 'not(' expression ')' */

U mil.c
Index: mil.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/mil.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- mil.c       6 Feb 2009 13:01:58 -0000       1.79
+++ mil.c       10 Mar 2009 12:20:43 -0000      1.80
@@ -1140,6 +1140,24 @@
 }
 
 /**
+ * Monet prod operator
+ */
+PFmil_t *
+PFmil_prod (const PFmil_t *a)
+{
+    return wire1 (m_prod, a);
+}
+
+/**
+ * Monet grouped prod operator `{prod}()'
+ */
+PFmil_t *
+PFmil_gprod (const PFmil_t *a)
+{
+    return wire1 (m_gprod, a);
+}
+
+/**
  * Type cast.
  */
 PFmil_t *
@@ -1328,6 +1346,24 @@
 }
 
 /**
+ * Multiplexed operator log
+ */
+PFmil_t *
+PFmil_mlog (const PFmil_t *a)
+{
+    return wire1 (m_mlog, a);
+}
+
+/**
+ * Multiplexed operator sqrt
+ */
+PFmil_t *
+PFmil_msqrt (const PFmil_t *a)
+{
+    return wire1 (m_msqrt, a);
+}
+
+/**
  * Multiplexed operator round_up
  */
 PFmil_t *

U milgen.brg
Index: milgen.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/milgen.brg,v
retrieving revision 1.208
retrieving revision 1.209
diff -u -d -r1.208 -r1.209
--- milgen.brg  19 Feb 2009 16:22:37 -0000      1.208
+++ milgen.brg  10 Mar 2009 12:20:43 -0000      1.209
@@ -183,6 +183,7 @@
 %term cast           =  65
 %term seqty1         =  66
 %term all            =  67
+%term prod           =  68
 %term llscjoin       = 100
 %term llscjoin_dup   = 101
 %term doc_tbl        = 120
@@ -270,6 +271,7 @@
 Rel:      cast (Rel)                                               =  78 (10);
 Rel:      seqty1 (Rel)                                             =  79 (10);
 Rel:      all (Rel)                                                =  80 (10);
+Rel:      prod (Rel)                                               =  81 (10);
 
 Rel:      llscjoin (Rel)                                           =  90 (10);
 Rel:      llscjoin_dup (Rel)                                       =  91 (10);
@@ -5269,6 +5271,8 @@
                 case alg_fun_fn_abs:
                 case alg_fun_fn_ceiling:
                 case alg_fun_fn_floor:
+                case alg_fun_pf_log:
+                case alg_fun_pf_sqrt:
                 case alg_fun_fn_round: /* fold( */
                 {
                     PFmil_t * (*op) (const PFmil_t *) = NULL;
@@ -5288,6 +5292,10 @@
                             op = PFmil_mceil; break;
                         case alg_fun_fn_floor:
                             op = PFmil_mfloor; break;
+                        case alg_fun_pf_log:
+                            op = PFmil_mlog; break;
+                        case alg_fun_pf_sqrt:
+                            op = PFmil_msqrt; break;
                         case alg_fun_fn_round:
                             op = PFmil_mround_up; break;
                         default:
@@ -6670,6 +6678,11 @@
              aggr_function (PFmil_sum, PFmil_gsum, p);
              break;
 
+        /* Rel:      prod (Rel) */
+        case 81:
+             aggr_function (PFmil_prod, PFmil_gprod, p);
+             break;
+      
         /* Rel:      mark (Rel) */
         case 71: /* fold( */
         {


------------------------------------------------------------------------------
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to