Example #1
0
 def interpolate_prid_point_index(self, point):
     tmat = num.array(self._GridVectors).T
     float_coords = tmat <<num.solve>> (point - self._Origin)
     rounded_down_int_coords = [int(math.floor(c)) for c in float_coords]
     neighbors = [rounded_down_int_coords]
     for d in range(len(self._GridVectors)):
         new_neighbors = []
         for item in neighbors:
             new_neighbors.append(item) 
             new_neighbor = item[:]
             new_neighbor[d] += 1
             new_neighbors.append(new_neighbor)
         neighbors = new_neighbors
     weights = []
     for neighbor in neighbors:
         weight = product([1-abs(a-b) for a,b in zip(float_coords, neighbor)])
         if abs(weight) >= 1e-5:
             weights.append((weight, tuple(neighbor)))
     return weights
Example #2
0
 def __call__(self, x):
     import pylinear.array as num
     return num.array([[func(x) for func in flist ] for flist in self.FunctionList])
Example #3
0
 def find_closest_grid_point_index(self, point):
     tmat = num.array(self._GridVectors).T
     float_coords = tmat <<num.solve>> (point - self._Origin)
     return tuple([int(round(c)) for c in float_coords])