(self)
return False
Returns True if a new part has been created, and
        adjusts pstack, f and lpart as needed.

        Notes
        =====

        Spreads unallocated multiplicity from the current top part
        into a new part created above the current on the stack.  This
        new part is constrained to be less than or equal to the old in
        terms of the part ordering.

        This call does nothing (and returns False) if the current top
        part has no unallocated multiplicity.
Returns True if a new part has been created, and
        adjusts pstack, f and lpart as needed.
Returns True if a new part has been created and adjusts pstack f and lpart as needed .
def spread_part_multiplicity(self):
        """Returns True if a new part has been created, and
        adjusts pstack, f and lpart as needed.

        Notes
        =====

        Spreads unallocated multiplicity from the current top part
        into a new part created above the current on the stack.  This
        new part is constrained to be less than or equal to the old in
        terms of the part ordering.

        This call does nothing (and returns False) if the current top
        part has no unallocated multiplicity.

        """
        j = self.f[self.lpart]  # base of current top part
        k = self.f[self.lpart + 1]  # ub of current; potential base of next
        base = k  # save for later comparison

        changed = False  # Set to true when the new part (so far) is
                         # strictly less than (as opposed to less than
                         # or equal) to the old.
        for j in xrange(self.f[self.lpart], self.f[self.lpart + 1]):
            self.pstack[k].u = self.pstack[j].u - self.pstack[j].v
            if self.pstack[k].u == 0:
                changed = True
            else:
                self.pstack[k].c = self.pstack[j].c
                if changed:  # Put all available multiplicity in this part
                    self.pstack[k].v = self.pstack[k].u
                else:  # Still maintaining ordering constraint
                    if self.pstack[k].u < self.pstack[j].v:
                        self.pstack[k].v = self.pstack[k].u
                        changed = True
                    else:
                        self.pstack[k].v = self.pstack[j].v
                k = k + 1
        if k > base:
            # Adjust for the new part on stack
            self.lpart = self.lpart + 1
            self.f[self.lpart + 1] = k
            return True
        return False
def spread_part_multiplicity ( self ) : j = self . f [ self . lpart ] # base of current top part k = self . f [ self . lpart + 1 ] # ub of current; potential base of next base = k # save for later comparison changed = False # Set to true when the new part (so far) is # strictly less than (as opposed to less than # or equal) to the old. for j in xrange ( self . f [ self . lpart ] , self . f [ self . lpart + 1 ] ) : self . pstack [ k ] . u = self . pstack [ j ] . u - self . pstack [ j ] . v if self . pstack [ k ] . u == 0 : changed = True else : self . pstack [ k ] . c = self . pstack [ j ] . c if changed : # Put all available multiplicity in this part self . pstack [ k ] . v = self . pstack [ k ] . u else : # Still maintaining ordering constraint if self . pstack [ k ] . u < self . pstack [ j ] . v : self . pstack [ k ] . v = self . pstack [ k ] . u changed = True else : self . pstack [ k ] . v = self . pstack [ j ] . v k = k + 1 if k > base : # Adjust for the new part on stack self . lpart = self . lpart + 1 self . f [ self . lpart + 1 ] = k return True return False