~corrado-maurini/dolfin/tao

« back to all changes in this revision

Viewing changes to site-packages/dolfin/compilemodules/compilemodule.py

  • Committer: corrado maurini
  • Date: 2012-12-18 12:16:08 UTC
  • mfrom: (6685.78.207 trunk)
  • Revision ID: corrado.maurini@upmc.fr-20121218121608-nk82ly9jgsld9u84
updating with trunk, fix uint in TAO solver and hacking the check for tao FindTAO.cmake

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
_interface_version = 0
50
50
 
51
51
# A list of supported math builtins
52
 
_math_builtins = [
53
 
    # cmath functions:
 
52
_cpp_math_builtins = [
 
53
    # <cmath> functions: from http://www.cplusplus.com/reference/cmath/
54
54
    "cos", "sin", "tan", "acos", "asin", "atan", "atan2",
55
 
    "cosh", "sinh", "tanh",
56
 
    "exp", "frexp", "ldexp", "log", "log10", "modf",
 
55
    "cosh", "sinh", "tanh", "exp", "frexp", "ldexp", "log", "log10", "modf",
57
56
    "pow", "sqrt", "ceil", "fabs", "floor", "fmod",
58
57
    "max", "min"]
59
58
 
 
59
_math_builtins = [
 
60
    # math.h functions: http://en.wikibooks.org/wiki/C_Programming/C_Reference/math.h
 
61
    "acos", "asin", "atan", "atan2", "ceil", "cos", "cosh", "exp",
 
62
    "fabs", "floor", "fmod", "frexp", "ldexp", "log", "log10", "modf",
 
63
    "pow", "sin", "sinh", "sqrt", "tan", "tanh", "acosh", "asinh", "atanh",
 
64
    "cbrt", "copysign", "erf", "erfc", "exp2", "expm1", "fdim", "fma", "fmax",
 
65
    "fmin", "hypot", "ilogb", "lgamma", "llrint", "lrint", "llround", "lround",
 
66
    "log1p", "log2", "logb", "nan", "nearbyint", "nextafter", "nexttoward",
 
67
    "remainder", "remquo", "rint", "round", "scalbln", "scalbn", "tgamma", "trunc"]
 
68
 
60
69
_math_dolfin = [
61
70
    # functions from dolfin::math:
62
71
    "sqr", "ipow", "rand", "near", "DOLFIN_EPS", "DOLFIN_PI", "pi"]
63
72
 
 
73
_all_math = list(set(_math_builtins).difference(_cpp_math_builtins)) + \
 
74
            _math_dolfin + _cpp_math_builtins
 
75
 
64
76
math_header = """
65
77
// cmath functions
66
78
%s
67
79
 
68
80
const double pi = DOLFIN_PI;
69
 
""" % "\n".join("using std::%s;" % mf for mf in _math_builtins)
 
81
""" % "\n".join("using std::%s;" % mf for mf in _cpp_math_builtins)
70
82
 
71
83
 
72
84
_cpp_keywords = ["auto","const","double","float","int","short","struct","unsigned",
159
171
    variables.difference_update(arguments)
160
172
 
161
173
    # Remove the builtin math functions from the variables
162
 
    variables.difference_update(_math_builtins+_math_dolfin)
 
174
    variables.difference_update(_all_math)
163
175
 
164
176
    # Remove the numerals from the variables
165
177
    numerals = [v for v in variables if v[0] in "0123456789"]