pointers - 是否可以在 cython 中声明一个指向具有特定大小的浮点的指针向量?
问题描述
基本上我有一个向量定义如下:
cdef vector[float*] x_sets
我现在决定我想用一个特定的大小来做,这样我就可以将每个集合的向量分配给 x_sets 中的一个指针。当我尝试以下操作时:
cdef vector[float*] x_sets = new vector[float*](num_sets)
我得到一个错误cannot assign type vector[float*] to vector[float*]
。
编辑:为了获得更多背景知识,我基本上是在尝试将多个数据集传递给一些 c++ 代码,并且在 c++ 代码中,它们存储在一个浮点**中,对于 x 集和 ys_list 分别称为 xs_list 和 y_sets。
解决方案
推荐阅读
- python - 根据列值列表删除多行
- excel - 计算公式时如何使用excel VBA将公式复制到相邻单元格(使用相对引用)?
- java - 连接丢失后,Hibernate 自动与 sql-server 重新连接
- php - 如何在 127.0.0.1/ 上访问不带扩展名的 .html 或 .php 文件
- r - 如何在 pca biplot 中显示观察结果?
- ios - 编译器不支持此 SDK。请选择与 SDK 匹配的工具链
- android - 捏放大/缩小和移动/拖动ImageView离开屏幕android
- java - 如何以编程方式重命名 .Java 文件中的字段、参数、类名和方法名?
- angular - 是否可以显示选择初始值的角度材料的多选组件?
- javascript - 如何过滤获取的 JSON 数据?