def __init__(self, dims, rowMajor=True):
        """
        Constructor
        @param dims list of dimensions along each axis
        @param rowMajor True if row major, False if column major
        """
        self.dims = dims
        self.ntot = reduce(operator.mul, self.dims, 1)
        self.ndims = len(self.dims)
        self.big_index = -1
        self.dimProd = numpy.array([1 for i in range(self.ndims)])
        if rowMajor:
            # row major
            for i in range(self.ndims - 2, -1, -1):
                self.dimProd[i] = self.dimProd[i + 1] * self.dims[i + 1]
        else:
            # column major
            for i in range(1, self.ndims):
                self.dimProd[i] = self.dimProd[i - 1] * self.dims[i - 1]
def __init__ ( self , dims , rowMajor = True ) : self . dims = dims self . ntot = reduce ( operator . mul , self . dims , 1 ) self . ndims = len ( self . dims ) self . big_index = - 1 self . dimProd = numpy . array ( [ 1 for i in range ( self . ndims ) ] ) if rowMajor : for i in range ( self . ndims - 2 , - 1 , - 1 ) : self . dimProd [ i ] = self . dimProd [ i + 1 ] * self . dims [ i + 1 ] else : for i in range ( 1 , self . ndims ) : self . dimProd [ i ] = self . dimProd [ i - 1 ] * self . dims [ i - 1 ]
Constructor
        @param dims list of dimensions along each axis
        @param rowMajor True if row major, False if column major