开发者社区> 问答> 正文

将python类转换成c++的最佳方法是什么?

如何将这段python代码转换成c++ 蟒蛇:

class SomeThing(ofSome):
def __init__(self, name, some, some_para, b=np.zeros(2), A=1):
    self.A = A
    if some_para:
        someA = None
        someB = None
    else:
        if (some stuff)
            (some stuff)
        someA = lambda y: np.array(norm(y - b) / A - 1).reshape(-1, 1)

问题来源StackOverflow 地址:/questions/59379588/what-is-the-best-way-to-convert-from-python-class-to-c

展开
收起
kun坤 2019-12-29 21:56:32 996 0
1 条回答
写回答
取消 提交回答
  • class Something{
    public:
        Something(std::string name, std::string some, CustomClass* some_para, std::vector<int> b, int A){
            _A = A;
            if(some_para != nullptr){
                ....
            }else if(...){
                 ...
            }
        }
        
    private:
        int _A;
        int _someA;
        int _someB;
        
    };
    
    2020-03-05 19:06:58
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
From Python Scikit-Learn to Sc 立即下载
Data Pre-Processing in Python: 立即下载
双剑合璧-Python和大数据计算平台的结合 立即下载