diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2008-05-19 22:10:36 +0000 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2008-05-19 22:10:36 +0000 |
commit | ebecbb1f048e77eea50a99f13e069e4cc81bdd88 (patch) | |
tree | ae46b457197fbfb3d88a27a55a9a7012f75d4334 /numpy/f2py/cfuncs.py | |
parent | 399147b0b20e32bbb0af62db9bc1fe1100770063 (diff) | |
download | numpy-ebecbb1f048e77eea50a99f13e069e4cc81bdd88.tar.gz |
f2py: Allow expressions that contain max/min calls, be used as dimension specifications. Defined macros min/max that are needed when --lower is used. Typical usage case: real a(min(1,n)).
Diffstat (limited to 'numpy/f2py/cfuncs.py')
-rw-r--r-- | numpy/f2py/cfuncs.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/f2py/cfuncs.py b/numpy/f2py/cfuncs.py index 8c6275ae2..a1e8ebff3 100644 --- a/numpy/f2py/cfuncs.py +++ b/numpy/f2py/cfuncs.py @@ -228,6 +228,8 @@ cppmacros['PRINTPYOBJERR']="""\ \tfprintf(stderr,\"\\n\"); """ cppmacros['MINMAX']="""\ +#define max(a,b) ((a > b) ? (a) : (b)) +#define min(a,b) ((a < b) ? (a) : (b)) #ifndef MAX #define MAX(a,b) ((a > b) ? (a) : (b)) #endif |