class_docstr: Decorator for evaluation functions, it rotates the objective function
  by *matrix* which should be a valid orthogonal NxN rotation matrix, with N
  the length of an individual. When called the decorated function should
  take as first argument the individual to be evaluated. The inverse
  rotation matrix is actually applied to the individual and the resulting
  list is given to the evaluation function. Thus, the evaluation function
  shall not be expecting an individual as it will receive a plain list
  (numpy.array). The multiplication is done using numpy.
  
  This decorator adds a :func:`rotate` method to the decorated function.
  
  .. note::
  
     A random orthogonal matrix Q can be created via QR decomposition. ::
  
         A = numpy.random.random((n,n))
         Q, _ = numpy.linalg.qr(A)
class_docstr_tok: ["Decorator","for","evaluation","functions",",","it","rotates","the","objective","function","by","*","matrix","*","which","should","be","a","valid","orthogonal","NxN","rotation","matrix",",","with","N","the","length","of","an","individual",".","When","called","the","decorated","function","should","take","as","first","argument","the","individual","to","be","evaluated",".","The","inverse","rotation","matrix","is","actually","applied","to","the","individual","and","the","resulting","list","is","given","to","the","evaluation","function",".","Thus",",","the","evaluation","function","shall","not","be","expecting","an","individual","as","it","will","receive","a","plain","list","(","numpy.array",")",".","The","multiplication","is","done","using","numpy",".","This","decorator","adds","a",":","func",":","`","rotate","`","method","to","the","decorated","function",".","..","note",":",":","A","random","orthogonal","matrix","Q","can","be","created","via","QR","decomposition",".",":",":","A","=","numpy.random.random","(","(","n",",","n",")",")","Q",",","_","=","numpy.linalg.qr","(","A",")"]
code: def __init__(self, matrix):
      if not numpy_imported:
          raise RuntimeError(
              "Numpy is required for using the rotation " "decorator"
          )
      # The inverse is taken since the rotation is applied to the individual
      # and not the function which is the inverse
      self.matrix = numpy.linalg.inv(matrix)
  
imports: from math import hypot, sqrt
  from functools import wraps
  from itertools import repeat
label_desc: Use image node_id 1 to create a new rotate object from inherited base classes: object with example: obj = rotate(matrix)