Skip to content

Commit

Permalink
Add Primitive property to GenericGF
Browse files Browse the repository at this point in the history
Add Primitive property to GenericGF
  • Loading branch information
Sonic-The-Hedgehog-LNK1123 authored Mar 22, 2019
1 parent 9447b6d commit cd9dad6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
15 changes: 12 additions & 3 deletions ReedSolomon/GenericGF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace STH1123.ReedSolomon
/// <summary>
/// <p>This class contains utility methods for performing mathematical operations over
/// the Galois Fields. Operations use a given primitive polynomial in calculations.</p>
/// <p>Throughout this package, elements of the GF are represented as an {@code int}
/// <p>Throughout this package, elements of the GF are represented as an <see cref="Int32"/>
/// for convenience and speed (but at the cost of memory).
/// </p>
/// </summary>
Expand Down Expand Up @@ -80,7 +80,7 @@ public sealed class GenericGF
/// Create a representation of GF(size) using the given primitive polynomial.
/// </summary>
/// <param name="primitive">irreducible polynomial whose coefficients are represented by
/// the bits of an int, where the least-significant bit represents the constant
/// the bits of an <see cref="Int32"/>, where the least-significant bit represents the constant
/// coefficient</param>
/// <param name="size">the size of the field</param>
/// <param name="genBase">the factor b in the generator polynomial can be 0- or 1-based
Expand All @@ -97,7 +97,7 @@ public GenericGF(int primitive, int size, int genBase)
/// Create a representation of GF(size) using the given primitive polynomial.
/// </summary>
/// <param name="primitive">irreducible polynomial whose coefficients are represented by
/// the bits of an int, where the least-significant bit represents the constant
/// the bits of an <see cref="Int32"/>, where the least-significant bit represents the constant
/// coefficient</param>
/// <param name="size">the size of the field</param>
/// <param name="genBase">the factor b in the generator polynomial can be 0- or 1-based
Expand Down Expand Up @@ -225,6 +225,15 @@ internal int multiply(int a, int b)
return expTable[(logTable[a] + logTable[b]) % (size - 1)];
}

/// <summary>
/// Gets the primitive polynomial as an <see cref="Int32"/>.
/// </summary>
public int Primitive
{
// Property added by Sonic-The-Hedgehog-LNK1123 (github.com/Sonic-The-Hedgehog-LNK1123)
get { return primitive; }
}

/// <summary>
/// Gets the size.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion ReedSolomon/GenericGFPoly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal sealed class GenericGFPoly
/// <summary>
/// Initializes a new instance of the <see cref="GenericGFPoly"/> class.
/// </summary>
/// <param name="field">the {@link GenericGF} instance representing the field to use
/// <param name="field">the <see cref="GenericGF"/> instance representing the field to use
/// to perform computations</param>
/// <param name="coefficients">coefficients as ints representing elements of GF(size), arranged
/// from most significant (highest-power term) coefficient to least significant</param>
Expand Down
4 changes: 2 additions & 2 deletions ReedSolomon/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]

[assembly: CLSCompliant(true)]

0 comments on commit cd9dad6

Please sign in to comment.