class_docstr: Weierstrass objective function.
  
  This class defines the Weierstrass [1]_ global optimization problem.
  This is a multimodal minimization problem defined as follows:
  
  .. math::
  
     f_{\text{Weierstrass}}(x) = \sum_{i=1}^{n} \left [
                                 \sum_{k=0}^{kmax} a^k \cos 
                                 \left( 2 \pi b^k (x_i + 0.5) \right) - n
                                 \sum_{k=0}^{kmax} a^k \cos(\pi b^k) \right ]
  
  
  Where, in this exercise, :math:`kmax = 20`, :math:`a = 0.5` and
  :math:`b = 3`.
  
  Here, :math:`n` represents the number of dimensions and
  :math:`x_i \in [-0.5, 0.5]` for :math:`i = 1, ..., n`.
  
  *Global optimum*: :math:`f(x) = 4` for :math:`x_i = 0` for
  :math:`i = 1, ..., n`
  
  .. [1] Mishra, S. Global Optimization by Differential Evolution and
  Particle Swarm Methods: Evaluation on Some Benchmark Functions.
  Munich Personal RePEc Archive, 2006, 1005
  
  TODO line 1591.
  TODO Jamil, Gavana have got it wrong.  The second term is not supposed to
  be included in the outer sum. Mishra code has it right as does the
  reference referred to in Jamil#166.
code: def fun(self, x, *args):
      self.nfev += 1
  
      kmax = 20
      a, b = 0.5, 3.0
  
      k = atleast_2d(arange(kmax + 1.0)).T
      t1 = a**k * cos(2 * pi * b**k * (x + 0.5))
      t2 = self.N * sum(a**k.T * cos(pi * b**k.T))
  
      return sum(sum(t1, axis=0)) - t2
  
imports: from numpy import atleast_2d, arange, sum, cos, exp, pi
  from .go_benchmark import Benchmark
label_desc: Use image node_id 2 for calling the Weierstrass obj's underlying member method code with example usage: obj.fun(x) and returns: unknown