Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix harmonic restart svdl on master #59

Merged
merged 3 commits into from
Nov 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
language: julia
os:
- osx
- linux
julia:
- 0.4
- nightly
notifications:
email: false
script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia -e 'Pkg.clone(pwd()); Pkg.build("IterativeSolvers"); Pkg.test("IterativeSolvers"; coverage=true)'
- julia -e 'cd(Pkg.dir("IterativeSolvers")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coverage.process_folder()); Codecov.submit(Coverage.process_folder())'
- julia -e 'Pkg.clone(pwd())'
- julia -e 'Pkg.test("IterativeSolvers", coverage=true)'
after_success:
- julia -e 'Pkg.add("Coverage"); cd(Pkg.dir("IterativeSolvers")); using Coverage; Coveralls.submit(Coveralls.process_folder()); Codecov.submit(process_folder())'
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
[![IterativeSolvers](http://pkg.julialang.org/badges/IterativeSolvers_0.4.svg)](http://pkg.julialang.org/?pkg=IterativeSolvers&ver=0.4)
[![Build Status on Linux](https://travis-ci.org/JuliaLang/IterativeSolvers.jl.svg?branch=master)](https://travis-ci.org/JuliaLang/IterativeSolvers.jl)
[![Build status on Windows](https://ci.appveyor.com/api/projects/status/eaoi7dw2j6qqfskf/branch/master)](https://ci.appveyor.com/project/jiahao/iterativesolvers-jl/branch/master)
[![Coverage Status](https://img.shields.io/coveralls/JuliaLang/IterativeSolvers.jl.svg)](https://img.shields.io/coveralls/JuliaLang/IterativeSolvers.jl.svg)
[![Coverage Status](https://coveralls.io/repos/JuliaLang/IterativeSolvers.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/JuliaLang/IterativeSolvers.jl?branch=master)
[![codecov.io](https://codecov.io/github/JuliaLang/IterativeSolvers.jl/coverage.svg?branch=master)](https://codecov.io/github/JuliaLang/IterativeSolvers.jl?branch=master)

© 2013---2015 [The Contributors](https://github.com/JuliaLang/IterativeSolvers.jl/contributors). Released under the [MIT License](https://github.com/JuliaLang/julia/blob/master/LICENSE.md).

Expand Down
15 changes: 13 additions & 2 deletions src/svdl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,14 @@ function harmonicrestart!{T,Tr}(A, L::PartialFactorization{T,Tr},
F0 = F# svdfact(L.B)
ρ = L.β*F0[:U][end,:] #Residuals of singular values

F2 = svdfact!([diagm(F0[:S]) ρ'], thin=false)

#Construct broken arrow matrix
if VERSION < v"0.5.0-"
BA = [diagm(F0[:S]) ρ']
else #slicing behavior changed in 0.5
BA = [diagm(F0[:S]) ρ]
end
F2 = svdfact!(BA, thin=false)

#Take k largest triplets
Σ = (F2[:S]::Vector{Tr})[1:k]
Expand Down Expand Up @@ -486,7 +493,11 @@ function harmonicrestart!{T,Tr}(A, L::PartialFactorization{T,Tr},
Q = L.Q*Q
P = L.P*sub(U,:,1:k)

R = sub(R,1:k+1,1:k) + sub(R,:,k+1)*Mend
if VERSION < v"0.5.0-"
R = sub(R,1:k+1,1:k) + sub(R,:,k+1)*Mend
else
R = sub(R,1:k+1,1:k) + sub(R,:,k+1)*Mend'
end

f = A*sub(Q,:,k+1)
f -= P*(P'f)
Expand Down