about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/BNT/potentials/@scgcpot/marginalize_pot.m
blob: c4ca9b688040b94599d0b18370e4eb8cba14c4e9 (plain)
1
2
3
4
5
6
7
function smallpot = marginalize_pot(bigpot, keepdom, sumoverdom, nodesizes)
% MARGINALIZE_POT Marginalize a mpot onto a smaller domain.
% smallpot = marginalize_pot(bigpot, keep)

keepsize = sum(nodesizes(keepdom));
[A1, A2, B1, B2, C11, C12, C21, C22] = partition_matrix_vec_3(bigpot.A, bigpot.B, bigpot.C, keepdom, sumoverdom, nodesizes);
smallpot = scgcpot(keepsize, bigpot.ctailsize, bigpot.p, A1, B1, C11);