Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## reedSolomon
Class GaloisField

    java.lang.Object
      reedSolomon.GaloisField

All Implemented Interfaces:
  iField

    public class GaloisField

extends java.lang.Object
implements iField

This class provides way to perform arithmetics over finite fields. Basic operations supported are addition, substraction, multiplication and division. This is implementation of Galois fields of size 2^w. Therefore addition and substraction of two numbers are implemented as xoring of two numbers. To multiply and divide numbers logarithmic tables are used. Size of this tables is equal to number of elements in field and directly affects memory requirements of class.

See Also:
  `iField`

Constructor Summary
`GaloisField(int w)` Constructor creates Galois filed of size 2^w were w is passed as argument.

Method Summary
`int` | `add(int a, int b)` Performs addtion of two numbers.
`int` | `divide(int a, int b)` Performs division on two numbers.
`int` | `multiply(int a, int b)` Performs multiplication of two numbers.
`void` | `printTables()` Prints logarithmic tables.
`int` | `substract(int a, int b)` Performs substraction of two numbers.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### GaloisField

    public GaloisField(int w)

  Constructor creates Galois filed of size 2^w were w is passed as argument. Logarithmic tables are precomputed.

  Parameters:
    `w` - parameter used to determine size of field.

Method Detail

### printTables

    public void printTables()

  Prints logarithmic tables.

### add

    public int add(int a,
                   int b)

  Performs addtion of two numbers.

  Specified by:
    `add` in interface `iField`
  Parameters:
    `a` - first number
    `b` - second number
  Returns:
    result of a+b

### substract

    public int substract(int a,
                         int b)

  Performs substraction of two numbers.

  Specified by:
    `substract` in interface `iField`
  Parameters:
    `a` - first number
    `b` - second number
  Returns:
    result of a-b

### multiply

    public int multiply(int a,
                        int b)

  Performs multiplication of two numbers.

  Specified by:
    `multiply` in interface `iField`
  Parameters:
    `a` - first number
    `b` - second number
  Returns:
    result of a*b

### divide

    public int divide(int a,
                      int b)

  Performs division on two numbers.

  Specified by:
    `divide` in interface `iField`
  Parameters:
    `a` - first number
    `b` - second number
  Returns:
    result of a/b

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD