* Bug #12758 fixed - Focus issue with plot3d() fixed.
* Bug #12747 fixed - legendre() now accepts the -1 and 1 values for the third argument.
+
+* Bug #12772 fixed - eigs() failed when trying to solve a sparse matrix eigen value problem.
if(iparam(7) == 3)
umf_ludel(Lup);
end
-
if(Areal & Breal)
if(Asym)
[d, z, resid, v, iparam, iptnr, workd, workl, info_eupd] = dseupd(rvec, howmny, _select, d, z, sigma, bmat, nA, which, nev, tol, resid, ncv, v, iparam, ipntr, workd, workl, info_eupd);
index = find(di~=0);
index = index(1:2:$);
res_v = z;
- res_v(:,[index index+1]) = [complex(res_v(:,index),res_v(:,index+1)), complex(res_v(:,index),-res_v(:,index+1))];
+ if ~isempty(index) then
+ res_v(:,[index index+1]) = [complex(res_v(:,index),res_v(:,index+1)), complex(res_v(:,index),-res_v(:,index+1))];
+ end
res_d = diag(res_d);
res_v = res_v(:,1:nev);
end
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Adeline CARNIS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- Non-regression test for bug 12772 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=12772
+//
+// <-- Short Description -->
+// eigs() failed when trying to solve a sparse matrix eigen value problem.
+// =============================================================================
+C1 = -51*eye(10,10);
+C1(1:$-1, 2:$) = C1(1:$-1,2:$) + diag(100*ones(9,1));
+C1(2:$,1:$-1) = C1(2:$,1:$-1) + diag(100*ones(9,1));
+C1(10,9) = 116;
+C1(10,10) = -147;
+C1 = sparse(C1);
+[d, v] = eigs(C1,sparse(eye(10,10)), 1, 480);
+assert_checkalmostequal(C1*v, v*d, sqrt(%eps), 1.e-10);
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Adeline CARNIS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 12772 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=12772
+//
+// <-- Short Description -->
+// eigs() failed when trying to solve a sparse matrix eigen value problem.
+// =============================================================================
+
+C1 = -51*eye(10,10);
+C1(1:$-1, 2:$) = C1(1:$-1,2:$) + diag(100*ones(9,1));
+C1(2:$,1:$-1) = C1(2:$,1:$-1) + diag(100*ones(9,1));
+C1(10,9) = 116;
+C1(10,10) = -147;
+C1 = sparse(C1);
+
+[d, v] = eigs(C1,sparse(eye(10,10)), 1, 480);
+assert_checkalmostequal(C1*v, v*d, sqrt(%eps), 1.e-10);