source: projects/ckbs/trunk/test/blkdiag_mul_t_ok.m @ 95

Last change on this file since 95 was 35, checked in by bradbell, 11 years ago

Revmove reference to gpl2.txt and further shorten copyright and license statement

File size: 1.4 KB
Line 
1% -------------------------------------------------------------------
2% ckbs: Constrained Kalman-Bucy Smoother Program: Copyright (C) 2006
3% Authors: Bradlely Bell:        bradbell at washington dot edu
4%          Gianluigi Pillonetto: giapi at dei dot unipd dot it
5% License: GNU General Public License Version 2
6% -------------------------------------------------------------------
7% $begin blkdiag_mul_t_ok.m$$ $newlinech %$$
8% $spell
9%       ckbs
10%       Bdiag
11%       blk
12%       blkdiag
13%       mul
14% $$
15%
16% $section blkdiag_mul_t Example and Test$$
17%
18% $index ckbs_blkdiag_mul_t, example and test$$
19% $index blkdiag_mul_t, example and test$$
20% $index example, blkdiag_mul_t$$
21% $index test, blkdiag_mul_t%$$
22%
23% $head Source Code$$
24% $newlinech $$ $codep
25function [ok] = blkdiag_mul_t_ok()
26ok = true;
27% -------------------------------------------------------------
28% You can change these parameters
29m    = 2;
30n    = 3;
31N    = 2;
32% -------------------------------------------------------------
33% Define the problem
34rand('seed', 123);
35v     = rand(m * N, 1);
36Bdiag = zeros(m, n, N);
37B     = zeros(m * N , n * N);
38blk_m = 1 : m;
39blk_n = 1 : n;
40for k = 1 : N
41        Bdiag(:, :, k)  = rand(m, n);
42        B(blk_m, blk_n) = Bdiag(:, :, k);
43        blk_m           = blk_m + m;
44        blk_n           = blk_n + n;
45end
46% -------------------------------------
47w     = ckbs_blkdiag_mul_t(Bdiag, v);
48% -------------------------------------
49check = B' * v;
50ok    = ok & ( max(abs(w - check)) < 1e-10 );
51return
52end
53% $$ $newlinech %$$
54% $end
Note: See TracBrowser for help on using the repository browser.