(self, x, inverse=False)
Rotates the input array `x` with a fixed rotation matrix
           (``self.dicMatrices['str(len(x))']``)
Rotates the input array `x` with a fixed rotation matrix
           (``self.dicMatrices['str(len(x))']``)
Rotates the input array x with a fixed rotation matrix ( self . dicMatrices [ str ( len ( x )) ] )
def __call__(self, x, inverse=False): # function when calling an object
        """Rotates the input array `x` with a fixed rotation matrix
           (``self.dicMatrices['str(len(x))']``)
        """
        N = x.shape[0]  # can be an array or matrix, TODO: accept also a list of arrays?
        if str(N) not in self.dicMatrices: # create new N-basis for once and all
            B = np.random.randn(N, N)
            for i in xrange(N):
                for j in xrange(0, i):
                    B[i] -= np.dot(B[i], B[j]) * B[j]
                B[i] /= sum(B[i]**2)**0.5
            self.dicMatrices[str(N)] = B
        if inverse:
            return np.dot(self.dicMatrices[str(N)].T, x)  # compute rotation
        else:
            return np.dot(self.dicMatrices[str(N)], x)  # compute rotation
def __call__ ( self , x , inverse = False ) : # function when calling an object N = x . shape [ 0 ] # can be an array or matrix, TODO: accept also a list of arrays? if str ( N ) not in self . dicMatrices : # create new N-basis for once and all B = np . random . randn ( N , N ) for i in xrange ( N ) : for j in xrange ( 0 , i ) : B [ i ] -= np . dot ( B [ i ] , B [ j ] ) * B [ j ] B [ i ] /= sum ( B [ i ] ** 2 ) ** 0.5 self . dicMatrices [ str ( N ) ] = B if inverse : return np . dot ( self . dicMatrices [ str ( N ) ] . T , x ) # compute rotation else : return np . dot ( self . dicMatrices [ str ( N ) ] , x ) # compute rotation