1818# Actual interpolation function #
1919#################################
2020
21- from .fungen import fmap , funzip , get_coeffs , tensor_reduction , get_index , extract_row
21+ from .fungen import fmap , funzip , get_coeffs , tensor_reduction , get_index , extract_row , project
2222
2323from numba import njit
2424from typing import Tuple
@@ -136,7 +136,8 @@ def {funname}(*args):
136136 grid = { grid_s }
137137 C = args[{ it .d } ]
138138 point = { point_s }
139- res = mlinterp(grid, C, point)
139+ ppoint = project(grid, point)
140+ res = mlinterp(grid, C, ppoint)
140141 return res
141142 """
142143 return source
@@ -152,7 +153,8 @@ def {funname}(*args):
152153 res = zeros(N)
153154 # return res
154155 for n in range(N):
155- res[n] = mlinterp(grid, C, { p_s } )
156+ ppoint = project(grid, { p_s } )
157+ res[n] = mlinterp(grid, C, ppoint)
156158 return res
157159"""
158160 return source
@@ -168,7 +170,8 @@ def {funname}(*args):
168170 N = points_x.shape[0]
169171 res = zeros(N)
170172 for n in range(N):
171- res[n] = mlinterp(grid, C, (points_x[n],))
173+ ppoint = project(grid,(points_x[n],))
174+ res[n] = mlinterp(grid, C, ppoint)
172175 return res
173176"""
174177 elif it .d == 2 :
@@ -184,7 +187,8 @@ def {funname}(*args):
184187 res = zeros((N,M))
185188 for n in range(N):
186189 for m in range(M):
187- res[n,m] = mlinterp(grid, C, (points_x[n], points_y[m]))
190+ ppoint = project(grid,(points_x[n], points_y[m]))
191+ res[n,m] = mlinterp(grid, C, ppoint)
188192 return res
189193"""
190194 else :
0 commit comments