j********3 发帖数: 560 | 1 我原来用sparse来生成大矩阵,做奇异值分解的时候要用svds命令,但是svds本身调用
了zeros函数,这时程序提示
"Product of dimensions is greater than maximum integer."
或者有时候就是"out of memory"。请问碰到这种情况应该怎么办呢?
我最初的目的是要求解线性方程组,但是所要求解的线性方程组的系数矩阵接近奇异,
在版上求教之后得各位大虾指点,使用pinv函数得到了较好的结果。但是之后当所要处
理的系数矩阵增大(至大约2000×2000)时,程序提示"out of memory"。后使用
sparse命令代替zeros命令生成矩阵,但是却无法使用pinv,因为pinv本身调用的是svd
函数做奇异值分解,而对于sparse方式存储的矩阵,要使用svds命令。于是我就自己写
code用svds命令做奇异值分解,但是发现svds本身也用到了zeros来生成零矩阵,这样
,我就没有办法再进行下去了,因为我总不能将我要用的matlab自带函数都重新写一遍
。再次来版上求助,多谢各位大虾了。 |
a****e 发帖数: 16 | 2 如果是out of memory的话你可以试试在boot.ini中加上 /3GB (我是winXP)这样
matlab就可以使用更大得虚拟内存,我曾经svd大矩阵时用过,很有效。
但不是所有版本的windows都可以用这个 /3GB开关,你可以试试。
svd
【在 j********3 的大作中提到】 : 我原来用sparse来生成大矩阵,做奇异值分解的时候要用svds命令,但是svds本身调用 : 了zeros函数,这时程序提示 : "Product of dimensions is greater than maximum integer." : 或者有时候就是"out of memory"。请问碰到这种情况应该怎么办呢? : 我最初的目的是要求解线性方程组,但是所要求解的线性方程组的系数矩阵接近奇异, : 在版上求教之后得各位大虾指点,使用pinv函数得到了较好的结果。但是之后当所要处 : 理的系数矩阵增大(至大约2000×2000)时,程序提示"out of memory"。后使用 : sparse命令代替zeros命令生成矩阵,但是却无法使用pinv,因为pinv本身调用的是svd : 函数做奇异值分解,而对于sparse方式存储的矩阵,要使用svds命令。于是我就自己写 : code用svds命令做奇异值分解,但是发现svds本身也用到了zeros来生成零矩阵,这样
|
s***t 发帖数: 195 | 3 how much ram do you have?
svd
【在 j********3 的大作中提到】 : 我原来用sparse来生成大矩阵,做奇异值分解的时候要用svds命令,但是svds本身调用 : 了zeros函数,这时程序提示 : "Product of dimensions is greater than maximum integer." : 或者有时候就是"out of memory"。请问碰到这种情况应该怎么办呢? : 我最初的目的是要求解线性方程组,但是所要求解的线性方程组的系数矩阵接近奇异, : 在版上求教之后得各位大虾指点,使用pinv函数得到了较好的结果。但是之后当所要处 : 理的系数矩阵增大(至大约2000×2000)时,程序提示"out of memory"。后使用 : sparse命令代替zeros命令生成矩阵,但是却无法使用pinv,因为pinv本身调用的是svd : 函数做奇异值分解,而对于sparse方式存储的矩阵,要使用svds命令。于是我就自己写 : code用svds命令做奇异值分解,但是发现svds本身也用到了zeros来生成零矩阵,这样
|
j********3 发帖数: 560 | 4 1 GB. I don't know whether it is large enough.
What if I need to deal with a matrix of 400,000*400,000.
Thank you.
【在 s***t 的大作中提到】 : how much ram do you have? : : svd
|
j********3 发帖数: 560 | 5 回头试试,多谢你了。
【在 a****e 的大作中提到】 : 如果是out of memory的话你可以试试在boot.ini中加上 /3GB (我是winXP)这样 : matlab就可以使用更大得虚拟内存,我曾经svd大矩阵时用过,很有效。 : 但不是所有版本的windows都可以用这个 /3GB开关,你可以试试。 : : svd
|
s***t 发帖数: 195 | 6 it's kind of strange to me that with 1GB ram, you can't handle
pinv of a 2000x2000. i just tried my laptop. 0.98G ram, no problem
pinv a 2000x2000.
【在 j********3 的大作中提到】 : 1 GB. I don't know whether it is large enough. : What if I need to deal with a matrix of 400,000*400,000. : Thank you.
|
l*****a 发帖数: 119 | 7 try some sparse sovler instead of matlab, like HSL, SparLAPACK |
j********3 发帖数: 560 | 8 Thank you for the reply. Actually it's not really 2000*2000, it's 4000*4000.
【在 s***t 的大作中提到】 : it's kind of strange to me that with 1GB ram, you can't handle : pinv of a 2000x2000. i just tried my laptop. 0.98G ram, no problem : pinv a 2000x2000.
|
j********3 发帖数: 560 | 9 Thank you for the reply. But what are HSL and SparLAPACK? I googled them,
but google can not find any webpage related to SparLAPACK, and the pages it
found about HSL are definitely not the one you mentioned, which are related
to some color space staffes.
【在 l*****a 的大作中提到】 : try some sparse sovler instead of matlab, like HSL, SparLAPACK
|
l******n 发帖数: 9344 | 10 packages used to do computation
it
related
【在 j********3 的大作中提到】 : Thank you for the reply. But what are HSL and SparLAPACK? I googled them, : but google can not find any webpage related to SparLAPACK, and the pages it : found about HSL are definitely not the one you mentioned, which are related : to some color space staffes.
|
s*****o 发帖数: 26 | 11 I meet the same problem when I run lhsdesign(20000, 12) command for latin
hypercube sampling. I run it with Matlab 2006a in Linux. The computer has 8G
RAM, but I still got "out of memory" problem. I switched to another windows
XP PC, which has 3G RAM, when I run lhsdesign(10000, 12), the error message
"out of memory" appeared too. I monitored the memory usage, when the
program used 1.5 G RAM, the error message comed out.
Does Matlab have a limitation for the maximum usage of memory?
svd
【在 j********3 的大作中提到】 : 我原来用sparse来生成大矩阵,做奇异值分解的时候要用svds命令,但是svds本身调用 : 了zeros函数,这时程序提示 : "Product of dimensions is greater than maximum integer." : 或者有时候就是"out of memory"。请问碰到这种情况应该怎么办呢? : 我最初的目的是要求解线性方程组,但是所要求解的线性方程组的系数矩阵接近奇异, : 在版上求教之后得各位大虾指点,使用pinv函数得到了较好的结果。但是之后当所要处 : 理的系数矩阵增大(至大约2000×2000)时,程序提示"out of memory"。后使用 : sparse命令代替zeros命令生成矩阵,但是却无法使用pinv,因为pinv本身调用的是svd : 函数做奇异值分解,而对于sparse方式存储的矩阵,要使用svds命令。于是我就自己写 : code用svds命令做奇异值分解,但是发现svds本身也用到了zeros来生成零矩阵,这样
|
j**u 发帖数: 6059 | 12
8G
windows
message
这是个老问题了,请看下面的解释。
http://www.mathworks.com/support/tech-notes/1100/1106.html
【在 s*****o 的大作中提到】 : I meet the same problem when I run lhsdesign(20000, 12) command for latin : hypercube sampling. I run it with Matlab 2006a in Linux. The computer has 8G : RAM, but I still got "out of memory" problem. I switched to another windows : XP PC, which has 3G RAM, when I run lhsdesign(10000, 12), the error message : "out of memory" appeared too. I monitored the memory usage, when the : program used 1.5 G RAM, the error message comed out. : Does Matlab have a limitation for the maximum usage of memory? : : svd
|