wolffd@0: function bigpot = divide_by_pot(bigpot, smallpot) wolffd@0: % DIVIDE_BY_POT bigpot /= smallpot for cpot wolffd@0: % bigpot = divide_by_pot(bigpot, smallpot) wolffd@0: % wolffd@0: % smallpot's domain must be a subset of bigpot's domain. wolffd@0: wolffd@0: bigpot.g = bigpot.g - smallpot.g; wolffd@0: if sum(smallpot.sizes) > 0 wolffd@0: mask = find_equiv_posns(smallpot.domain, bigpot.domain); wolffd@0: u = block(mask, bigpot.sizes); wolffd@0: bigpot.h(u) = bigpot.h(u) - smallpot.h; wolffd@0: bigpot.K(u, u) = bigpot.K(u, u) - smallpot.K; wolffd@0: end