Instant

Instant is a Python module that allows for instant inlining of C and C++ code in Python.
Download

Instant Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Magne Westlie & Kent-Andre Mardal
  • Publisher web site:
  • http://pyinstant.sf.net

Instant Tags


Instant Description

Instant is a Python module that allows for instant inlining of C and C++ code in Python. Instant is a Python module that allows for instant inlining of C and C++ code in Python. Instant is a small Python module built on top of SWIG.Example of use:>>> c_code = """double sum(double a, double b){ return a+b; }""">>> import Instant >>> ext = Instant.Instant()>>> >>> # create the wrapper code, compile and link it to a shared library >>> ext.create_extension(code=c_code, module='test1_ext')>>> >>> # use the C code >>> from test1_ext import sum >>> print sum(3.7, 4.8) 8.5Example with NumPy arrays converted to C double arrays:>>> import Instant >>> import Numeric>>> import sys>>> import time>>>>>> ext = Instant.Instant()>>>>>> c_code = """/* add function for vectors with all safety checks removed ..*/ void add(int n1, double* array1, int n2, double* array2, int n3, double* array3){ for (int i=0; i>>""">>>>>> ext.create_extension(code=c_code, headers=, >>> include_dirs= + "/Numeric"],>>> init_code='import_array();', module='test3_ext', >>> arrays = ,,])>>>>>> from test3_ext import add >>> a = Numeric.arange(10000); a = Numeric.sin(a)>>> b = Numeric.arange(10000); b = Numeric.cos(b)>>> c = Numeric.arange(10000); c = Numeric.cos(c)>>>>>>add(a,b,c)What's New in This Release:· Various new examples with swiginac and sympy have been implemented.· A bug on 64-bit systems has been fixed.· The director flag is removed by default. What's New in This Release: · Much of the code has been restructured and rewritten. · Multi-level cache functionality has been improved. · instant-clean and instant-showcache scripts have been added.


Instant Related Software