![]() |
Previous | Next | bidiag_solve_ok.m |
function [ok] = bidiag_solve_ok()
ok = true;
m = 2;
n = 3;
N = 4;
% case where uk = 0, qk = I, and ak is random
rand('seed', 123);
a = rand(n, n, N);
r = rand(n * N, m);
c = zeros(n, n, N);
for k = 1 : N
ak = a(:, :, k);
b(:, :, k) = 2 * eye(n) + ak * ak';
c(:, :, k) = ak';
end
% ----------------------------------------
[e, lambda] = ckbs_bidiag_solve(b, c, r);
% ----------------------------------------
check = ckbs_blkbidiag_mul(b, c, e);
ok = ok & max(max(abs(check - r))) < 1e-10;
return
end