wolffd@0: function bigpot = multiply_by_pot(bigpot, smallpot, varargin) wolffd@0: % MULTIPLY_BY_POT bigpot *= smallpot for cgpot wolffd@0: % bigpot = multiply_by_pot(bigpot, smallpot) wolffd@0: % wolffd@0: % smallpot's domain must be a subset of bigpot's domain. wolffd@0: wolffd@0: bigpot = cg_mom_to_can(bigpot); wolffd@0: smallpot = cg_mom_to_can(smallpot); wolffd@0: wolffd@0: mask = find_equiv_posns(smallpot.ddom, bigpot.ddom); wolffd@0: for i=1:bigpot.dsize wolffd@0: if isempty(smallpot.ddom) wolffd@0: src = 1; wolffd@0: else wolffd@0: sub = ind2subv(bigpot.dsizes, i); wolffd@0: src = subv2ind(smallpot.dsizes, sub(mask)); wolffd@0: end wolffd@0: bigpot.can{i} = multiply_by_pot(bigpot.can{i}, smallpot.can{src}); wolffd@0: end