Mercurial > hg > mauch-mirex-2010
annotate _FullBNT/KPMtools/partition_matrix_vec.m @ 9:4ea6619cb3f5 tip
removed log files
author | matthiasm |
---|---|
date | Fri, 11 Apr 2014 15:55:11 +0100 |
parents | b5b38998ef3b |
children |
rev | line source |
---|---|
matthiasm@8 | 1 function [m1, m2, K11, K12, K21, K22] = partition_matrix_vec(m, K, n1, n2, bs) |
matthiasm@8 | 2 % PARTITION_MATRIX_VEC Partition a vector and matrix into blocks. |
matthiasm@8 | 3 % [m1, m2, K11, K12, K21, K22] = partition_matrix_vec(m, K, blocks1, blocks2, bs) |
matthiasm@8 | 4 % |
matthiasm@8 | 5 % bs(i) = block size of i'th node |
matthiasm@8 | 6 % |
matthiasm@8 | 7 % Example: |
matthiasm@8 | 8 % n1 = [6 8], n2 = [5], bs = [- - - - 2 1 - 2], where - = don't care |
matthiasm@8 | 9 % m = [0.1 0.2 0.3 0.4 0.5], K = some 5*5 matrix, |
matthiasm@8 | 10 % So E[X5] = [0.1 0.2], E[X6] = [0.3], E[X8] = [0.4 0.5] |
matthiasm@8 | 11 % m1 = [0.3 0.4 0.5], m2 = [0.1 0.2]; |
matthiasm@8 | 12 |
matthiasm@8 | 13 dom = myunion(n1, n2); |
matthiasm@8 | 14 n1i = block(find_equiv_posns(n1, dom), bs(dom)); |
matthiasm@8 | 15 n2i = block(find_equiv_posns(n2, dom), bs(dom)); |
matthiasm@8 | 16 m1 = m(n1i); |
matthiasm@8 | 17 m2 = m(n2i); |
matthiasm@8 | 18 K11 = K(n1i, n1i); |
matthiasm@8 | 19 K12 = K(n1i, n2i); |
matthiasm@8 | 20 K21 = K(n2i, n1i); |
matthiasm@8 | 21 K22 = K(n2i, n2i); |