Ejemplo n.º 1
0
        /// <summary>
        /// Compare this element with another object
        /// </summary>
        ///
        /// <param name="Obj">The object for comprison</param>
        ///
        /// <returns>Returns <c>true</c> if the two objects are equal, <c>false</c> otherwise</returns>
        public override bool Equals(Object Obj)
        {
            if (Obj == null || !(Obj is PolynomialGF2mSmallM))
            {
                return(false);
            }

            PolynomialGF2mSmallM p = (PolynomialGF2mSmallM)Obj;

            if ((_field.Equals(p._field)) && (_degree.Equals(p._degree)) && (Compare.AreEqual(_coefficients, p._coefficients)))
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Compare this vector with another object
        /// </summary>
        ///
        /// <param name="Obj">The object for comparison</param>
        ///
        /// <returns>The result of the comparison</returns>
        public override bool Equals(Object Obj)
        {
            if (!(Obj is GF2mVector))
            {
                return(false);
            }

            GF2mVector otherVec = (GF2mVector)Obj;

            if (!_field.Equals(otherVec.Field))
            {
                return(false);
            }

            return(Compare.AreEqual(IntArrayForm, otherVec.IntArrayForm));
        }