Created
December 13, 2011 22:02
-
-
Save PhDP/1474101 to your computer and use it in GitHub Desktop.
Weave example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example with weave | |
# | |
# Required packages (linux): python-scipy, python-dev | |
# | |
# phdp@thinkpad:~$ python testweave.py | |
# 9784957257.9 | |
import numpy as np | |
from scipy.weave import inline | |
a, b, c = 5.5, 8.5, 10.5 | |
code = """ return_val = log(a) * pow(b, c) - sqrt(a + b); """ | |
res = inline(code, ['a', 'b', 'c'], headers = ['<math.h>'], compiler = 'gcc') | |
print(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
;-)