Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions opfunu/utils/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ def non_continuous_rastrigin_func(x):


def elliptic_func(x):
x = np.array(x).ravel()
ndim = len(x)
idx = np.arange(0, ndim)
if ndim == 1:
return x[0] ** 2 # degenerate 1D case: avoids (ndim-1) = 0 division
idx = np.arange(ndim)
return np.sum(10 ** (6.0 * idx / (ndim - 1)) * x ** 2)


Expand Down