Example #1
0
 def f(self, x):
     z = 2* x * self._signs        
     z[1:] += (z[:-1]-self.xopt[:-1]) * 0.25
     z = 100 * (dot(self._diags, (z-self.xopt)) + self.xopt)
     return - 1. / float(self.xdim) * sum(z * sin(sqrt(abs(z)))) + self._k + 100 * penalize(z / 100.)
Example #2
0
 def f(self, x):
     z = x * self._signs
     z[1:] = x[:-1] * 0.25
     return - 1. / (self.xdim) * sum(z * sin(sqrt(z))) + self._k + 100 * penalize(z / 100)
Example #3
0
 def f(self, x):
     z = 2 * x * self._signs
     z[1:] += (z[:-1] - self.xopt[:-1]) * 0.25
     z = 100 * (dot(self._diags, (z - self.xopt)) + self.xopt)
     return -1. / float(self.xdim) * sum(
         z * sin(sqrt(abs(z)))) + self._k + 100 * penalize(z / 100.)