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",")"]
docstr: Set the current rotation to *matrix*. After decorating the
  evaluation function, this function will be available directly from
  the function object. ::
  
      # Create a random orthogonal matrix
      A = numpy.random.random((n,n))
      Q, _ = numpy.linalg.qr(A)
  
      @rotate(Q)
      def evaluate(individual):
          return sum(individual),
  
      # This will reset rotation to identity
      evaluate.rotate(numpy.identity(n))
docstr_tok: ["Set","the","current","rotation","to","*","matrix","*",".","After","decorating","the","evaluation","function",",","this","function","will","be","available","directly","from","the","function","object",".",":",":","#","Create","a","random","orthogonal","matrix","A","=","numpy.random.random","(","(","n",",","n",")",")","Q",",","_","=","numpy.linalg.qr","(","A",")","@","rotate","(","Q",")","def","evaluate","(","individual",")",":","return","sum","(","individual",")",",","#","This","will","reset","rotation","to","identity","evaluate.rotate","(","numpy.identity","(","n",")",")"]
code: def rotate(self, matrix):
      """Set the current rotation to *matrix*. After decorating the
      evaluation function, this function will be available directly from
      the function object. ::
  
          # Create a random orthogonal matrix
          A = numpy.random.random((n,n))
          Q, _ = numpy.linalg.qr(A)
  
          @rotate(Q)
          def evaluate(individual):
              return sum(individual),
  
          # This will reset rotation to identity
          evaluate.rotate(numpy.identity(n))
      """
      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 3 for calling the rotate obj's underlying member method code with example usage: obj.rotate(matrix) without return types