Skip to content

Commit

Permalink
Fix bug when updating the RBF coefficients
Browse files Browse the repository at this point in the history
  • Loading branch information
Weslley da Silva Pereira committed Jul 9, 2024
1 parent 77d550e commit e7fe093
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions blackboxopt/rbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,21 +546,21 @@ def hessp(self, x: np.ndarray, p: np.ndarray) -> np.ndarray:
return y.flatten()

def update_coefficients(
self, fx: np.ndarray, filter: Optional[RbfFilter] = None
self, fx, filter: Optional[RbfFilter] = None
) -> None:
"""Updates the coefficients of the RBF model.
Parameters
----------
fx : np.ndarray
fx : array-like
Function values on the sampled points.
filter : RbfFilter | None, optional
Filter used with the function values. The default is None, which
means the filter used in the initialization of the RBF model is
used.
"""
if fx.size <= self._m:
self.get_fsamples()[self._m - fx.size : self._m] = fx
if len(fx) <= self._m:
self._fx[self._m - len(fx) : self._m] = fx
else:
raise ValueError("Invalid number of function values")
if filter is None:
Expand Down

0 comments on commit e7fe093

Please sign in to comment.