# Last edited on 2021-07-31 15:48:45 by jstolfi from hann_mesa import hann_mesa def weights_mesa(s,mrg): # Given a ser of sampling points {s[...]}, each being a {d}-tuple of floats, # weturn a vector of weights for those points. The weights are 1 well inside the # signed unit cube { [-1 _ +1]^d }, and decay to 0 within {mrg} away from the # cube's boundary. w = []; # Sample weights. for sk in s: wk = 1 for x in sk: wx = hann_mesa(x,mrg) wk = wk*wx w.append(wk) return w # ----------------------------------------------------------------------