From cd9dad631ebfff23d57e3853b6357f25ae28cf95 Mon Sep 17 00:00:00 2001 From: Sonic-The-Hedgehog-LNK1123 <46045820+Sonic-The-Hedgehog-LNK1123@users.noreply.github.com> Date: Fri, 22 Mar 2019 20:19:39 +0100 Subject: [PATCH] Add Primitive property to GenericGF Add Primitive property to GenericGF --- ReedSolomon/GenericGF.cs | 15 ++++++++++++--- ReedSolomon/GenericGFPoly.cs | 2 +- ReedSolomon/Properties/AssemblyInfo.cs | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ReedSolomon/GenericGF.cs b/ReedSolomon/GenericGF.cs index 3fd392c..ada7b10 100644 --- a/ReedSolomon/GenericGF.cs +++ b/ReedSolomon/GenericGF.cs @@ -22,7 +22,7 @@ namespace STH1123.ReedSolomon /// ///

This class contains utility methods for performing mathematical operations over /// the Galois Fields. Operations use a given primitive polynomial in calculations.

- ///

Throughout this package, elements of the GF are represented as an {@code int} + ///

Throughout this package, elements of the GF are represented as an /// for convenience and speed (but at the cost of memory). ///

///
@@ -80,7 +80,7 @@ public sealed class GenericGF /// Create a representation of GF(size) using the given primitive polynomial. /// /// irreducible polynomial whose coefficients are represented by - /// the bits of an int, where the least-significant bit represents the constant + /// the bits of an , where the least-significant bit represents the constant /// coefficient /// the size of the field /// the factor b in the generator polynomial can be 0- or 1-based @@ -97,7 +97,7 @@ public GenericGF(int primitive, int size, int genBase) /// Create a representation of GF(size) using the given primitive polynomial. /// /// irreducible polynomial whose coefficients are represented by - /// the bits of an int, where the least-significant bit represents the constant + /// the bits of an , where the least-significant bit represents the constant /// coefficient /// the size of the field /// the factor b in the generator polynomial can be 0- or 1-based @@ -225,6 +225,15 @@ internal int multiply(int a, int b) return expTable[(logTable[a] + logTable[b]) % (size - 1)]; } + /// + /// Gets the primitive polynomial as an . + /// + public int Primitive + { + // Property added by Sonic-The-Hedgehog-LNK1123 (github.com/Sonic-The-Hedgehog-LNK1123) + get { return primitive; } + } + /// /// Gets the size. /// diff --git a/ReedSolomon/GenericGFPoly.cs b/ReedSolomon/GenericGFPoly.cs index eb4ce1f..807992f 100644 --- a/ReedSolomon/GenericGFPoly.cs +++ b/ReedSolomon/GenericGFPoly.cs @@ -36,7 +36,7 @@ internal sealed class GenericGFPoly /// /// Initializes a new instance of the class. /// - /// the {@link GenericGF} instance representing the field to use + /// the instance representing the field to use /// to perform computations /// coefficients as ints representing elements of GF(size), arranged /// from most significant (highest-power term) coefficient to least significant diff --git a/ReedSolomon/Properties/AssemblyInfo.cs b/ReedSolomon/Properties/AssemblyInfo.cs index 337187d..baf7486 100644 --- a/ReedSolomon/Properties/AssemblyInfo.cs +++ b/ReedSolomon/Properties/AssemblyInfo.cs @@ -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)]