摘要:
参考文档: https://www.cnblogs.com/gxcdream/p/7597865.html https://www.cnblogs.com/muyefeiwu/p/11260366.html https://blog.csdn.net/liangzhaoyang1/article/d 阅读全文
摘要:
参考文档: 参考1:https://blog.csdn.net/u013044116/article/details/49737585 参考2:https://blog.csdn.net/keneyr/article/details/83747501 算法思想: 对多边形沿y轴从0开始遍历,建立边表 阅读全文
摘要:
数据类型 # bool 类型 // bool_type_ptactice.pyx cdef bint a = 123 # 非0 为 真 , 0 为假 cdef bint b = -123 cdef bint c = 0 py_a = a # cdef 定义的内容没法直接在python中直接引用 py 阅读全文
摘要:
文档: https://docs.cython.org/en/latest/src/userguide/language_basics.html#declaring-data-types 阅读全文
摘要:
import os import threading import time from concurrent.futures import ThreadPoolExecutor from functools import wraps ThreadPool = ThreadPoolExecutor(m 阅读全文
摘要:
参考文档:https://numba.pydata.org/numba-doc/latest/user/pycc.html Compiling code ahead of time(运行之前编译代码) 虽然 numnb 主要是 Just-In-Time(运行时)编译,但也提供了 Ahead-Of-T 阅读全文
摘要:
参考文档: https://numba.pydata.org/numba-doc/latest/user/cfunc.html cfunc 创建 C/C++回调函数 与 jit 相似,有一个不同点是,cfunc 强制传递一个签名,用来确定 C 回调的可见签名。 cfunc 对象暴漏出编译后的 C 回 阅读全文
摘要:
参考文档:https://numba.pydata.org/numba-doc/latest/user/jitclass.html# jitclass 对类进行装饰 import numba as nb import numpy as np from numba.experimental impor 阅读全文
摘要:
参考文档: https://apachecn.github.io/numba-doc-zh/#/docs/17 vectorize装饰器: 允许python函数的标量入参使用 numpy 的 ufuncs。 import numba as nb @nb.vectorize([nb.int32(nb. 阅读全文
摘要:
点击查看代码 # 读取嵌套型和大小可变的二进制结构 from itertools import chain import struct # 多边形数组 polys = [ [(1.0, 2.1), (2.0, 3.2), (3.0, 4.3)], [(1.1, 2.2), (2.1, 3.3), ( 阅读全文