'Get real and complex roots of a composite polynomial.'

@classmethod
def _all_roots(cls, poly):

    (_, factors) = poly.factor_list()
    reals = cls._get_reals(factors)
    reals = cls._reals_sorted(reals)
    reals_count = cls._count_roots(reals)
    roots = []
    for index in range(0, reals_count):
        roots.append(cls._reals_index(reals, index))
    complexes = cls._get_complexes(factors)
    complexes = cls._complexes_sorted(complexes)
    complexes_count = cls._count_roots(complexes)
    for index in range(0, complexes_count):
        roots.append(cls._complexes_index(complexes, index))
    return roots
