Angel \”Java\” Lopez on Blog

December 28, 2010

Presenting AjGroups: Finite Groups Library

Filed under: .NET, AjGroups, C Sharp, Open Source Projects — ajlopez @ 11:11 am

I was writing a C# class library to manage finite groups. A group is a set G of elements with a defined binary operation *, where:

a * b  is in G    (closure)

a * (b * c) = (a * b) * c        (associative)

a * a’ = e     (inverse and identity)

a * e = e * a   (identity)

The solution code is in my AjCodeKata Google Project, under trunk/AjGroups:

The key interfaces are:

IElement has a method Multiply, that receives another IElement and returns the result IElement. IElement.Order is the number of elements to be multiplied to get the identity:

a * a * a ….. * a = e

IGroup.Elements is the collection of IElements that are the elements of the group. IGroup.Order is the count of elements.

There are two implementations of that interfaces: one based on permutations, another based on named elements (such “a”, “e”) and a table describing their multiplications.

There are methods to:

- Get the subgroups of a group
- Get the normal subgroups of a group
- Answer if two groups are isomorphic

I followed TDD ideas during development. All tests in green:

Good code coverage:

I should make some refactoring, but the project is taking form. I will write posts describing the permutation implementation, and the abstract elements implementation.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

3 Comments »

  1. [...] my previous post I presented AjGroups, a class library written in C# that implements finite group concepts and [...]

    Pingback by Permutations in AjGroups « Angel “Java” Lopez on Blog — January 3, 2011 @ 9:30 am

  2. [...] Presenting AjGroups: Finite Groups Library Permutations in AjGroups [...]

    Pingback by Abstract Elements in AjGroups « Angel “Java” Lopez on Blog — January 5, 2011 @ 10:41 am

  3. [...] Presenting AjGroups: Finite Groups Library Permutations in AjGroups [...]

    Pingback by Elementos abstractos en AjGroups - Angel "Java" Lopez — January 6, 2011 @ 9:32 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Shocking Blue Green Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 57 other followers

%d bloggers like this: