* Bug #12119 fixed - bar and barh had wrong x/y bounds.
+* Bug #12120 fixed - eigs was broken for complex sparse matrices.
+
* Bug #12140 fixed - csvRead fails when comma is used as decimal mark.
* Bug #12166 fixed - There was a bad label with drawaxis.
AMSB = A - sigma * %_B;
end
end
- if(~isreal(AMSB))
- Lup = umf_lufact(AMSB);
- [L, U, p, q, R] = umf_luget(Lup);
- R = diag(R);
- P = zeros(nA, nA);
- Q = zeros(nA, nA);
- for i = 1:nA
- P(i,p(i)) = 1;
- Q(q(i),i) = 1;
- end
- umf_ludel(Lup);
- else
- [hand, rk] = lufact(AMSB);
- [P, L, U, Q] = luget(hand);
- ludel(hand);
- end
+ Lup = umf_lufact(AMSB);
end
if(Areal)
if(ido == 2)
workd(ipntr(2):ipntr(2)+nA-1) = workd(ipntr(1):ipntr(1)+nA-1);
else
- if(Areal & Breal)
- workd(ipntr(2):ipntr(2)+nA-1) = inv(Q) * inv(U) * inv(L) * inv(P) *workd(ipntr(1):ipntr(1)+nA-1);
- else
- if(~isreal(L) | ~isreal(U))
- error(msprintf(gettext("%s: Impossible to invert complex sparse matrix.\n"), "eigs"));
- else
- workd(ipntr(2):ipntr(2)+nA-1) = Q * inv(U) * inv(L) * P * inv(R) * workd(ipntr(1):ipntr(1)+nA-1);
- end
- end
+ workd(ipntr(2):ipntr(2)+nA-1) = umf_lusolve(Lup, workd(ipntr(1):ipntr(1)+nA-1));
end
else
if(ido == 2)
else
workd(ipntr(2):ipntr(2)+nA-1) = %_B * workd(ipntr(1):ipntr(1)+nA-1);
end
- if(Areal & Breal)
- workd(ipntr(2):ipntr(2)+nA-1) = inv(Q) * inv(U) * inv(L) * inv(P) *workd(ipntr(2):ipntr(2)+nA-1);
- else
- if(~isreal(L) | ~isreal(U))
- error(msprintf(gettext("%s: Impossible to invert complex sparse matrix.\n"), "eigs"));
- else
- workd(ipntr(2):ipntr(2)+nA-1) = Q * inv(U) * inv(L) * P * inv(R) * workd(ipntr(2):ipntr(2)+nA-1);
- end
- end
+ workd(ipntr(2):ipntr(2)+nA-1) = umf_lusolve(Lup, workd(ipntr(2):ipntr(2)+nA-1));
else
- if(Areal & Breal)
- workd(ipntr(2):ipntr(2)+nA-1) = inv(Q) * inv(U) * inv(L) * inv(P) * workd(ipntr(3):ipntr(3)+nA-1);
- else
- if(~isreal(L) | ~isreal(U))
- error(msprintf(gettext("%s: Impossible to invert complex sparse matrix.\n"), "eigs"));
- else
- workd(ipntr(2):ipntr(2)+nA-1) = Q * inv(U) * inv(L) * P * inv(R) * workd(ipntr(3):ipntr(3)+nA-1);
- end
- end
+ workd(ipntr(2):ipntr(2)+nA-1) = umf_lusolve(Lup, workd(ipntr(3):ipntr(3)+nA-1));
end
end
else
end
end
end
+ if(iparam(7)==3)
+ umf_ludel(Lup);
+ end
if(Areal & Breal)
if(Asym)
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - Scilab Enterprises - Sylvestre Ledru
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- Non-regression test for bug 12120 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=12120
+//
+// <-- Short Description -->
+// eigs is broken for complex sparse matrices
+// =============================================================================
+A = %i * speye(10,10);
+a=eigs(A, [], 3, 'SM');
+assert_checkequal(size(a),[3, 1]);
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - Scilab Enterprises - Sylvestre Ledru
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 12120 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=12120
+//
+// <-- Short Description -->
+// eigs is broken for complex sparse matrices
+// =============================================================================
+
+A = %i * speye(10,10);
+a=eigs(A, [], 3, 'SM');
+assert_checkequal(size(a),[3, 1]);
+