The taucs_chfact can make Scilab unstable.
Reported by Michael BAUDIN
Originally assigned to Charlotte HECQUET
-- Bug description --
The taucs_chfact can make Scilab unstable.
The following test case is adapted from :
// “A Comparative Evaluation Of Matlab, Octave, Freemat,
// And Scilab For Research And Teaching”
// 2010
// Neeraj Sharma and Matthias K. Gobbert
I guess that the algorithm would need more memory and that this error case is not managed correctly in the gateway.
-- Scilab error message --
-->hchol = taucs_chfact(A);
Warning !!!
Scilab has found a critical error (EXCEPTION_ACCESS_VIOLATION)
with "taucs_chfact" function.
Save your data and restart Scilab.
-- How to reproduce the bug --
stacksize("max");
N=512
h = 1/(N+1);
x = h:h:1-h;
y = x;
[X,Y] = ndgrid(x,y);
F = (-2*(%pi^2))*(cos((2*%pi)*X) .*(sin(%pi*Y) .^2) + (sin(%pi*X) .^2).*cos((2*%pi)*Y));
b = (h^2)*F(:);
s = [-1*ones(1,N-1) 2*ones(1,N) -1*ones(1,N-1)]';
i = [2:N 1:N 1:N-1]';
j = [1:N-1 1:N 2:N ]';
ij = [i j];
T = sparse(ij,s);
I = speye(N,N);
A = I .*. T + T .*. I;
hchol = taucs_chfact(A);
u = taucs_chsolve(hchol,b);
taucs_chdel(hchol);