Formall.MySql/branches/WebSiteWithPresentation/QrCode/ReedSolomon/Polynomial.cs
/// <summary>
/// Multiply current Polynomial to anotherone. 
/// </summary>
/// <returns>Result polynomial after multiply</returns>
Multiply current Polynomial to anotherone.
Multiply current Polynomial to anotherone .
internal Polynomial Multiply(Polynomial other)
		{
			if(this.Primitive != other.Primitive)
			{
				throw new ArgumentException("Polynomial can not perform Multiply as they don't have same Primitive for GaloisField256");
			}
			if(this.isMonomialZero || other.isMonomialZero)
				return new Polynomial(this.GField, new int[]{0});
			int[] aCoefficients = this.Coefficients;
			int aLength = aCoefficients.Length;
			int[] bCoefficient = other.Coefficients;
			int bLength = bCoefficient.Length;
			int[] rCoefficients = new int[aLength + bLength - 1];
			for(int aIndex = 0; aIndex < aLength; aIndex++)
			{
				int aCoeff = aCoefficients[aIndex];
				for(int bIndex = 0; bIndex < bLength; bIndex++)
				{
					rCoefficients[aIndex + bIndex] = 
						this.GField.Addition(rCoefficients[aIndex + bIndex], this.GField.Product(aCoeff, bCoefficient[bIndex]));
				}
			}
			return new Polynomial(this.GField, rCoefficients);
		}
internal Polynomial Multiply ( Polynomial other ) { if ( this . Primitive != other . Primitive ) { throw new ArgumentException ( " " ) ; } if ( this . isMonomialZero || other . isMonomialZero ) return new Polynomial ( this . GField , new int [ ] { 0 } ) ; int [ ] aCoefficients = this . Coefficients ; int aLength = aCoefficients . Length ; int [ ] bCoefficient = other . Coefficients ; int bLength = bCoefficient . Length ; int [ ] rCoefficients = new int [ aLength + bLength - 1 ] ; for ( int aIndex = 0 ; aIndex < aLength ; aIndex ++ ) { int aCoeff = aCoefficients [ aIndex ] ; for ( int bIndex = 0 ; bIndex < bLength ; bIndex ++ ) { rCoefficients [ aIndex + bIndex ] = this . GField . Addition ( rCoefficients [ aIndex + bIndex ] , this . GField . Product ( aCoeff , bCoefficient [ bIndex ] ) ) ; } } return new Polynomial ( this . GField , rCoefficients ) ; }
Multiply current Polynomial to anotherone.
Multiply current Polynomial to anotherone .
Result polynomial after multiply
Result polynomial after multiply
other
Polynomial