iTextSharp.text.pdf.qrcode.GF256Poly.Multiply C# (CSharp) Метод

Multiply() приватный Метод

private Multiply ( GF256Poly other ) : GF256Poly
other GF256Poly
Результат GF256Poly
        internal GF256Poly Multiply(GF256Poly other) {
            if (!field.Equals(other.field)) {
                throw new ArgumentException("GF256Polys do not have same GF256 field");
            }
            if (IsZero() || other.IsZero()) {
                return field.GetZero();
            }
            int[] aCoefficients = this.coefficients;
            int aLength = aCoefficients.Length;
            int[] bCoefficients = other.coefficients;
            int bLength = bCoefficients.Length;
            int[] product = new int[aLength + bLength - 1];
            for (int i = 0; i < aLength; i++) {
                int aCoeff = aCoefficients[i];
                for (int j = 0; j < bLength; j++) {
                    product[i + j] = GF256.AddOrSubtract(product[i + j],
                        field.Multiply(aCoeff, bCoefficients[j]));
                }
            }
            return new GF256Poly(field, product);
        }

Same methods

GF256Poly::Multiply ( int scalar ) : GF256Poly

Usage Example

Пример #1
0
 private GF256Poly BuildGenerator(int degree)
 {
     if (degree >= cachedGenerators.Count)
     {
         GF256Poly lastGenerator = cachedGenerators[cachedGenerators.Count - 1];
         for (int d = cachedGenerators.Count; d <= degree; d++)
         {
             GF256Poly nextGenerator = lastGenerator.Multiply(new GF256Poly(field, new int[] { 1, field.Exp(d - 1) }));
             cachedGenerators.Add(nextGenerator);
             lastGenerator = nextGenerator;
         }
     }
     return(cachedGenerators[degree]);
 }