Changeset: ec23c51a36f2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ec23c51a36f2
Removed Files:
        monetdb5/modules/kernel/mmath.h
Modified Files:
        clients/Tests/exports.stable.out
        gdk/gdk_aggr.c
        gdk/gdk_atoms.c
        gdk/gdk_calc.c
        gdk/gdk_select.c
        geom/lib/libgeom.c
        geom/monetdb5/geom.h
        monetdb5/modules/atoms/color.c
        monetdb5/modules/kernel/CMakeLists.txt
        monetdb5/modules/kernel/algebra.c
        monetdb5/modules/kernel/batmmath.c
        monetdb5/modules/kernel/microbenchmark.c
        monetdb5/modules/kernel/mmath.c
        monetdb5/modules/kernel/mmath_private.h
        monetdb5/modules/mal/batcalc.c
        monetdb5/modules/mal/calc.c
        monetdb5/optimizer/opt_costModel.h
        sql/backends/monet5/generator/generator.c
        sql/backends/monet5/sql.h
Branch: oscar
Log Message:

Unexport mmath functions + remove some duplication.


diffs (truncated from 641 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -956,30 +956,6 @@ str CMDnoopProfiler(void *res);
 str CMDopenProfilerStream(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
 str CMDqgramnormalize(str *res, str *input);
 str CMDqgramselfjoin(bat *res1, bat *res2, bat *qid, bat *bid, bat *pid, bat 
*lid, flt *c, int *k);
-str CMDscience_bat_acos(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_asin(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_atan(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_atan2(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_cbrt(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_cbrt(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_ceil(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_cos(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_cosh(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_degrees(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_exp(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_fabs(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_floor(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_log(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_log10(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_log2(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_logbs(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_pow(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_radians(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_sin(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_sinh(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_sqrt(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_tan(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str CMDscience_bat_tanh(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
 str CMDsetHeartbeat(void *res, int *ev);
 str CMDsetName(str *rname, const bat *b, str *name);
 str CMDsetprofilerlimit(void *res, int *lim);
@@ -1118,64 +1094,6 @@ str MANIFOLDevaluate(Client cntxt, MalBl
 str MANIFOLDremapMultiplex(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
p);
 MALfcn MANIFOLDtypecheck(Client cntxt, MalBlkPtr mb, InstrPtr pci, int 
checkprops);
 str MANUALcreateOverview(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-str MATHbinary_ATAN2dbl(dbl *res, const dbl *a, const dbl *b);
-str MATHbinary_ATAN2flt(flt *res, const flt *a, const flt *b);
-str MATHbinary_LOGdbl(dbl *res, const dbl *a, const dbl *b);
-str MATHbinary_LOGflt(flt *res, const flt *a, const flt *b);
-str MATHbinary_POWdbl(dbl *res, const dbl *a, const dbl *b);
-str MATHbinary_POWflt(flt *res, const flt *a, const flt *b);
-str MATHbinary_ROUNDdbl(dbl *res, const dbl *a, const int *b);
-str MATHbinary_ROUNDflt(flt *res, const flt *a, const int *b);
-str MATHpi(dbl *pi);
-str MATHprelude(void *ret);
-str MATHrandint(int *res);
-str MATHrandintarg(int *res, const int *dummy);
-str MATHsqlrandint(int *res, const int *seed);
-str MATHsrandint(void *ret, const int *seed);
-str MATHunary_ACOSdbl(dbl *res, const dbl *a);
-str MATHunary_ACOSflt(flt *res, const flt *a);
-str MATHunary_ASINdbl(dbl *res, const dbl *a);
-str MATHunary_ASINflt(flt *res, const flt *a);
-str MATHunary_ATANdbl(dbl *res, const dbl *a);
-str MATHunary_ATANflt(flt *res, const flt *a);
-str MATHunary_CBRTdbl(dbl *res, const dbl *a);
-str MATHunary_CBRTflt(flt *res, const flt *a);
-str MATHunary_CEILdbl(dbl *res, const dbl *a);
-str MATHunary_CEILflt(flt *res, const flt *a);
-str MATHunary_COSHdbl(dbl *res, const dbl *a);
-str MATHunary_COSHflt(flt *res, const flt *a);
-str MATHunary_COSdbl(dbl *res, const dbl *a);
-str MATHunary_COSflt(flt *res, const flt *a);
-str MATHunary_COTdbl(dbl *res, const dbl *a);
-str MATHunary_COTflt(flt *res, const flt *a);
-str MATHunary_DEGREESdbl(dbl *res, const dbl *a);
-str MATHunary_DEGREESflt(flt *res, const flt *a);
-str MATHunary_EXPdbl(dbl *res, const dbl *a);
-str MATHunary_EXPflt(flt *res, const flt *a);
-str MATHunary_FABSdbl(dbl *res, const dbl *a);
-str MATHunary_FINITE(bit *res, const dbl *a);
-str MATHunary_FLOORdbl(dbl *res, const dbl *a);
-str MATHunary_FLOORflt(flt *res, const flt *a);
-str MATHunary_ISINF(int *res, const dbl *a);
-str MATHunary_ISNAN(bit *res, const dbl *a);
-str MATHunary_LOG10dbl(dbl *res, const dbl *a);
-str MATHunary_LOG10flt(flt *res, const flt *a);
-str MATHunary_LOG2dbl(dbl *res, const dbl *a);
-str MATHunary_LOG2flt(flt *res, const flt *a);
-str MATHunary_LOGdbl(dbl *res, const dbl *a);
-str MATHunary_LOGflt(flt *res, const flt *a);
-str MATHunary_RADIANSdbl(dbl *res, const dbl *a);
-str MATHunary_RADIANSflt(flt *res, const flt *a);
-str MATHunary_SINHdbl(dbl *res, const dbl *a);
-str MATHunary_SINHflt(flt *res, const flt *a);
-str MATHunary_SINdbl(dbl *res, const dbl *a);
-str MATHunary_SINflt(flt *res, const flt *a);
-str MATHunary_SQRTdbl(dbl *res, const dbl *a);
-str MATHunary_SQRTflt(flt *res, const flt *a);
-str MATHunary_TANHdbl(dbl *res, const dbl *a);
-str MATHunary_TANHflt(flt *res, const flt *a);
-str MATHunary_TANdbl(dbl *res, const dbl *a);
-str MATHunary_TANflt(flt *res, const flt *a);
 str MATpack(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str MATpackIncrement(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str MATpackValues(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -10,7 +10,6 @@
 #include "gdk.h"
 #include "gdk_private.h"
 #include "gdk_calc_private.h"
-#include <math.h>
 
 /* grouped aggregates
  *
diff --git a/gdk/gdk_atoms.c b/gdk/gdk_atoms.c
--- a/gdk/gdk_atoms.c
+++ b/gdk/gdk_atoms.c
@@ -24,7 +24,6 @@
 #include "gdk.h"
 #include "gdk_time.h"
 #include "gdk_private.h"
-#include <math.h>
 
 /* the *Cmp functions return a value less than zero if the first
  * argument is less than the second; they return zero if the two
diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -10,7 +10,6 @@
 #include "gdk.h"
 #include "gdk_private.h"
 #include "gdk_calc_private.h"
-#include <math.h>
 
 /* Define symbol FULL_IMPLEMENTATION to get implementations for all
  * sensible output types for +, -, *, /.  Without the symbol, all
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -9,7 +9,6 @@
 #include "monetdb_config.h"
 #include "gdk.h"
 #include "gdk_private.h"
-#include <math.h>
 
 /* auxiliary functions and structs for imprints */
 #include "gdk_imprints.h"
diff --git a/geom/lib/libgeom.c b/geom/lib/libgeom.c
--- a/geom/lib/libgeom.c
+++ b/geom/lib/libgeom.c
@@ -16,8 +16,6 @@
 #include "monetdb_config.h"
 #include "libgeom.h"
 
-#include <math.h>
-
 static void __attribute__((__format__(__printf__, 1, 2)))
 geomerror(_In_z_ _Printf_format_string_ const char *fmt, ...)
 {
diff --git a/geom/monetdb5/geom.h b/geom/monetdb5/geom.h
--- a/geom/monetdb5/geom.h
+++ b/geom/monetdb5/geom.h
@@ -20,7 +20,6 @@
 #include "stream.h"
 
 #include <string.h>
-#include <math.h>
 #include <time.h>
 
 #ifdef WIN32
diff --git a/monetdb5/modules/atoms/color.c b/monetdb5/modules/atoms/color.c
--- a/monetdb5/modules/atoms/color.c
+++ b/monetdb5/modules/atoms/color.c
@@ -33,7 +33,6 @@
 #include "monetdb_config.h"
 #include "mal.h"
 #include "mal_exception.h"
-#include <math.h>
 #include "color.h"
 
 /*
diff --git a/monetdb5/modules/kernel/CMakeLists.txt 
b/monetdb5/modules/kernel/CMakeLists.txt
--- a/monetdb5/modules/kernel/CMakeLists.txt
+++ b/monetdb5/modules/kernel/CMakeLists.txt
@@ -11,7 +11,7 @@ add_library(kernel OBJECT)
 target_sources(kernel
   PRIVATE
   alarm.c
-  mmath.c mmath.h mmath_private.h
+  mmath.c mmath_private.h
   bat5.c
   algebra.c algebra.h
   status.c status.h
diff --git a/monetdb5/modules/kernel/algebra.c 
b/monetdb5/modules/kernel/algebra.c
--- a/monetdb5/modules/kernel/algebra.c
+++ b/monetdb5/modules/kernel/algebra.c
@@ -39,7 +39,6 @@
 
 #include "monetdb_config.h"
 #include "algebra.h"
-#include <math.h>
 
 /*
  * Command Implementations in C
diff --git a/monetdb5/modules/kernel/batmmath.c 
b/monetdb5/modules/kernel/batmmath.c
--- a/monetdb5/modules/kernel/batmmath.c
+++ b/monetdb5/modules/kernel/batmmath.c
@@ -8,20 +8,10 @@
 
 #include "monetdb_config.h"
 #include "gdk.h"
-#include <math.h>
 #include <fenv.h>
 #include "mal_exception.h"
 #include "mal_interpreter.h"
 #include "mmath_private.h"
-#ifndef FE_INVALID
-#define FE_INVALID                     0
-#endif
-#ifndef FE_DIVBYZERO
-#define FE_DIVBYZERO           0
-#endif
-#ifndef FE_OVERFLOW
-#define FE_OVERFLOW                    0
-#endif
 
 static str
 CMDscienceUNARY(MalStkPtr stk, InstrPtr pci,
@@ -416,7 +406,7 @@ CMDscienceBINARY(MalStkPtr stk, InstrPtr
 }
 
 #define scienceImpl(FUNC)                                                      
                                        \
-str                                                                            
                                                                \
+static str                                                                     
                                                        \
 CMDscience_bat_##FUNC(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) 
\
 {                                                                              
                                                                \
        (void) cntxt;                                                           
                                                \
@@ -426,7 +416,7 @@ CMDscience_bat_##FUNC(Client cntxt, MalB
 }
 
 #define scienceBinaryImpl(FUNC)                                                
                                        \
-str                                                                            
                                                                \
+static str                                                                     
                                                        \
 CMDscience_bat_##FUNC(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) 
\
 {                                                                              
                                                                \
        (void) cntxt;                                                           
                                                \
@@ -436,7 +426,7 @@ CMDscience_bat_##FUNC(Client cntxt, MalB
 }
 
 #define scienceNotImpl(FUNC)                                                   
                                \
-str                                                                            
                                                                \
+static str                                                                     
                                                        \
 CMDscience_bat_##FUNC(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) 
\
 {                                                                              
                                                                \
        (void) cntxt;                                                           
                                                \
@@ -450,56 +440,27 @@ CMDscience_bat_##FUNC(Client cntxt, MalB
 static double
 radians(double x)
 {
-       return x * (3.14159265358979323846 / 180.0);
+       return x * (M_PI / 180.0);
 }
 
 static float
 radiansf(float x)
 {
-       return (float) (x * (3.14159265358979323846 / 180.0));
+       return (float) (x * (M_PI / 180.0));
 }
 
 static double
 degrees(double x)
 {
-       return x * (180.0 / 3.14159265358979323846);
+       return x * (180.0 / M_PI);
 }
 
 static float
 degreesf(float x)
 {
-       return (float) (x * (180.0 / 3.14159265358979323846));
+       return (float) (x * (180.0 / M_PI));
 }
 
-mal_export str CMDscience_bat_asin(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-mal_export str CMDscience_bat_acos(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-mal_export str CMDscience_bat_atan(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-mal_export str CMDscience_bat_cos(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-mal_export str CMDscience_bat_sin(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-mal_export str CMDscience_bat_tan(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-mal_export str CMDscience_bat_cosh(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-mal_export str CMDscience_bat_sinh(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-mal_export str CMDscience_bat_tanh(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-mal_export str CMDscience_bat_radians(Client cntxt, MalBlkPtr mb, MalStkPtr 
stk, InstrPtr pci);
-mal_export str CMDscience_bat_degrees(Client cntxt, MalBlkPtr mb, MalStkPtr 
stk, InstrPtr pci);
-mal_export str CMDscience_bat_exp(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-mal_export str CMDscience_bat_log(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-mal_export str CMDscience_bat_log10(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-mal_export str CMDscience_bat_log2(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-mal_export str CMDscience_bat_sqrt(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-#ifdef HAVE_CBRT
-mal_export str CMDscience_bat_cbrt(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-#else
-mal_export str CMDscience_bat_cbrt(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to