Skip to content

Commit

Permalink
ENH: Detect all functions in complex.h
Browse files Browse the repository at this point in the history
Set the HAVE_XXXX macros for all of the following functions.

    csin,   ccos,   ctan
    casin,  cacos,  catan
    csinh,  ccosh,  ctanh
    casinh, cacosh, catanh
    cexp,   clog,   cpow
    cabs,   csqrt,  carg
    cimag,  creal,  conj,
    cproj

The macros do not need to be used, but it is good to have all of
them available.
  • Loading branch information
charris committed Jan 28, 2015
1 parent 0a7fe2e commit de681b7
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions numpy/core/setup_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,23 +138,29 @@ def check_api_version(apiversion, codegen_dir):
OPTIONAL_VARIABLE_ATTRIBUTES = ["__thread", "__declspec(thread)"]

# Subset of OPTIONAL_STDFUNCS which may alreay have HAVE_* defined by Python.h
OPTIONAL_STDFUNCS_MAYBE = ["expm1", "log1p", "acosh", "atanh", "asinh", "hypot",
"copysign", "ftello", "fseeko"]
OPTIONAL_STDFUNCS_MAYBE = [
"expm1", "log1p", "acosh", "atanh", "asinh", "hypot", "copysign",
"ftello", "fseeko"
]

# C99 functions: float and long double versions
C99_FUNCS = ["sin", "cos", "tan", "sinh", "cosh", "tanh", "fabs", "floor",
"ceil", "rint", "trunc", "sqrt", "log10", "log", "log1p", "exp",
"expm1", "asin", "acos", "atan", "asinh", "acosh", "atanh",
"hypot", "atan2", "pow", "fmod", "modf", 'frexp', 'ldexp',
"exp2", "log2", "copysign", "nextafter", "cbrt"]

C99_FUNCS = [
"sin", "cos", "tan", "sinh", "cosh", "tanh", "fabs", "floor", "ceil",
"rint", "trunc", "sqrt", "log10", "log", "log1p", "exp", "expm1",
"asin", "acos", "atan", "asinh", "acosh", "atanh", "hypot", "atan2",
"pow", "fmod", "modf", 'frexp', 'ldexp', "exp2", "log2", "copysign",
"nextafter", "cbrt"
]
C99_FUNCS_SINGLE = [f + 'f' for f in C99_FUNCS]
C99_FUNCS_EXTENDED = [f + 'l' for f in C99_FUNCS]

C99_COMPLEX_TYPES = ['complex double', 'complex float', 'complex long double']

C99_COMPLEX_FUNCS = ['creal', 'cimag', 'cabs', 'carg', 'cexp', 'csqrt', 'clog',
'ccos', 'csin', 'cpow']
C99_COMPLEX_TYPES = [
'complex double', 'complex float', 'complex long double'
]
C99_COMPLEX_FUNCS = [
"cabs", "cacos", "cacosh", "carg", "casin", "casinh", "catan",
"catanh", "ccos", "ccosh", "cexp", "cimag", "clog", "conj", "cpow",
"cproj", "creal", "csin", "csinh", "csqrt", "ctan", "ctanh"
]

def fname2def(name):
return "HAVE_%s" % name.upper()
Expand Down

0 comments on commit de681b7

Please sign in to comment.