【问题标题】:How to deal with multiple Data Type in cython?如何处理cython中的多种数据类型?
【发布时间】:2015-05-29 21:43:03
【问题描述】:

在 cython 中处理多种数据类型有哪些不同的技术?如何使代码对多种数据类型通用,同时又能保持效率。

【问题讨论】:

  • 您需要更具体一些,证明您已经研究过 cython 文档,甚至尝试过一些事情。

标签: numpy scipy cython python-c-api


【解决方案1】:

1) 融合类型,正如您现在从上一个问题 Alternatives of fused type in cython 中知道的那样,它们都很好

2) 使用模板在 C++ 中编写代码并将其包装

3) 代码重复,可能使用自己编写的 diy 脚本

4) 使用普通的 python,它通常处理类型,它们具有相同的接口,而在它们不具有自省的地方

【讨论】:

    猜你喜欢
    • 2015-07-27
    • 1970-01-01
    • 1970-01-01
    • 2021-09-13
    • 1970-01-01
    • 2019-07-01
    • 2018-08-05
    • 1970-01-01
    • 2020-02-07
    相关资源
    最近更新 更多