Index-> contents reference index search external Previous Next Up-> ckbs utility ckbs_blktridiag_mul blktridiag_mul_ok.m ckbs-> license ckbs_t_general ckbs_nonlinear ckbs_L1_nonlinear ckbs_affine ckbs_affine_singular ckbs_L1_affine utility all_ok.m whatsnew wishlist bib utility-> ckbs_t_obj ckbs_t_grad ckbs_t_hess ckbs_diag_solve ckbs_bidiag_solve ckbs_bidiag_solve_t ckbs_blkbidiag_symm_mul ckbs_blkdiag_mul ckbs_blkdiag_mul_t ckbs_blkbidiag_mul_t ckbs_blkbidiag_mul ckbs_blktridiag_mul ckbs_sumsq_obj ckbs_L2L1_obj ckbs_sumsq_grad ckbs_process_grad ckbs_sumsq_hes ckbs_process_hes ckbs_tridiag_solve ckbs_tridiag_solve_b ckbs_tridiag_solve_pcg ckbs_newton_step ckbs_newton_step_L1 ckbs_kuhn_tucker ckbs_kuhn_tucker_L1 ckbs_blktridiag_mul-> blktridiag_mul_ok.m blktridiag_mul_ok.m Headings-> Source Code

blktridiag_mul Example and Test

Source Code ``` function [ok] = blktridiag_mul_ok() ok = true; % ------------------------------------------------------------- % You can change these parameters m = 2; n = 3; N = 4; p = 3; % ------------------------------------------------------------- % Define the problem rand('seed', 123); v = rand(n * N, 3); rand('seed', 123); a = rand(n, n, N); r = rand(n * N, m); Hdia = rand(n, n, N); Hlow = rand(n, n, N); Hcheck = zeros(n*N); blk_n = 1 : n; for k = 1 : N Hcheck(blk_n, blk_n) = Hdia(:,:, k); blk_n = blk_n + n; end blk_n = 1:n; for k = 2:N; blk_minus = blk_n; blk_n = blk_n + n; Hcheck(blk_n, blk_minus) = Hlow(:,:, k); Hcheck(blk_minus, blk_n) = Hlow(:,:, k)'; end % ------------------------------------- H = ckbs_blktridiag_mul(Hdia, Hlow, eye(n*N)); % ------------------------------------- check = H - Hcheck; ok = ok & ( max(max(abs(check))) < 1e-10 ); return end ```
Input File: example/blktridiag_mul_ok.m