Home | Trees | Indices | Help |
|
---|
|
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
This is a short wrapper around the build_module function in instant. It creates a module given that the input is a valid C function. It is only possible to inline one C function each time. Usage:>>> from instant import inline >>> add_func = inline("double add(double a, double b){ return a+b; }") >>> print "The sum of 3 and 4.5 is ", add_func(3, 4.5) |
This is a short wrapper around the build_module function in instant. It creates a module given that the input is a valid C function. It is only possible to inline one C function each time. Usage:>>> from instant import inline >>> add_func = inline("double add(double a, double b){ return a+b; }") >>> print "The sum of 3 and 4.5 is ", add_func(3, 4.5) |
This is a short wrapper around the build_module function in instant. It creates a module given that the input is a valid C function. It is only possible to inline one C function each time. The difference between this function and the inline function is that C-arrays can be used. The following example illustrates that. Usage:>>> import numpy >>> import time >>> from instant import inline_with_numpy >>> c_code = """ double sum (int n1, double* array1){ double tmp = 0.0; for (int i=0; i<n1; i++) { tmp += array1[i]; } return tmp; } """ >>> sum_func = inline_with_numpy(c_code, arrays = [['n1', 'array1']]) >>> a = numpy.arange(10000000); a = numpy.sin(a) >>> sum_func(a) |
This is a short wrapper around the build_module function in instant. It creates a module given that the input is a valid C function. It is only possible to inline one C function each time. The difference between this function and the inline function is that C-arrays can be used. The following example illustrates that. Usage:>>> import numpy >>> import time >>> from instant import inline_with_numpy >>> c_code = """ double sum (int n1, double* array1){ double tmp = 0.0; for (int i=0; i<n1; i++) { tmp += array1[i]; } return tmp; } """ >>> sum_func = inline_with_numpy(c_code, arrays = [['n1', 'array1']]) >>> a = numpy.arange(10000000); a = numpy.sin(a) >>> sum_func(a) |
This is a short wrapper around the build_module function in instant. It creates a module given that the input is a valid C function. It is only possible to inline one C function each time. The difference between this function and the inline function is that C-arrays can be used. The following example illustrates that. Usage:>>> import numpy >>> import time >>> from instant import inline_with_numeric >>> c_code = """ double sum (int n1, double* array1){ double tmp = 0.0; for (int i=0; i<n1; i++) { tmp += array1[i]; } return tmp; } """ >>> sum_func = inline_with_numeric(c_code, arrays = [['n1', 'array1']]) >>> a = numpy.arange(10000000); a = numpy.sin(a) >>> sum_func(a) |
This is a short wrapper around the build_module function in instant. It creates a module given that the input is a valid C function. It is only possible to inline one C function each time. The difference between this function and the inline function is that C-arrays can be used. The following example illustrates that. Usage:>>> import numpy >>> import time >>> from instant import inline_with_numeric >>> c_code = """ double sum (int n1, double* array1){ double tmp = 0.0; for (int i=0; i<n1; i++) { tmp += array1[i]; } return tmp; } """ >>> sum_func = inline_with_numeric(c_code, arrays = [['n1', 'array1']]) >>> a = numpy.arange(10000000); a = numpy.sin(a) >>> sum_func(a) |
This is a short wrapper around the build_module function in instant. It creates a module given that the input is a valid C function. It is only possible to inline one C function each time. The difference between this function and the inline function is that C-arrays can be used. The following example illustrates that. Usage:>>> import numarray >>> import time >>> from instant import inline_with_numarray >>> c_code = """ double sum (int n1, double* array1){ double tmp = 0.0; for (int i=0; i<n1; i++) { tmp += array1[i]; } return tmp; } """ >>> sum_func = inline_with_numarray(c_code, arrays = [['n1', 'array1']]) >>> a = numarray.arange(10000000); a = numarray.sin(a) >>> sum_func(a) |
This is a short wrapper around the build_module function in instant. It creates a module given that the input is a valid C function. It is only possible to inline one C function each time. The difference between this function and the inline function is that C-arrays can be used. The following example illustrates that. Usage:>>> import numarray >>> import time >>> from instant import inline_with_numarray >>> c_code = """ double sum (int n1, double* array1){ double tmp = 0.0; for (int i=0; i<n1; i++) { tmp += array1[i]; } return tmp; } """ >>> sum_func = inline_with_numarray(c_code, arrays = [['n1', 'array1']]) >>> a = numarray.arange(10000000); a = numarray.sin(a) >>> sum_func(a) |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Mon Dec 29 15:21:55 2008 | http://epydoc.sourceforge.net |