class_docstr: Odd Square objective function.
  
  This class defines the Odd Square [1]_ global optimization problem. This
  is a multimodal minimization problem defined as follows:
  
  .. math::
  
     f_{\text{OddSquare}}(x) = -e^{-\frac{d}{2\pi}} \cos(\pi d)
     \left( 1 + \frac{0.02h}{d + 0.01} \right )
  
  
  Where, in this exercise:
  
  .. math::
  
      \begin{cases}
      d = n \cdot \smash{\displaystyle\max_{1 \leq i \leq n}} 
          \left[ (x_i - b_i)^2 \right ] \\
      h = \sum_{i=1}^{n} (x_i - b_i)^2
      \end{cases}
  
  And :math:`b = [1, 1.3, 0.8, -0.4, -1.3, 1.6, -0.2, -0.6, 0.5, 1.4, 1, 1.3,
                  0.8, -0.4, -1.3, 1.6, -0.2, -0.6, 0.5, 1.4]`
  
  Here, :math:`n` represents the number of dimensions and
  :math:`x_i \in [-5 \pi, 5 \pi]` for :math:`i = 1, ..., n` and
  :math:`n \leq 20`.
  
  *Global optimum*: :math:`f(x_i) = -1.0084` for :math:`x \approx b`
  
  .. [1] Gavana, A. Global Optimization Benchmarks and AMPGO retrieved 2015
  
  TODO The best solution changes on dimensionality
class_docstr_tok: ["Odd","Square","objective","function",".","This","class","defines","the","Odd","Square","[","1","]","_","global","optimization","problem",".","This","is","a","multimodal","minimization","problem","defined","as","follows",":","..","math",":",":","f_","{","\\text","{","OddSquare","}","}","(","x",")","=","-e^","{","-\\frac","{","d","}","{","2\\pi","}","}","\\cos","(","\\pi","d",")","\\left","(","1","+","\\frac","{","0.02h","}","{","d","+","0.01","}","\\right",")","Where",",","in","this","exercise",":","..","math",":",":","\\begin","{","cases","}","d","=","n","\\cdot","\\smash","{","\\displaystyle\\max_","{","1","\\leq","i","\\leq","n","}","}","\\left","[","(","x_i","-","b_i",")","^2","\\right","]","\\\\","h","=","\\sum_","{","i=1","}","^","{","n","}","(","x_i","-","b_i",")","^2","\\end","{","cases","}","And",":","math",":","`","b","=","[","1",",","1.3",",","0.8",",","-0.4",",","-1.3",",","1.6",",","-0.2",",","-0.6",",","0.5",",","1.4",",","1",",","1.3",",","0.8",",","-0.4",",","-1.3",",","1.6",",","-0.2",",","-0.6",",","0.5",",","1.4","]","`","Here",",",":","math",":","`","n","`","represents","the","number","of","dimensions","and",":","math",":","`","x_i","\\in","[","-5","\\pi",",","5","\\pi","]","`","for",":","math",":","`","i","=","1",",","...",",","n","`","and",":","math",":","`","n","\\leq","20","`",".","*","Global","optimum","*",":",":","math",":","`","f","(","x_i",")","=","-1.0084","`","for",":","math",":","`","x","\\approx","b","`","..","[","1","]","Gavana",",","A",".","Global","Optimization","Benchmarks","and","AMPGO","retrieved","2015","TODO","The","best","solution","changes","on","dimensionality"]
code: def fun(self, x, *args):
      self.nfev += 1
      b = self.a[0 : self.N]
      d = self.N * max((x - b) ** 2.0)
      h = sum((x - b) ** 2.0)
      return (
          -exp(-d / (2.0 * pi))
          * cos(pi * d)
          * (1.0 + 0.02 * h / (d + 0.01))
      )
  
imports: from numpy import sum, cos, exp, pi, asarray
  from .go_benchmark import Benchmark
label_desc: Use image node_id 2 for calling the OddSquare obj's underlying member method code with example usage: obj.fun(x) and returns: unknown