def nearest_interpolation(self, coords, n_jobs=-<NUM_LIT:1>):
if is_address(coords):<EOL><INDENT>(fs, xs) = address_data(coords, dims=<NUM_LIT:2>, strict=False)<EOL>ii = np.where(np.isfinite(np.sum(xs, axis=<NUM_LIT:0>)))[<NUM_LIT:0>]<EOL>xs = np.vstack([xs, [<NUM_LIT:1> - np.sum(xs, axis=<NUM_LIT:0>)]])<EOL>nv = fs[(np.argmax(xs, axis=<NUM_LIT:0>), np.arange(fs.shape[<NUM_LIT:1>]))]<EOL>nv = self.tess.index(nv[:,ii])<EOL><DEDENT>else:<EOL><INDENT>coords = np.asarray(coords)<EOL>if coords.shape[<NUM_LIT:0>] == self.coordinates.shape[<NUM_LIT:0>]: coords = coords.T<EOL>nv = self.nearest_vertex(coords, n_jobs=n_jobs)<EOL>ii = np.arange(len(nv))<EOL><DEDENT>n = self.vertex_count<EOL>m = len(ii)<EOL>return sps.csr_matrix((np.ones(m, dtype=np.int), (np.arange(m)[ii], nv)),<EOL>shape=(m,n),<EOL>dtype=np.int)<EOL>
mesh.nearest_interpolation(x) yields an interpolation matrix for the given coordinate or
  coordinate matrix x. An interpolation matrix is just a sparce array M such that for a
  column vector u with the same number of rows as there are vertices in mesh, M * u is the
  interpolated values of u at the coordinates in x.