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

orthogonalize R to X in lobpcg.c #2

Open
lobpcg opened this issue Jun 8, 2019 · 0 comments
Open

orthogonalize R to X in lobpcg.c #2

lobpcg opened this issue Jun 8, 2019 · 0 comments

Comments

@lobpcg
Copy link
Owner

lobpcg commented Jun 8, 2019

https://github.com/lobpcg/blopex/blob/master/blopex_abstract/krylov/lobpcg.c is a somewhat simplified C version, following https://arxiv.org/abs/0705.2626, of my original MATLAB implementation https://github.com/lobpcg/blopex/blob/master/blopex_tools/matlab/lobpcg/lobpcg.m

Comparing my original MATLAB implementation https://github.com/lobpcg/blopex/blob/master/blopex_tools/matlab/lobpcg/lobpcg.m with https://github.com/lobpcg/blopex/blob/master/blopex_abstract/krylov/lobpcg.c code, I see an important step missing: MATLAB lines 601-608

%Making active (preconditioned) residuals orthogonal to blockVectorX
if isempty(operatorB)
    blockVectorR(:,activeMask) = blockVectorR(:,activeMask) - ...
        blockVectorX*(blockVectorX'*blockVectorR(:,activeMask));
else
    blockVectorR(:,activeMask) = blockVectorR(:,activeMask) - ...
        blockVectorX*(blockVectorBX'*blockVectorR(:,activeMask));
end

that should have been before line 1026 /*--- orthonormilize blockVectorR */ of https://github.com/lobpcg/blopex/blob/master/blopex_abstract/krylov/lobpcg.c

Other relevant improvements are implemented in scikit-learn/scikit-learn#12319

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant