示例#1
0
# ----------------------------------------------------------------
s = pmtc_tm.from_cycle([1, 2, 3], 6)
ct = s.cycle_type()
print s, ct
s = pmtc_tm.from_cycles([[1, 2, 3], [4, 5]], 6)
ct = s.cycle_type()
print s, ct
s = pmtc_tm.from_cycles([[1, 2], [3], [4, 5]], 6)
ct = s.cycle_type()
print s, ct
print

print "random pmtcs:"
for i in range(0, 10):
    pi = pmtc_tm.rand_pmtc(4)
    print pi
print

print "random pmtis:"
for i in range(0, 10):
    pi = pmti_tm.rand_pmti(4)
    print pi
print

print "random pmtcs:"
for i in range(0, 10):
    pi = pmtc_tm.rand_pmtc(20)
    ct = pi.cycle_type()
    print pi, ct
print
示例#2
0
# ================================================================
# This software is released under the terms of the GNU GPL.
# Please see LICENSE.txt in the same directory as this file.
# John Kerl
# [email protected]
# 2007-05-31
# ================================================================

import sys, copy
import pmtc_tm
import pmti_tm

#count=80000
count = 100000
#N=100
N = 6
do_bad = False
if len(sys.argv) >= 2:
    N = int(sys.argv[1])
if len(sys.argv) == 3:
    do_bad = True

for i in range(0, count):
    if do_bad:
        pi = pmtc_tm.bad_rand_pmtc(N)
    else:
        pi = pmtc_tm.rand_pmtc(N)
    #ct = pi.cycle_type()
    #print ct
    print pi
示例#3
0
# ================================================================
# Please see LICENSE.txt in the same directory as this file.
# John Kerl
# [email protected]
# 2007-05-31
# ================================================================

import sys,copy
import pmtc_tm
import pmti_tm

#count=80000
count=100000
#N=100
N=6
do_bad = False
if len(sys.argv) >= 2:
	N = int(sys.argv[1])
if len(sys.argv) == 3:
	do_bad = True

for i in range(0, count):
	if do_bad:
		pi = pmtc_tm.bad_rand_pmtc(N)
	else:
		pi = pmtc_tm.rand_pmtc(N)
	#ct = pi.cycle_type()
	#print ct
	print pi
示例#4
0
print s

s = pmti_tm.from_cycles([[1,2,3],[4,5]], 6)
print s
s = pmti_tm.from_cycle([1,2,3], 6)
print s

# ----------------------------------------------------------------
s = pmtc_tm.from_cycle([1,2,3], 6); ct = s.cycle_type(); print s, ct
s = pmtc_tm.from_cycles([[1,2,3],[4,5]], 6); ct = s.cycle_type(); print s, ct
s = pmtc_tm.from_cycles([[1,2],[3],[4,5]], 6); ct = s.cycle_type(); print s, ct
print

print "random pmtcs:"
for i in range(0, 10):
	pi = pmtc_tm.rand_pmtc(4)
	print pi
print

print "random pmtis:"
for i in range(0, 10):
	pi = pmti_tm.rand_pmti(4)
	print pi
print


print "random pmtcs:"
for i in range(0, 10):
	pi = pmtc_tm.rand_pmtc(20)
	ct = pi.cycle_type()
	print pi, ct