Module cma :: Class Rotation
[hide private]
[frames] | no frames]

Class Rotation

source code

object --+
         |
        Rotation

Rotation class that implements an orthogonal linear transformation, one for each dimension.

By default reach Rotation instance provides a different "random" but fixed rotation. This class is used to implement non-separable test functions, most conveniently via FFWrapper.RotatedFitness.

Example:

>>> import cma, numpy as np
>>> R = cma.Rotation()
>>> R2 = cma.Rotation() # another rotation
>>> x = np.array((1,2,3))
>>> print(R(R(x), inverse=1))
[ 1.  2.  3.]

See: FFWrapper.RotatedFitness

Instance Methods [hide private]
 
__init__(self, seed=None)
by default a random but fixed rotation, different for each instance
source code
 
__call__(self, x, inverse=False)
Rotates the input array x with a fixed rotation matrix (self.dicMatrices['str(len(x))'])
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  dicMatrices = {}
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, seed=None)
(Constructor)

source code 
by default a random but fixed rotation, different for each instance
Overrides: object.__init__