JuliaLinearAlgebra / IterativeSolvers.jl

Iterative algorithms for solving linear systems, eigensystems, and singular value problems
MIT License
401 stars 106 forks source link

Convergence history for vectors is inconsistent #199

Open leopoldcambier opened 6 years ago

leopoldcambier commented 6 years ago

In history.jl there is https://github.com/JuliaMath/IterativeSolvers.jl/blob/0cb1a5ef424df91ab5592d8e4091cf4bdac56122/src/history.jl#L185 So as I understand it, the idea is to be able to log something of the form [x1' ; x2' ; ... ; xk'], by allocating an array [maxiter] x size

This is consistent with shrink https://github.com/JuliaMath/IterativeSolvers.jl/blob/0cb1a5ef424df91ab5592d8e4091cf4bdac56122/src/history.jl#L200 where we remove the unused lines of the matrix.

However, the way vectors are logged seems buggy to me https://github.com/JuliaMath/IterativeSolvers.jl/blob/0cb1a5ef424df91ab5592d8e4091cf4bdac56122/src/history.jl#L133

We basically do matrix[i,iter] instead of the opposite I believe. It should simply be matrix[iter,i] = vec[i] no ?

When trying to log a vector at every iterations, this fails to return the proper information.