Skip to content

Commit

Permalink
Merge pull request #370 from Chang-SHAO/main
Browse files Browse the repository at this point in the history
Update base_functions.py
  • Loading branch information
Evolutionary-Intelligence authored Jun 30, 2024
2 parents 6c932eb + 677cd7c commit d497369
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions pypop7/benchmarks/base_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __call__(self, x):
def cigar(x):
"""**Cigar** test function.
.. note:: It's LaTeX formulation is ``. Its dimensionality should `> 1`.
.. note:: It's LaTeX formulation is `$x_1^2 + 10^6 \sum_{i = 2}^{n} x_i^2$`. Its dimensionality should `> 1`.
Parameters
----------
Expand Down Expand Up @@ -106,7 +106,7 @@ def __call__(self, x):
def discus(x):
"""**Discus** (also called **Tablet**) test function.
.. note:: It's LaTeX formulation is ``. Its dimensionality should `> 1`.
.. note:: It's LaTeX formulation is `$10^6 x_1^2 + \sum_{i = 2}^{n} x_i^2$`. Its dimensionality should `> 1`.
Parameters
----------
Expand Down Expand Up @@ -183,7 +183,7 @@ def __call__(self, x):
def ellipsoid(x):
"""**Ellipsoid** test function.
.. note:: It's LaTeX formulation is ``. Its dimensionality should `> 1`.
.. note:: It's LaTeX formulation is `$\sum_{i = 1}^{n} 10^{\frac{6(i- 1)}{n - 1}} x_i^2$`. Its dimensionality should `> 1`.
Parameters
----------
Expand Down Expand Up @@ -220,7 +220,7 @@ def __call__(self, x):
def different_powers(x):
"""**Different-Powers** test function.
.. note:: It's LaTeX formulation is ``. Its dimensionality should `> 1`.
.. note:: It's LaTeX formulation is `$\sum_{i = 1}^{ n} \left | x_i \right | ^{\frac{2 + 4(i - 1)}{n - 1}}$`. Its dimensionality should `> 1`.
Parameters
----------
Expand Down Expand Up @@ -257,7 +257,7 @@ def __call__(self, x):
def schwefel221(x):
"""**Schwefel221** test function.
.. note:: It's LaTeX formulation is ``.
.. note:: It's LaTeX formulation is `$\max(\left | x_1 \right |, \cdots, \left | x_n \right |)$`.
Parameters
----------
Expand Down Expand Up @@ -293,7 +293,7 @@ def __call__(self, x):
def step(x):
"""**Step** test function.
.. note:: It's LaTeX formulation is ``.
.. note:: It's LaTeX formulation is `$\sum_{i = 1}^{n} (\lfloor x_i + 0.5 \rfloor)^2$`.
Parameters
----------
Expand Down Expand Up @@ -366,7 +366,7 @@ def __call__(self, x):
def rosenbrock(x):
"""**Rosenbrock** test function.
.. note:: It's LaTeX formulation is ``. Its dimensionality should `> 1`.
.. note:: It's LaTeX formulation is `$100 \sum_{i = 1}^{n -1} (x_i^2 - x_{i + 1})^2 + \sum_{i = 1}^{n - 1} (x_i - 1)^2$`. Its dimensionality should `> 1`.
Parameters
----------
Expand Down Expand Up @@ -403,7 +403,7 @@ def __call__(self, x):
def schwefel12(x):
"""**Schwefel12** test function.
.. note:: It's LaTeX formulation is ``. Its dimensionality should `> 1`.
.. note:: It's LaTeX formulation is `$\sum_{i = 1}^{n} (\sum_{j = 1}^{i} x_j)^2$`. Its dimensionality should `> 1`.
Parameters
----------
Expand Down Expand Up @@ -478,7 +478,7 @@ def __call__(self, x):
def griewank(x):
"""**Griewank** test function.
.. note:: It's LaTeX formulation is ``.
.. note:: It's LaTeX formulation is `$\frac{1}{4000} \sum_{i = 1}^{n} x_i^2 - \prod_{i = 1}^{n} \cos(\frac{x_i}{i ^ {0.5}}) + 1$`.
Parameters
----------
Expand Down Expand Up @@ -515,7 +515,7 @@ def __call__(self, x):
def bohachevsky(x):
"""**Bohachevsky** test function.
.. note:: It's LaTeX formulation is ``.
.. note:: It's LaTeX formulation is `$\sum_{i = 1}^{ n - 1} (x_i^2 + 2 x_{i + 1}^2 - 0.3\cos(3\pi x_i) - 0.4\cos(4\pi x_{i + 1}) + 0.7)$`.
Parameters
----------
Expand Down Expand Up @@ -554,7 +554,7 @@ def __call__(self, x):
def ackley(x):
"""**Ackley** test function.
.. note:: It's LaTeX formulation is ``.
.. note:: It's LaTeX formulation is `$20 e^{-0.2 \sqrt{\frac{1}{n} \sum_{i = 1}^{n} x_i^2}} - e^{\frac{1}{n} \sum_{i = 1}^{n} \cos(2 \pi x_i)} + 20 + e$`.
Parameters
----------
Expand Down Expand Up @@ -592,7 +592,7 @@ def __call__(self, x):
def rastrigin(x):
"""**Rastrigin** test function.
.. note:: It's LaTeX formulation is ``.
.. note:: It's LaTeX formulation is `$10 n + \sum_{i = 1}^{n} (x_i^2 - 10 \cos(2 \pi x_i))$`.
Parameters
----------
Expand Down Expand Up @@ -629,7 +629,7 @@ def __call__(self, x):
def scaled_rastrigin(x):
"""**Scaled-Rastrigin** test function.
.. note:: It's LaTeX formulation is ``.
.. note:: It's LaTeX formulation is `$10 n + \sum_{i = 1}^{n} ((10^{\frac{i - 1}{n - 1}} x_i)^2 -10\cos(2\pi 10^{\frac{i - 1}{n - 1}} x_i))$`.
Parameters
----------
Expand Down Expand Up @@ -667,7 +667,7 @@ def __call__(self, x):
def skew_rastrigin(x):
"""**Skew-Rastrigin** test function.
.. note:: It's LaTeX formulation is ``.
.. note:: It's LaTeX formulation is `$10 n + \sum_{i = 1}^{n} (y_i^2 - 10\cos(2\pi y_i))$, with $y_i = \begin{cases} 10 x_i, \mbox{if}~x_i > 0 \\ x_i, \mbox{otherweise} \end{cases}$`.
Parameters
----------
Expand Down Expand Up @@ -746,7 +746,7 @@ def __call__(self, x):
def michalewicz(x):
"""**Michalewicz** test function.
.. note:: It's LaTeX formulation is ``.
.. note:: It's LaTeX formulation is `$-\sum_{i = 1}^{n}\sin(x_i)(\sin(\frac{ix_i^2}{\pi}))^{20}$`.
Parameters
----------
Expand Down Expand Up @@ -784,7 +784,7 @@ def __call__(self, x):
def salomon(x):
"""**Salomon** test function.
.. note:: It's LaTeX formulation is ``.
.. note:: It's LaTeX formulation is `$1 - \cos(2\pi\sqrt{\sum_{i=1}^{n}x_i^2}) + 0.1 \sqrt{\sum_{i=1}^{n}x_i^2}$`.
Parameters
----------
Expand Down

0 comments on commit d497369

Please sign in to comment.