Why are my sparse matrices converted to full matrices by 'lsqlin'?
1 回表示 (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2017 年 12 月 20 日
回答済み: MathWorks Support Team
2017 年 12 月 20 日
I have some large sparse matrices (300000x100000) that I am attempting to pass to 'lsqlin'.
However, I receive the following errors:
Warning: Cannot use sparse matrices with active-set algorithm: converting to full.
> In lsqlin (line 368)
In example (line 5)
Error using full
Requested 261097x81168 (157.9GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a
long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information.
Error in lsqlin (line 377)
x qpsub(full(C),d,[full(Aeq);full(A)],[beq;b],lb,ub,X0,neqcstr, ...
Here is my code:
options = optimoptions('lsqlin', 'Display', 'iter-detailed');
x = lsqlin(A,b,[],[],C,zeros(size(C,1),1),[],[],x0,options);
Here are my variables:
>> whos
Name Size Bytes Class Attributes
A 261097x81168 13254408 double sparse
C 76x81168 650568 double sparse
b 261097x1 14496 double sparse
x0 81168x1 262928 double sparse
採用された回答
MathWorks Support Team
2017 年 12 月 20 日
Better support for sparse matrices was added in R2017a for 'lsqlin'. Please upgrade to that version to avoid this issue.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Linear Least Squares についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!