Commit 1095049c authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

Swig typemap: compiles, but does not work

parent b2ffa0f6
......@@ -83,6 +83,8 @@ __BEGIN_DECLS
#define EXPORT
#endif
EXPORT _cerf_cmplx ctest(double x);
EXPORT double testc(_cerf_cmplx z);
// compute w(z) = exp(-z^2) erfc(-iz), Faddeeva's scaled complex error function
EXPORT _cerf_cmplx w_of_z(_cerf_cmplx z);
......
%module "libcerf"
/* Convert from Python --> C */
%typemap(in) _cerf_cmplx {
$1 = ((Py_complex*)$input)->real + _Complex_I * ((Py_complex*)$input)->imag;
}
/* Convert from C --> Python */
%typemap(out) int {
$result = Py_complex(creal($1), cimag($1));
}
%{
#include "lib/cerf.h"
%}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment