• R/O
  • SSH

Commit

Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A small kernel of code for playing with Galois fields of arbitrary characteristic


Commit MetaInfo

Revision04d1d84758fa34787698a919567bdc9df96ddf84 (tree)
Time2016-05-01 11:08:07
AuthorEric Hopper <hopper@omni...>
CommiterEric Hopper

Log Message

Utilities for working with Galois fields.

Change Summary

Incremental Difference

diff -r 0cf2cba15681 -r 04d1d84758fa gfutil.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gfutil.py Sat Apr 30 22:08:07 2016 -0400
@@ -0,0 +1,16 @@
1+# <gf.gfMeta(5, (1, 4, 1, 4, 1, 4, 1))((0, 0, 0, 0, 1, 3))>
2+
3+def gen_groups(l, prime):
4+ size = len(l)
5+ yield (0,)
6+ members = set((0,))
7+ for i in range(0, len(l)):
8+ if i in members:
9+ continue
10+ group = []
11+ member = i
12+ while member not in group:
13+ group.append(member)
14+ members.add(member)
15+ member = member * prime % size
16+ yield tuple(group)