Example #1
0
def partition(c, masks, selected, seed=None):
    if isinstance(c, _cs.Mask):
        return _cs.MaskPartition(c, masks, selected, seed)
    elif isinstance(c, _cs.ConnectionSet):
        return _cs.ConnectionSet(_cs.CSetPartition(c, masks, selected, seed))
Example #2
0
def cset(mask, *valueSets):
    if valueSets:
        c = _cs.ExplicitCSet(mask, *valueSets)
        return _cs.ConnectionSet(c)
    else:
        return mask
Example #3
0
 def __mul__(self, other):
     c = cs.coerceCSet(other)
     if isinstance(c, cs.Mask):
         return FixedMask(other)
     else:
         return cs.ConnectionSet(FixedCSet(other))
Example #4
0
 def __mul__(self, other):
     c = cs.coerceCSet(other)
     if isinstance(c, cs.Mask):
         return other.shift(self.M, self.N)
     else:
         return cs.ConnectionSet(other.shift(self.M, self.N))
Example #5
0
 def __mul__(self, other):
     c = cs.coerceCSet(other)
     if isinstance(c, cs.Mask):
         return other.transpose()
     else:
         return cs.ConnectionSet(other.transpose())
Example #6
0
 def __mul__(self, other):
     c = cs.coerceCSet(other)
     if isinstance(c, cs.Mask):
         return RepeatMask(self.M, self.N, c)
     else:
         return cs.ConnectionSet(RepeatCSet(self.M, self.N, c))