Ejemplo n.º 1
0
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>A 32-bit signed integer hash code.</returns>
 public override int GetHashCode()
 {
     return(MinX.GetHashCode() ^
            MaxX.GetHashCode() ^
            MinY.GetHashCode() ^
            MaxY.GetHashCode() ^
            MinZ.GetHashCode() ^
            MaxZ.GetHashCode());
 }
Ejemplo n.º 2
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = Center.GetHashCode();
         hashCode = (hashCode * 397) ^ RadiusX.GetHashCode();
         hashCode = (hashCode * 397) ^ RadiusY.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 3
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = TopLeft.GetHashCode();
         hashCode = (hashCode * 397) ^ Width.GetHashCode();
         hashCode = (hashCode * 397) ^ Height.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 4
0
        private static int GetIdentityHashCode()
        {
            // This code is called only once.
            Float zero = 0;
            Float one  = 1;

            // return zero.GetHashCode() ^ zero.GetHashCode() ^ zero.GetHashCode() ^ one.GetHashCode();
            // But this expression can be simplified because the first two hash codes cancel.
            return(zero.GetHashCode() ^ one.GetHashCode());
        }
Ejemplo n.º 5
0
        internal Value(System.Single value, Parameterization p = Parameterization.Value)
            : base(value)
        {
            Original  = value;
            _clrType  = typeof(System.Single);
            _hashCode = GetCrossTypeHashCode(_clrType, value.GetHashCode());

            Build = (buildContext, buildArgs) =>
            {
                return((p != Parameterization.None) ? (value.Parameterize(buildContext, p) ?? Mapping.BuildCast(value)) : Mapping.BuildCast(value));
            };
        }
Ejemplo n.º 6
0
        static StackObject *GetHashCode_4(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Single instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);

            var result_of_this_method = instance_of_this_method.GetHashCode();

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method;
            return(__ret + 1);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>A 32-bit signed integer hash code.</returns>
 public override int GetHashCode()
 {
     return(Mode.GetHashCode() ^
            Mu.GetHashCode() ^
            Mu2.GetHashCode() ^
            Rho.GetHashCode() ^
            Rho2.GetHashCode() ^
            RhoN.GetHashCode() ^
            Bounce.GetHashCode() ^
            BounceVelocity.GetHashCode() ^
            SoftErp.GetHashCode() ^
            SoftCfm.GetHashCode() ^
            Motion1.GetHashCode() ^
            Motion2.GetHashCode() ^
            MotionN.GetHashCode() ^
            Slip1.GetHashCode() ^
            Slip2.GetHashCode());
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Gets the Measure object hash code
 /// </summary>
 /// <returns>Hash code of this object</returns>
 public override int GetHashCode()
 {
     return(mAmount.GetHashCode());
 }
Ejemplo n.º 9
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode()
 {
     return(x.GetHashCode() ^ y.GetHashCode() ^ z.GetHashCode());
 }
Ejemplo n.º 10
0
 public override int GetHashCode()
 {
     return((X.GetHashCode()) ^ (Y.GetHashCode() << 2) ^ (Z.GetHashCode() >> 2));
 }
Ejemplo n.º 11
0
 public override int GetHashCode()
 {
     return(Normal.GetHashCode() ^ D.GetHashCode());
 }
    public virtual bool runTest()
    {
        int iCountErrors    = 0;
        int iCountTestcases = 0;

        System.String strCheckpoint = "CHECKPOINT";
        System.Console.Out.Write(strName);
        System.Console.Out.Write(": ");
        System.Console.Out.Write(s_strTFName);
        System.Console.Out.WriteLine(" runTest started...");
        System.Single wrSingle = (1.0f);
        iCountTestcases++;
        System.Console.Out.WriteLine("GetHashCode:	Verify Single object hash code");
        if (wrSingle.GetHashCode() != GetExpectedHashCode(wrSingle))
        {
            System.Console.Error.Write("GetHashCode error: ");
            System.Console.Error.Write("Expected Result = <");
            System.Console.Error.Write(Math.Abs((int)wrSingle));
            System.Console.Error.Write("> ");
            System.Console.Error.Write("Returned Result = <");
            System.Console.Error.Write(wrSingle.GetHashCode());
            System.Console.Error.Write("> ");
            iCountErrors |= 0x01;
        }
        wrSingle = Single.Epsilon;
        iCountTestcases++;
        if (wrSingle.GetHashCode() != GetExpectedHashCode(wrSingle))
        {
            System.Console.Error.Write("GetHashCode error: ");
            System.Console.Error.Write("Expected Result = <");
            System.Console.Error.Write(Math.Abs((int)wrSingle));
            System.Console.Error.Write("> ");
            System.Console.Error.Write("Returned Result = <");
            System.Console.Error.Write(wrSingle.GetHashCode());
            System.Console.Error.Write("> ");
            iCountErrors |= 0x01;
        }
        wrSingle = Single.NaN;
        iCountTestcases++;
        if (wrSingle.GetHashCode() != GetExpectedHashCode(wrSingle))
        {
            System.Console.Error.Write("GetHashCode error: ");
            System.Console.Error.Write("Expected Result = <");
            System.Console.Error.Write(Math.Abs((int)wrSingle));
            System.Console.Error.Write("> ");
            System.Console.Error.Write("Returned Result = <");
            System.Console.Error.Write(wrSingle.GetHashCode());
            System.Console.Error.Write("> ");
            iCountErrors |= 0x01;
        }
        System.Console.Error.Write(strName);
        System.Console.Error.Write(": ");
        System.Console.Error.Write(s_strTFName);
        System.Console.Error.Write(" ");
        System.Console.Error.Write("iCountErrors==");
        System.Console.Error.WriteLine(iCountErrors);
        if (iCountErrors == 0)
        {
            Console.WriteLine("paSs. " + s_strTFName + " ,iCountTestcases==" + iCountTestcases.ToString());
            return(true);
        }
        else
        {
            Console.WriteLine("FAiL! " + s_strTFName + " ,iCountErrors==" + iCountErrors.ToString());
            return(false);
        }
    }
Ejemplo n.º 13
0
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>A 32-bit signed integer hash code.</returns>
 public override int GetHashCode()
 {
     return(X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode() ^ W.GetHashCode());
 }
Ejemplo n.º 14
0
 public override int GetHashCode()
 {
     return(X.GetHashCode() + Y.GetHashCode());
 }
Ejemplo n.º 15
0
 public override int GetHashCode()
 {
     return(HashCoder.GetHash(Size.GetHashCode(), Name.GetHashCode(), ((int)Style).GetHashCode()));
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>A 32-bit signed integer hash code.</returns>
 public override int GetHashCode()
 {
     return(TotalMass.GetHashCode() ^ Center.GetHashCode() ^ Inertia.GetHashCode());
 }