Beispiel #1
0
        /// <summary>
        /// Overrided method GetHashCoed
        /// </summary>
        /// <returns>Hash code of instance</returns>
        public override int GetHashCode()
        {
            if (Coefficients == null)
            {
                return(0);
            }

            double result   = 0;
            int    hashCoef = 11;

            for (int i = 0; i < Coefficients.Length; i++)
            {
                result += Coefficients[i] * Math.Pow(hashCoef, Degree - i);
            }

            return((int)(result * VariableSymbol.GetHashCode()));
        }