Ejemplo n.º 1
0
def install_table(table):
    ispec_tbl.ispec_mul_table = copy.copy(table)
    ispec_tbl.ispec_inv_table = []
    n = len(table)

    # Populate the inv table.
    # I am being crass here.  I'm assuming the Cayley table is good before I start.
    # The good news is that the is-group functions don't use the inv table.
    G = []
    for i in range(0, n):
        G.append(ispec_t(i))
    [found, e] = sackgrp.find_id(G)
    if (found):
        for i in range(0, n):
            x = G[i]
            for j in range(0, n):
                y = G[j]
                z = x * y
                if (z.code == e.code):
                    ispec_tbl.ispec_inv_table.append(j)
                    continue
Ejemplo n.º 2
0
def install_table(table):
	ispec_tbl.ispec_mul_table = copy.copy(table)
	ispec_tbl.ispec_inv_table = []
	n = len(table)

	# Populate the inv table.
	# I am being crass here.  I'm assuming the Cayley table is good before I start.
	# The good news is that the is-group functions don't use the inv table.
	G = []
	for i in range(0, n):
		G.append(ispec_t(i))
	[found, e] = sackgrp.find_id(G)
	if (found):
		for i in range(0, n):
			x = G[i]
			for j in range(0, n):
				y = G[j]
				z = x*y
				if (z.code == e.code):
					ispec_tbl.ispec_inv_table.append(j)
					continue
Ejemplo n.º 3
0
def install_table(cayley_table_with_names):
	spec_tables.mul_table  = []
	spec_tables.inv_table  = []
	spec_tables.name_table = []
	n = len(cayley_table_with_names)

	# Populate the name table
	spec_tables.name_table = copy.copy(cayley_table_with_names[0])

	# Populate the mul table.
	#
	# I should do some checking on the cayley_table_with_names -- the user
	# might have given me input which is non-square, or even ragged.

	# Fill it with zeroes, so the matrix has the correct size and may be indexed.
	row = [1] * n
	for i in range(0, n):
		spec_tables.mul_table.append(copy.copy(row))

	# Now put real data in.
	for i in range(0, n):
		for j in range(0, n):
			spec_tables.mul_table[i][j] = name_to_index_or_die(cayley_table_with_names[i][j], spec_tables.name_table)

	# Populate the inv table.
	# I am being crass here.  I'm assuming the Cayley table is good before I start.
	# The good news is that the is-group functions don't use the inv table.
	G = []
	for i in range(0, n):
		G.append(spec_t(i))
	[found, e] = sackgrp.find_id(G)
	if (found):
		for i in range(0, n):
			x = G[i]
			for j in range(0, n):
				y = G[j]
				z = x*y
				if (z.code == e.code):
					spec_tables.inv_table.append(j)
					continue