| 1 |
function Bhat = LUfsolve(LUdata, B) |
| 2 |
% function Bhat = LUfsolve(LUdata, B) |
| 3 |
% |
| 4 |
% Compute the rhs corresponding to the Schur complement. |
| 5 |
% LUfactor must be called first. Schur complement must be solved and then |
| 6 |
% LUbsolve should be used. |
| 7 |
% |
| 8 |
% Erik Boman, Sandia National Labs, 2010. |
| 9 |
% Siva Rajamanickam, Sandia National Labs, 2010. |
| 10 |
|
| 11 |
k = LUdata.nblocks; |
| 12 |
A = LUdata.A; |
| 13 |
|
| 14 |
% Modify rhs for Schur complement. |
| 15 |
Bhat = []; |
| 16 |
for i= 1:k |
| 17 |
% b_i = b_i - \bar{A_i} * (A_i \ b_i) |
| 18 |
Bi = B(LUdata.Sr{i},:) - (A(LUdata.Sr{i},LUdata.q{i})/LUdata.U{i}) * ... |
| 19 |
(LUdata.L{i}\ B(LUdata.r{i},:)); |
| 20 |
Bhat = [Bhat; Bi]; |
| 21 |
end |