 ### Fix examples in code documentation according to new normalization.

parent 107d4125
 ... @@ -253,10 +253,15 @@ def range_with_strategy(x0, x1, split=None, strategy=None, random_state=None): ... @@ -253,10 +253,15 @@ def range_with_strategy(x0, x1, split=None, strategy=None, random_state=None): continue continue if split: if split: print("x0=%x" % x0) print("x1=%x" % x1) print("i,n=(%d,%d)" % split) i,n = split i,n = split dx = x1 - x0 dx = x1 - x0 x1 = x0 + ((i + 1) * dx) // n x1 = x0 + ((i + 1) * dx) // n x0 = x0 + (i * dx) // n x0 = x0 + (i * dx) // n print("x0=%x" % x0) print("x1=%x" % x1) for ss in strategy.split(','): for ss in strategy.split(','): if ss == "random": if ss == "random": ... @@ -404,11 +409,11 @@ def chain_alternate_iterators(gp, gm, with_zero=False): ... @@ -404,11 +409,11 @@ def chain_alternate_iterators(gp, gm, with_zero=False): # promises. # promises. class CocksPinchVariantResult(object): class CocksPinchVariantResult(object): """ """ sage: C=CocksPinchVariantResult(6,3,34359607296,5,ht=0x101,hy=2,max_B1=1000) sage: C=CocksPinchVariantResult(6,3,34359607296,5,ht=0x101,hy=-2,max_B1=1000) sage: C.E2(factor=True)["text_factorization"] sage: C.E2(factor=True)["text_factorization"] '2^2 * 3 * 19 * 73 * 163 * 33637 * p48 * r' '2^2 * 3 * 19 * 73 * 163 * 33637 * p48 * r' sage: C=CocksPinchVariantResult(6,3,0x600100002,5,ht=0x428,hy=0x639,allowed_cofactor=420,max_B1=600) sage: C=CocksPinchVariantResult(6,3,0x600100002,5,ht=0x428,hy=-0x639,allowed_cofactor=420,max_B1=600) sage: C.is_small_subgroup_secure() sage: C.is_small_subgroup_secure() True True sage: C.is_twist_small_subgroup_secure() sage: C.is_twist_small_subgroup_secure() ... @@ -457,17 +462,17 @@ class CocksPinchVariantResult(object): ... @@ -457,17 +462,17 @@ class CocksPinchVariantResult(object): sage: (C.is_small_subgroup_secure(), C.is_twist_small_subgroup_secure(), C.is_G2_small_subgroup_secure(), C.is_twist_G2_small_subgroup_secure()) sage: (C.is_small_subgroup_secure(), C.is_twist_small_subgroup_secure(), C.is_G2_small_subgroup_secure(), C.is_twist_G2_small_subgroup_secure()) (True, True, True, True) (True, True, True, True) sage: C=CocksPinchVariantResult(6,3,0x600081000,1,ht=-0x191,hy=-0x7e2) sage: C=CocksPinchVariantResult(6,3,0x600081000,1,ht=-0x191,hy=0x7e2) sage: C.set_test_info(allowed_size_cofactor=10) sage: C.set_test_info(allowed_size_cofactor=10) sage: (C.is_small_subgroup_secure(), C.is_twist_small_subgroup_secure(), C.is_G2_small_subgroup_secure(), C.is_twist_G2_small_subgroup_secure()) sage: (C.is_small_subgroup_secure(), C.is_twist_small_subgroup_secure(), C.is_G2_small_subgroup_secure(), C.is_twist_G2_small_subgroup_secure()) (True, True, True, True) (True, True, True, True) sage: C=CocksPinchVariantResult(5,10000000147,0xe000000000008000,1,ht=3,hy=-0x11e36418c7c8b454,max_B1=600) sage: C=CocksPinchVariantResult(5,10000000147,0xe000000000008000,1,ht=3,hy=0x11e36418c7c8b454,max_B1=600) sage: C.set_test_info(allowed_size_cofactor=10) sage: C.set_test_info(allowed_size_cofactor=10) sage: (C.is_small_subgroup_secure(), C.is_twist_small_subgroup_secure(), C.is_G2_small_subgroup_secure(), C.is_twist_G2_small_subgroup_secure()) sage: (C.is_small_subgroup_secure(), C.is_twist_small_subgroup_secure(), C.is_G2_small_subgroup_secure(), C.is_twist_G2_small_subgroup_secure()) (True, True, True, True) (True, True, True, True) sage: C=CocksPinchVariantResult(6,3,0xfffffffffffffff00000000000000000,1,ht=0x43fff,hy=-0xffffffffff800007fffe,allowed_size_cofactor=10,max_B1=600) sage: C=CocksPinchVariantResult(6,3,0xfffffffffffffff00000000000000000,1,ht=0x43fff,hy=0xffffffffff800007fffe,allowed_size_cofactor=10,max_B1=600) sage: (C.is_small_subgroup_secure(), C.is_twist_small_subgroup_secure(), C.is_G2_small_subgroup_secure(), C.is_twist_G2_small_subgroup_secure()) sage: (C.is_small_subgroup_secure(), C.is_twist_small_subgroup_secure(), C.is_G2_small_subgroup_secure(), C.is_twist_G2_small_subgroup_secure()) (True, True, True, True) (True, True, True, True) ... @@ -487,11 +492,11 @@ class CocksPinchVariantResult(object): ... @@ -487,11 +492,11 @@ class CocksPinchVariantResult(object): sage: (C.is_small_subgroup_secure(), C.is_twist_small_subgroup_secure(), C.is_G2_small_subgroup_secure(), C.is_twist_G2_small_subgroup_secure()) sage: (C.is_small_subgroup_secure(), C.is_twist_small_subgroup_secure(), C.is_G2_small_subgroup_secure(), C.is_twist_G2_small_subgroup_secure()) (True, True, True, True) (True, True, True, True) sage: C=CocksPinchVariantResult(7,20,0x5ec7fc01ff8,4,ht=-3,hy=-1,allowed_size_cofactor=10,max_B1=600) sage: C=CocksPinchVariantResult(7,20,0x5ec7fc01ff8,4,ht=-3,hy=1,allowed_size_cofactor=10,max_B1=600) sage: (C.is_small_subgroup_secure(), C.is_twist_small_subgroup_secure(), C.is_G2_small_subgroup_secure(), C.is_twist_G2_small_subgroup_secure()) sage: (C.is_small_subgroup_secure(), C.is_twist_small_subgroup_secure(), C.is_G2_small_subgroup_secure(), C.is_twist_G2_small_subgroup_secure()) (True, True, False, False) (True, True, False, False) sage: C=CocksPinchVariantResult(8,4,0xffffffffffffffc0,1,ht=-0x1821f,hy=0x1fdc,allowed_cofactor=1232,allowed_size_cofactor=10,max_B1=600) sage: C=CocksPinchVariantResult(8,4,0xffffffffffffffc0,1,ht=-0x1821f,hy=-0x1fdc,allowed_cofactor=1232,allowed_size_cofactor=10,max_B1=600) sage: (C.is_small_subgroup_secure(), C.is_twist_small_subgroup_secure(), C.is_G2_small_subgroup_secure(), C.is_twist_G2_small_subgroup_secure()) sage: (C.is_small_subgroup_secure(), C.is_twist_small_subgroup_secure(), C.is_G2_small_subgroup_secure(), C.is_twist_G2_small_subgroup_secure()) (True, True, True, True) (True, True, True, True) ... ...