我想把c++代码转换成python。
我用SWIG创建了一个python模块来访问c++类。在
现在我想把下面的c++代码传递给Python
C++ +
double thre[LEVEL] = { 1.0l, 1.0e+2, 1.0e+5 };
GradedDouble gd(LEVEL, thre);
gd.avg(thre);
我需要把上面的代码转换成python< P> C++构造函数用于生成Python模块
^{pr2}$
SWIG接口文件
/*文件:example.i*/%module example
%include typemaps.i
%apply double * INPUT { double *}
%apply double * INPUT { double *buf };
%{
#include "Item.h"
#include "GradedComplex.h"
#include "GradedDouble.h"
void avg(double *buf);
%}
%include
%include
%include "Item.h"
%include "GradedComplex.h"
%include "GradedDouble.h"
%template(Int) Item;
%template(Double) Item;
%templat