Computes the child 'up' and 'down' arrays in O(n) based on the LCP table.

        Abouelhoda et al. (2004).

def _compute_childtab(self, lcptab):
        """Computes the child 'up' and 'down' arrays in O(n) based on the LCP table.

        Abouelhoda et al. (2004).
        """
        last_index = -1
        stack = [0]
        n = len(lcptab)
        childtab_up = np.zeros(n, dtype=np.int)  # Zeros / -1 ?
        childtab_down = np.zeros(n, dtype=np.int)
        for i in xrange(n):
            while lcptab[i] < lcptab[stack[-1]]:
                last_index = stack.pop()
                if lcptab[i] <= lcptab[stack[-1]] and lcptab[stack[-1]] != lcptab[last_index]:
                    childtab_down[stack[-1]] = last_index
            if last_index != -1:
                childtab_up[i] = last_index
                last_index = -1
            stack.append(i)
        return childtab_up, childtab_down