Formall.MySql/branches/WebSiteWithPresentation/QrCode/ReedSolomon/Polynomial.cs
/// <summary>
/// Add another Polynomial to current one
/// </summary>
/// <param name="other">The polynomial need to add or subtract to current one</param>
/// <returns>Result polynomial after add or subtract</returns>
Add another Polynomial to current one
Add another Polynomial to current one
internal Polynomial AddOrSubtract(Polynomial other)
		{
			if(this.Primitive != other.Primitive)
			{
				throw new ArgumentException("Polynomial can not perform AddOrSubtract as they don't have same Primitive for GaloisField256");
			}
			if(this.isMonomialZero)
				return other;
			else if(other.isMonomialZero)
				return this;
			int otherLength = other.Coefficients.Length;
			int thisLength = this.Coefficients.Length;
			if(otherLength > thisLength)
				return CoefficientXor(this.Coefficients, other.Coefficients);
			else
				return CoefficientXor(other.Coefficients, this.Coefficients);
		}
internal Polynomial AddOrSubtract ( Polynomial other ) { if ( this . Primitive != other . Primitive ) { throw new ArgumentException ( " " ) ; } if ( this . isMonomialZero ) return other ; else if ( other . isMonomialZero ) return this ; int otherLength = other . Coefficients . Length ; int thisLength = this . Coefficients . Length ; if ( otherLength > thisLength ) return CoefficientXor ( this . Coefficients , other . Coefficients ) ; else return CoefficientXor ( other . Coefficients , this . Coefficients ) ; }
Add another Polynomial to current one
Add another Polynomial to current one
Result polynomial after add or subtract
Result polynomial after add or subtract
other
Polynomial
The polynomial need to add or subtract to current one
The polynomial need to add or subtract to current one