0

I was surfing scipy's codebase on GitHub and I came across the following synthax for what seems to be a docstring:

class Salomon(Benchmark):

    r"""
    Salomon objective function.
    This class defines the Salomon [1]_ global optimization problem. This is a
    multimodal minimization problem defined as follows:
    .. math::
        f_{\text{Salomon}}(x) = 1 - \cos \left (2 \pi
        \sqrt{\sum_{i=1}^{n} x_i^2} \right) + 0.1 \sqrt{\sum_{i=1}^n x_i^2}
    Here, :math:`n` represents the number of dimensions and :math:`x_i \in
    [-100, 100]` for :math:`i = 1, ..., n`.
    *Global optimum*: :math:`f(x) = 0` for :math:`x_i = 0` for
    :math:`i = 1, ..., n`
    .. [1] Jamil, M. & Yang, X.-S. A Literature Survey of Benchmark Functions
    For Global Optimization Problems Int. Journal of Mathematical Modelling
    and Numerical Optimisation, 2013, 4, 150-194.
    """

For what is this r""" synthax used for? Why do not use normal """<docstring>""" or '''<docstring>'''?

0 Answers0