Example #1
0
    def _D_times_c_star(self,c,as_int=False):
        r"""
        Return the set D^c*=x_c+{c*x | x in D}, where x_c=0 or 1/2

        INPUT:
        -''c'' -- integer
        -''as_int'' -- logical, if true then we return the set D^c as a list of integers
        
        """
        Dc=self._D_times_c(c,as_int)
        Dcs=list()
        x_c=self._xc(c,as_int)
       
        for x in Dc:
            if(as_int):
                z=(x + x_c) % len(self._D)
            else:
                y=QQ(c*x)+x_c
                p=y.numer(); q=y.denom(); z=QQ(p % q)/QQ(q)
            #print "c*",x,"=",z
            Dcs.append(z)
        Dcs.sort()
        # make unique
        for x in Dcs:
            i=Dcs.count(x)
            if(i>1):
                for j in range(i-1):
                    Dcs.remove(x)
        return Dcs
Example #2
0
    def _D_times_c_star(self,c,as_int=False):
        r"""
        Return the set D^c*=x_c+{c*x | x in D}, where x_c=0 or 1/2

        INPUT:
        -''c'' -- integer
        -''as_int'' -- logical, if true then we return the set D^c as a list of integers
        
        """
        Dc=self._D_times_c(c,as_int)
        Dcs=list()
        x_c=self._xc(c,as_int)
       
        for x in Dc:
            if(as_int):
                z=(x + x_c) % len(self._D)
            else:
                y=QQ(c*x)+x_c
                p=y.numer(); q=y.denom(); z=QQ(p % q)/QQ(q)
            #print "c*",x,"=",z
            Dcs.append(z)
        Dcs.sort()
        # make unique
        for x in Dcs:
            i=Dcs.count(x)
            if(i>1):
                for j in range(i-1):
                    Dcs.remove(x)
        return Dcs