LSQLIN Implementation with Sparse Matrices
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am considering updating to R2014b and just have a quick question about the implementation of the LSQLIN function. Are sparse matrices supported for all algorithms and solution constraint types (inequality, equality, bound) with this function in 2014b? This was not the case in 2012b. I could not readily find the answer to this in the LSQLIN documentation or the "Choosing the Algorithm" document. Thanks for any information anyone can provide.
0 commentaires
Réponse acceptée
Matt J
le 25 Fév 2015
No, not for all algorithms. The following test in R2014b confirms this.
>> C=speye(3); d=sparse([3;2;1]); A=C; b=d; lsqlin(C,d,A,b)
Warning: The trust-region-reflective algorithm can handle bound constraints only;
using active-set algorithm instead.
> In lsqlin at 304
Warning: Cannot use sparse matrices with active-set algorithm: converting to full.
> In lsqlin at 353
Optimization terminated.
ans =
3
2
1
The strange thing, however, is that in R2013b, the active-set algorithm handles sparse input just fine, or at least it does not return a warning as above,
>> C=speye(3); d=sparse([3;2;1]); A=C; b=d; lsqlin(C,d,A,b,[],[],[],[],[],optimoptions(@lsqlin,'Algorithm','active-set'))
Optimization terminated.
ans =
3
2
1
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Linear Least Squares dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!