[Numpy-svn] r5976 - in trunk/numpy/core: code_generators src

numpy-svn@scip... numpy-svn@scip...
Wed Nov 5 16:53:46 CST 2008


Author: charris
Date: 2008-11-05 16:53:39 -0600 (Wed, 05 Nov 2008)
New Revision: 5976

Modified:
   trunk/numpy/core/code_generators/generate_umath.py
   trunk/numpy/core/src/umathmodule.c.src
Log:
Merge branch 'ufunc'

Conflicts:

	numpy/core/src/umathmodule.c.src

Modified: trunk/numpy/core/code_generators/generate_umath.py
===================================================================
--- trunk/numpy/core/code_generators/generate_umath.py	2008-11-05 19:40:28 UTC (rev 5975)
+++ trunk/numpy/core/code_generators/generate_umath.py	2008-11-05 22:53:39 UTC (rev 5976)
@@ -221,7 +221,7 @@
 'ones_like' :
     Ufunc(1, 1, None,
           docstrings.get('numpy.core.umath.ones_like'),
-          TD(nobool_or_obj),
+          TD(noobj),
           TD(O, f='Py_get_one'),
           ),
 'power' :
@@ -319,18 +319,25 @@
 'fmax' :
     Ufunc(2, 1, None,
           "",
-          TD(inexact)
+          TD(noobj),
+          TD(O, f='_npy_ObjectMax')
           ),
 'fmin' :
     Ufunc(2, 1, None,
           "",
-          TD(inexact)
+          TD(noobj),
+          TD(O, f='_npy_ObjectMin')
           ),
 'logsumexp' :
     Ufunc(2, 1, None,
           "",
           TD(flts, f="logsumexp")
           ),
+'logsumexp' :
+    Ufunc(2, 1, None,
+          "",
+          TD(flts, f="logsumexp")
+          ),
 'bitwise_and' :
     Ufunc(2, 1, One,
           docstrings.get('numpy.core.umath.bitwise_and'),

Modified: trunk/numpy/core/src/umathmodule.c.src
===================================================================
--- trunk/numpy/core/src/umathmodule.c.src	2008-11-05 19:40:28 UTC (rev 5975)
+++ trunk/numpy/core/src/umathmodule.c.src	2008-11-05 22:53:39 UTC (rev 5976)
@@ -36,18 +36,10 @@
  */
 
 #define PI 3.14159265358979323846264338328@c@
+#define degrees@c@ deg2rad@c@
+#define radians@c@ rad2deg@c@
 
 static @type@
-degrees@c@(@type@ x) {
-    return x*(180.0@c@/PI);
-}
-
-static @type@
-radians@c@(@type@ x) {
-    return x*(PI/180.0@c@);
-}
-
-static @type@
 rad2deg@c@(@type@ x) {
     return x*(180.0@c@/PI);
 }
@@ -136,7 +128,7 @@
  */
 
 
-/* 
+/*
  * Don't pass structures between functions (only pointers) because how
  * structures are passed is compiler dependent and could cause
  * segfaults if ufuncobject.c is compiled with a different compiler
@@ -576,6 +568,8 @@
 #define BOOL_bitwise_xor BOOL_logical_xor
 #define BOOL_multiply BOOL_logical_and
 #define BOOL_subtract BOOL_logical_xor
+#define BOOL_fmax BOOL_maximum
+#define BOOL_fmin BOOL_minimum
 
 /**begin repeat
  * #kind = equal, not_equal, greater, greater_equal, less, less_equal,
@@ -661,6 +655,8 @@
  */
 
 #define @S@@TYPE@_floor_divide @S@@TYPE@_divide
+#define @S@@TYPE@_fmax @S@@TYPE@_maximum
+#define @S@@TYPE@_fmin @S@@TYPE@_minimum
 
 static void
 @S@@TYPE@_ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data))



More information about the Numpy-svn mailing list