JuliaLinearAlgebra / IterativeSolvers.jl

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

Fix vector types in cg state #230

Closed baggepinnen closed 5 years ago

baggepinnen commented 5 years ago

This solves this issue https://github.com/kul-forbes/ProximalOperators.jl/issues/64 When x is a SubArray, zero(x) creates an Array and the types will not be the same. similar(x::SubArray) also results in an Array

haampie commented 5 years ago

Thanks for pointing this out! :) I think a slightly more idiomatic way is to remove the type definitions and make Julia figure it out. I think this is what @mohamed82008 also did in #227.

haampie commented 5 years ago

Closing this in favour of #231. Thanks for pointing this out and opening a pr!