summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2008-11-05 22:53:39 +0000
committerCharles Harris <charlesr.harris@gmail.com>2008-11-05 22:53:39 +0000
commit4f94b70d7848d5fef8cc8d95b3cf6407f786bafb (patch)
treec1232b119cc0764f1c82a7577e7bb5921c9b8b42 /numpy
parentfcd872c96eb64d36a36f9ae77f79e302c99e20b2 (diff)
downloadnumpy-4f94b70d7848d5fef8cc8d95b3cf6407f786bafb.tar.gz
Merge branch 'ufunc'
Conflicts: numpy/core/src/umathmodule.c.src
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/code_generators/generate_umath.py13
-rw-r--r--numpy/core/src/umathmodule.c.src18
2 files changed, 17 insertions, 14 deletions
diff --git a/numpy/core/code_generators/generate_umath.py b/numpy/core/code_generators/generate_umath.py
index 579184645..789f52735 100644
--- a/numpy/core/code_generators/generate_umath.py
+++ b/numpy/core/code_generators/generate_umath.py
@@ -221,7 +221,7 @@ defdict = {
'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,12 +319,19 @@ defdict = {
'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,
diff --git a/numpy/core/src/umathmodule.c.src b/numpy/core/src/umathmodule.c.src
index 00abe2282..78274bc34 100644
--- a/numpy/core/src/umathmodule.c.src
+++ b/numpy/core/src/umathmodule.c.src
@@ -36,16 +36,8 @@
*/
#define PI 3.14159265358979323846264338328@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@);
-}
+#define degrees@c@ deg2rad@c@
+#define radians@c@ rad2deg@c@
static @type@
rad2deg@c@(@type@ x) {
@@ -136,7 +128,7 @@ _npy_Object@Kind@(PyObject *i1, PyObject *i2)
*/
-/*
+/*
* 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 @@ nc_tanh@c@(c@typ@ *x, c@typ@ *r)
#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 @@ BOOL_ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(data
*/
#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))