(factors, K, eps=None, inf=None, sup=None, strict=False, basis=False, fast=False)
return I_neg, I_pos
Isolate real roots of a list of polynomials and disjoin intervals.
Isolate real roots of a list of polynomials and disjoin intervals.
Isolate real roots of a list of polynomials and disjoin intervals .
def _real_isolate_and_disjoin(factors, K, eps=None, inf=None, sup=None, strict=False, basis=False, fast=False):
    """Isolate real roots of a list of polynomials and disjoin intervals. """
    I_pos, I_neg = [], []

    for i, (f, k) in enumerate(factors):
        for F, M in dup_inner_isolate_positive_roots(f, K, eps=eps, inf=inf, sup=sup, fast=fast, mobius=True):
            I_pos.append((F, M, k, f))

        for G, N in dup_inner_isolate_negative_roots(f, K, eps=eps, inf=inf, sup=sup, fast=fast, mobius=True):
            I_neg.append((G, N, k, f))

    for i, (f, M, k, F) in enumerate(I_pos):
        for j, (g, N, m, G) in enumerate(I_pos[i + 1:]):
            while not _disjoint_p(M, N, strict=strict):
                f, M = dup_inner_refine_real_root(f, M, K, steps=1, fast=fast, mobius=True)
                g, N = dup_inner_refine_real_root(g, N, K, steps=1, fast=fast, mobius=True)

            I_pos[i + j + 1] = (g, N, m, G)

        I_pos[i] = (f, M, k, F)

    for i, (f, M, k, F) in enumerate(I_neg):
        for j, (g, N, m, G) in enumerate(I_neg[i + 1:]):
            while not _disjoint_p(M, N, strict=strict):
                f, M = dup_inner_refine_real_root(f, M, K, steps=1, fast=fast, mobius=True)
                g, N = dup_inner_refine_real_root(g, N, K, steps=1, fast=fast, mobius=True)

            I_neg[i + j + 1] = (g, N, m, G)

        I_neg[i] = (f, M, k, F)

    if strict:
        for i, (f, M, k, F) in enumerate(I_neg):
            if not M[0]:
                while not M[0]:
                    f, M = dup_inner_refine_real_root(f, M, K, steps=1, fast=fast, mobius=True)

                I_neg[i] = (f, M, k, F)
                break

        for j, (g, N, m, G) in enumerate(I_pos):
            if not N[0]:
                while not N[0]:
                    g, N = dup_inner_refine_real_root(g, N, K, steps=1, fast=fast, mobius=True)

                I_pos[j] = (g, N, m, G)
                break

    field = K.get_field()

    I_neg = [ (_mobius_to_interval(M, field), k, f) for (_, M, k, f) in I_neg ]
    I_pos = [ (_mobius_to_interval(M, field), k, f) for (_, M, k, f) in I_pos ]

    if not basis:
        I_neg = [ ((-v, -u), k) for ((u, v), k, _) in I_neg ]
        I_pos = [ (( u, v), k) for ((u, v), k, _) in I_pos ]
    else:
        I_neg = [ ((-v, -u), k, f) for ((u, v), k, f) in I_neg ]
        I_pos = [ (( u, v), k, f) for ((u, v), k, f) in I_pos ]

    return I_neg, I_pos
def _real_isolate_and_disjoin ( factors , K , eps = None , inf = None , sup = None , strict = False , basis = False , fast = False ) : I_pos , I_neg = [ ] , [ ] for i , ( f , k ) in enumerate ( factors ) : for F , M in dup_inner_isolate_positive_roots ( f , K , eps = eps , inf = inf , sup = sup , fast = fast , mobius = True ) : I_pos . append ( ( F , M , k , f ) ) for G , N in dup_inner_isolate_negative_roots ( f , K , eps = eps , inf = inf , sup = sup , fast = fast , mobius = True ) : I_neg . append ( ( G , N , k , f ) ) for i , ( f , M , k , F ) in enumerate ( I_pos ) : for j , ( g , N , m , G ) in enumerate ( I_pos [ i + 1 : ] ) : while not _disjoint_p ( M , N , strict = strict ) : f , M = dup_inner_refine_real_root ( f , M , K , steps = 1 , fast = fast , mobius = True ) g , N = dup_inner_refine_real_root ( g , N , K , steps = 1 , fast = fast , mobius = True ) I_pos [ i + j + 1 ] = ( g , N , m , G ) I_pos [ i ] = ( f , M , k , F ) for i , ( f , M , k , F ) in enumerate ( I_neg ) : for j , ( g , N , m , G ) in enumerate ( I_neg [ i + 1 : ] ) : while not _disjoint_p ( M , N , strict = strict ) : f , M = dup_inner_refine_real_root ( f , M , K , steps = 1 , fast = fast , mobius = True ) g , N = dup_inner_refine_real_root ( g , N , K , steps = 1 , fast = fast , mobius = True ) I_neg [ i + j + 1 ] = ( g , N , m , G ) I_neg [ i ] = ( f , M , k , F ) if strict : for i , ( f , M , k , F ) in enumerate ( I_neg ) : if not M [ 0 ] : while not M [ 0 ] : f , M = dup_inner_refine_real_root ( f , M , K , steps = 1 , fast = fast , mobius = True ) I_neg [ i ] = ( f , M , k , F ) break for j , ( g , N , m , G ) in enumerate ( I_pos ) : if not N [ 0 ] : while not N [ 0 ] : g , N = dup_inner_refine_real_root ( g , N , K , steps = 1 , fast = fast , mobius = True ) I_pos [ j ] = ( g , N , m , G ) break field = K . get_field ( ) I_neg = [ ( _mobius_to_interval ( M , field ) , k , f ) for ( _ , M , k , f ) in I_neg ] I_pos = [ ( _mobius_to_interval ( M , field ) , k , f ) for ( _ , M , k , f ) in I_pos ] if not basis : I_neg = [ ( ( - v , - u ) , k ) for ( ( u , v ) , k , _ ) in I_neg ] I_pos = [ ( ( u , v ) , k ) for ( ( u , v ) , k , _ ) in I_pos ] else : I_neg = [ ( ( - v , - u ) , k , f ) for ( ( u , v ) , k , f ) in I_neg ] I_pos = [ ( ( u , v ) , k , f ) for ( ( u , v ) , k , f ) in I_pos ] return I_neg , I_pos