使用 F# 的 4 维以上数组 - 无法初始化对象
我使用 HDF5DotNet(参见 http://hdf5.net/)。有一个类 H5Array
,它有很多这种类型的构造函数:
new 'Type []
new 'Type [,]
new 'Type [,,]
new 'Type [,,]
new 'Type [,,,]
new 'Type [,,,,]
new 'Type [,,,,,]
...
我写
let data = Array2D.create 256 512 4.
let test = H5Array data
即使对于 2D 数组,我也会收到一条错误消息:
内部错误:F# 支持最大 .NET 数组维度为 4
我的两个问题是:
- 如何使其适用于 2D 数据?
- 如何让它适用于4维以上的数据?
I play with HDF5DotNet (see http://hdf5.net/). There is a class H5Array
which has a lot of constructors of this kind:
new 'Type []
new 'Type [,]
new 'Type [,,]
new 'Type [,,]
new 'Type [,,,]
new 'Type [,,,,]
new 'Type [,,,,,]
...
I write
let data = Array2D.create 256 512 4.
let test = H5Array data
Even for a 2D array I get an error saying:
internal error: F# supports a maxiumum .NET array dimension of 4
My two questions are:
- How to make it work for the 2D data?
- How to make it work for more than 4 dimensional data?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,对于问题#2,我希望您使用 Array.Create
http:// /msdn.microsoft.com/en-us/library/dfs8044k.aspx
制作具有大秩的数组。但我想知道#1 是否是编译器错误?
Hm, for question #2, I expect you'd use Array.Create
http://msdn.microsoft.com/en-us/library/dfs8044k.aspx
to make arrays with large rank. But I wonder if #1 is a compiler bug?