(self, x, rot=0)
return f if len(f) > 1 else f[0]
Tablet test objective function
Tablet test objective function
Tablet test objective function
def tablet(self, x, rot=0):
        """Tablet test objective function"""
        if rot:
            x = rotate(x)
        x = [x] if np.isscalar(x[0]) else x  # scalar into list
        f = [1e6*x[0]**2 + sum(x[1:]**2) for x in x]
        return f if len(f) > 1 else f[0]  # 1-element-list into scalar
def tablet ( self , x , rot = 0 ) : if rot : x = rotate ( x ) x = [ x ] if np . isscalar ( x [ 0 ] ) else x # scalar into list f = [ 1e6 * x [ 0 ] ** 2 + sum ( x [ 1 : ] ** 2 ) for x in x ] return f if len ( f ) > 1 else f [ 0 ] # 1-element-list into scalar