def _eval_firstorder(self, rvecs, data, sigma):
if not self.blocksize:<EOL><INDENT>dist_between_points = self._distance_matrix(rvecs, self.x)<EOL>gaussian_weights = self._weight(dist_between_points, sigma=sigma)<EOL>return gaussian_weights.dot(data) / gaussian_weights.sum(axis=<NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>ans = np.zeros(rvecs.shape[<NUM_LIT:0>], dtype='<STR_LIT:float>')<EOL>bs = self.blocksize<EOL>for a in range(<NUM_LIT:0>, rvecs.shape[<NUM_LIT:0>], bs):<EOL><INDENT>dist = self._distance_matrix(rvecs[a:a+bs], self.x)<EOL>weights = self._weight(dist, sigma=sigma)<EOL>ans[a:a+bs] += weights.dot(data) / weights.sum(axis=<NUM_LIT:1>)<EOL><DEDENT>return ans<EOL><DEDENT>
The first-order Barnes approximation