"太多的指标"在研发大矩阵向量长度的问题太多、向量、矩阵、长度

2023-09-08 10:37:51 作者:有一个名字卡在咽喉

您好,在此先感谢。我使用Rx64 3.1.2版本在Windows服务器上,并有从包生成的文件支持的大矩阵 bigmemory 我试图在一个线性规划使用问题。基质是7062行×364520列共计2574240240条目(整数)。

当我运行线为线性规划,我得到以下错误:

 在GetElements.bm(X,I,J)错误:
  太多的指标(大于2 ^ 31-1)进行提取。
 

这号码,2147483647,从我读的是最大条目数R允许甚至在64位进程的任何对象。在这里我读过 的,我可以用实验版 R与解决这个问题,但我希望能有一个最近可用的解决方案。我已经支持下面的输出,以确认我 - [R版本:

 >版
               _
平台的x86_64-W64-的mingw32
拱x86_64的
OS的mingw32
系统x86_64的,的mingw32
状态
大3
未成年人1.2
2014年
本月10
第31天
SVN转速66913
咒骂r
version.string  -  [R 3.1.2版本(2014年10月31日)
昵称南瓜头盔

> Sys.getenv(R_ARCH)
[1]/ 64
 
一个矩阵乘以一个向量,得到的向量和原来的有什么关系 有什么意义

解决方案

这将是最好的,如果你也可以提供线为线性规划',但我的评论太长把上面。

@詹姆斯是正确的32位是目前硬codeD中 bigmemory 。扫了一眼在源之后 github上我看到作者没有删除约束,你可以下载最新版本

 库(devtools)
install_github(kaneplusplus / bigmemory)
 

如果没有这个限制,我相信你仍然有问题。如果我假设正确,您还使用补充包 bigalgebra 。有一种方法可以使用​​64位与 bigalgebra 由reintstalling下载的焦油球以及与安装:

  REFBLAS = 1 R CMD INSTALL bigalgebra_0.8.4.tar.gz
 

注意 - 可用于64位的功能是非常有限的当前,将是比因非64位版本的慢当前变通方法

我一直在与原作者联系,我在更新包使用的过程中 RcppArmadillo 这将提供一个简洁的界面和处理64有点问题。这是目前正在进行的在我的包放在我的 GitHub的帐户叉。

Hello and thanks in advance. I'm using Rx64 version 3.1.2 on a Windows Server and have a file-backed big matrix generated from the package bigmemory that I'm trying to use in a linear programming problem. The matrix is 7062 rows by 364520 columns for a total of 2574240240 entries (of integers).

When I run the line for the linear program, I get the following error:

Error in GetElements.bm(x, i, j) : 
  Too many indices (>2^31-1) for extraction.

That number, 2147483647, from what I read is the maximum number of entries R allows for any object even on 64-bit processes. I've read here that I can use the 'experimental version' of R to get around this but I was hoping there's a recently available solution. I have supporting output below to confirm my R version:

> version
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          3                           
minor          1.2                         
year           2014                        
month          10                          
day            31                          
svn rev        66913                       
language       R                           
version.string R version 3.1.2 (2014-10-31)
nickname       Pumpkin Helmet 

> Sys.getenv("R_ARCH")
[1] "/x64"

解决方案

It would be best if you could also provide the 'line for the linear program' but my comment is too long to put above.

@James is correct that 32-bit is hard-coded in to bigmemory at the moment. After glancing at the source on github I see the author did remove the constraint and you can download that newest version with:

library(devtools)
install_github("kaneplusplus/bigmemory")

Without that limitation I believe you will still have a problem. If I assume correctly, you are also using the complementary package bigalgebra. There is a way to use 64-bit with bigalgebra by reintstalling the downloaded tar ball and installing with:

REFBLAS=1 R CMD INSTALL bigalgebra_0.8.4.tar.gz

NOTE - the functions available for 64-bit are very limited currently and will be slower than the non-64-bit versions because of the currently workarounds.

I have been in contact with the original author and I am in the process of updating the packages to utilize RcppArmadillo which will provide a cleaner interface and deal with the 64-bit problem. This is currently in progress at my fork of the package on my github account.