Exemplo n.º 1
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = M11.GetHashCode();
                hashCode = (hashCode * 397) ^ M12.GetHashCode();
                hashCode = (hashCode * 397) ^ M13.GetHashCode();
                hashCode = (hashCode * 397) ^ M14.GetHashCode();

                hashCode = (hashCode * 397) ^ M21.GetHashCode();
                hashCode = (hashCode * 397) ^ M22.GetHashCode();
                hashCode = (hashCode * 397) ^ M23.GetHashCode();
                hashCode = (hashCode * 397) ^ M24.GetHashCode();

                hashCode = (hashCode * 397) ^ M31.GetHashCode();
                hashCode = (hashCode * 397) ^ M32.GetHashCode();
                hashCode = (hashCode * 397) ^ M33.GetHashCode();
                hashCode = (hashCode * 397) ^ M34.GetHashCode();

                hashCode = (hashCode * 397) ^ M41.GetHashCode();
                hashCode = (hashCode * 397) ^ M42.GetHashCode();
                hashCode = (hashCode * 397) ^ M43.GetHashCode();
                hashCode = (hashCode * 397) ^ M44.GetHashCode();
                return(hashCode);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Returns the HashCode for this Matrix3D
 /// </summary>
 /// <returns>
 /// int - the HashCode for this Matrix3D
 /// </returns>
 public override int GetHashCode()
 {
     if (IsDistinguishedIdentity)
     {
         return(c_identityHashCode);
     }
     else
     {
         // Perform field-by-field XOR of HashCodes
         return(M11.GetHashCode() ^
                M12.GetHashCode() ^
                M13.GetHashCode() ^
                M14.GetHashCode() ^
                M21.GetHashCode() ^
                M22.GetHashCode() ^
                M23.GetHashCode() ^
                M24.GetHashCode() ^
                M31.GetHashCode() ^
                M32.GetHashCode() ^
                M33.GetHashCode() ^
                M34.GetHashCode() ^
                OffsetX.GetHashCode() ^
                OffsetY.GetHashCode() ^
                OffsetZ.GetHashCode() ^
                M44.GetHashCode());
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Get the hashcode for this <see cref="Matrix3D"/> instance.
 /// </summary>
 /// <returns>Returns the hash code for this <see cref="Matrix3D"/> instance.</returns>
 public override int     GetHashCode()
 {
     return
         (M11.GetHashCode() ^ M12.GetHashCode() ^ M13.GetHashCode() ^
          M21.GetHashCode() ^ M22.GetHashCode() ^ M23.GetHashCode() ^
          M31.GetHashCode() ^ M32.GetHashCode() ^ M33.GetHashCode());
 }
Exemplo n.º 4
0
        public override int GetHashCode()
        {
            // Overflow is fine, just wrap
            unchecked
            {
                int hash = 17;

                hash = hash * 29 + M00.GetHashCode();
                hash = hash * 29 + M01.GetHashCode();
                hash = hash * 29 + M02.GetHashCode();
                hash = hash * 29 + M03.GetHashCode();

                hash = hash * 29 + M10.GetHashCode();
                hash = hash * 29 + M11.GetHashCode();
                hash = hash * 29 + M12.GetHashCode();
                hash = hash * 29 + M13.GetHashCode();

                hash = hash * 29 + M20.GetHashCode();
                hash = hash * 29 + M21.GetHashCode();
                hash = hash * 29 + M22.GetHashCode();
                hash = hash * 29 + M23.GetHashCode();

                return(hash);
            }
        }
Exemplo n.º 5
0
 public override int GetHashCode()
 {
     return(M00.GetHashCode() ^ M01.GetHashCode() ^ M02.GetHashCode() ^ M03.GetHashCode() ^
            M10.GetHashCode() ^ M11.GetHashCode() ^ M12.GetHashCode() ^ M13.GetHashCode() ^
            M20.GetHashCode() ^ M21.GetHashCode() ^ M22.GetHashCode() ^ M23.GetHashCode() ^
            M30.GetHashCode() ^ M31.GetHashCode() ^ M32.GetHashCode() ^ M33.GetHashCode());
 }
Exemplo n.º 6
0
 public override int GetHashCode()
 {
     return
         (M11.GetHashCode() + M12.GetHashCode() + M13.GetHashCode() + M14.GetHashCode() +
          M21.GetHashCode() + M22.GetHashCode() + M23.GetHashCode() + M24.GetHashCode() +
          M31.GetHashCode() + M32.GetHashCode() + M33.GetHashCode() + M34.GetHashCode() +
          M41.GetHashCode() + M42.GetHashCode() + M43.GetHashCode() + M44.GetHashCode());
 }
Exemplo n.º 7
0
 /// <summary>
 /// Gets the hash code for a given Matrix4.
 /// </summary>
 /// <returns>The calculated hash code.</returns>
 public override int GetHashCode()
 {
     // Note this method of hash code generation is similar to what the XNA framework does
     return(M11.GetHashCode() + M12.GetHashCode() + M13.GetHashCode() + M14.GetHashCode()
            + M21.GetHashCode() + M22.GetHashCode() + M23.GetHashCode() + M24.GetHashCode()
            + M31.GetHashCode() + M32.GetHashCode() + M33.GetHashCode() + M34.GetHashCode()
            + M41.GetHashCode() + M42.GetHashCode() + M43.GetHashCode() + M44.GetHashCode());
 }
Exemplo n.º 8
0
 public override int GetHashCode()
 {
     // Perform field-by-field XOR of HashCodes
     return(M11.GetHashCode() ^
            M12.GetHashCode() ^
            M21.GetHashCode() ^
            M22.GetHashCode() ^
            OffsetX.GetHashCode() ^
            OffsetY.GetHashCode());
 }
Exemplo n.º 9
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = M11.GetHashCode();
         hashCode = (hashCode * 397) ^ M12.GetHashCode();
         hashCode = (hashCode * 397) ^ M21.GetHashCode();
         hashCode = (hashCode * 397) ^ M22.GetHashCode();
         return(hashCode);
     }
 }
Exemplo n.º 10
0
        public override int GetHashCode()
        {
            int h = M11.GetHashCode();

            h = (h << 5) - h + M21.GetHashCode();
            h = (h << 5) - h + M12.GetHashCode();
            h = (h << 5) - h + M22.GetHashCode();
            h = (h << 5) - h + OffsetX.GetHashCode();
            h = (h << 5) - h + OffsetY.GetHashCode();
            return(h);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Serves as a hash function for a particular type. <see cref="M:System.Object.GetHashCode"></see> is suitable for use in hashing algorithms and data structures like a hash table</summary>
        /// <returns>A hash code for the current <see cref="T:System.Object"></see></returns>
        public override int GetHashCode()
        {
            long bits = 1;

            bits = 31 * bits + M11.GetHashCode();
            bits = 31 * bits + M12.GetHashCode();
            bits = 31 * bits + M13.GetHashCode();
            bits = 31 * bits + M21.GetHashCode();
            bits = 31 * bits + M22.GetHashCode();
            bits = 31 * bits + M23.GetHashCode();
            bits = 31 * bits + M31.GetHashCode();
            bits = 31 * bits + M32.GetHashCode();
            bits = 31 * bits + M33.GetHashCode();
            return((int)(bits ^ (bits >> 32)));
        }
Exemplo n.º 12
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = M11.GetHashCode();
         hashCode = (hashCode * 397) ^ M12.GetHashCode();
         hashCode = (hashCode * 397) ^ M13.GetHashCode();
         hashCode = (hashCode * 397) ^ M21.GetHashCode();
         hashCode = (hashCode * 397) ^ M22.GetHashCode();
         hashCode = (hashCode * 397) ^ M23.GetHashCode();
         hashCode = (hashCode * 397) ^ M31.GetHashCode();
         hashCode = (hashCode * 397) ^ M32.GetHashCode();
         hashCode = (hashCode * 397) ^ M33.GetHashCode();
         return(hashCode);
     }
 }
Exemplo n.º 13
0
 public override int GetHashCode()
 {
     // Perform field-by-field XOR of HashCodes
     return(M11.GetHashCode() ^
            M12.GetHashCode() ^
            M13.GetHashCode() ^
            M14.GetHashCode() ^
            M21.GetHashCode() ^
            M22.GetHashCode() ^
            M23.GetHashCode() ^
            M24.GetHashCode() ^
            M31.GetHashCode() ^
            M32.GetHashCode() ^
            M33.GetHashCode() ^
            M34.GetHashCode() ^
            OffsetX.GetHashCode() ^
            OffsetY.GetHashCode() ^
            OffsetZ.GetHashCode() ^
            M44.GetHashCode());
 }
Exemplo n.º 14
0
 /// <inheritdoc/>
 public override Int32 GetHashCode()
 {
     unchecked
     {
         var hash = 17;
         hash = hash * 23 + M11.GetHashCode();
         hash = hash * 23 + M12.GetHashCode();
         hash = hash * 23 + M13.GetHashCode();
         hash = hash * 23 + M14.GetHashCode();
         hash = hash * 23 + M21.GetHashCode();
         hash = hash * 23 + M22.GetHashCode();
         hash = hash * 23 + M23.GetHashCode();
         hash = hash * 23 + M24.GetHashCode();
         hash = hash * 23 + M31.GetHashCode();
         hash = hash * 23 + M32.GetHashCode();
         hash = hash * 23 + M33.GetHashCode();
         hash = hash * 23 + M34.GetHashCode();
         hash = hash * 23 + M41.GetHashCode();
         hash = hash * 23 + M42.GetHashCode();
         hash = hash * 23 + M43.GetHashCode();
         hash = hash * 23 + M44.GetHashCode();
         return(hash);
     }
 }
Exemplo n.º 15
0
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>The hash code.</returns>
 public override int GetHashCode()
 {
     return(unchecked (M11.GetHashCode() + M12.GetHashCode() +
                       M21.GetHashCode() + M22.GetHashCode() +
                       M31.GetHashCode() + M32.GetHashCode()));
 }
Exemplo n.º 16
0
 public override int GetHashCode() => M11.GetHashCode() ^ M12.GetHashCode() ^ M13.GetHashCode() ^ M14.GetHashCode() ^
 M21.GetHashCode() ^ M22.GetHashCode() ^ M23.GetHashCode() ^ M24.GetHashCode() ^
 M31.GetHashCode() ^ M32.GetHashCode() ^ M33.GetHashCode() ^ M34.GetHashCode() ^
 M41.GetHashCode() ^ M42.GetHashCode() ^ M43.GetHashCode() ^ M44.GetHashCode();
Exemplo n.º 17
0
 public override int GetHashCode()
 {
     return(M11.GetHashCode() ^ M12.GetHashCode() ^
            M21.GetHashCode() ^ M22.GetHashCode() ^
            OffsetX.GetHashCode() ^ OffsetY.GetHashCode());
 }
Exemplo n.º 18
0
 public override int GetHashCode()
 => M11.GetHashCode() ^ M12.GetHashCode() ^ M13.GetHashCode()
 ^ M21.GetHashCode() ^ M22.GetHashCode() ^ M23.GetHashCode()
 ^ M31.GetHashCode() ^ M32.GetHashCode() ^ M33.GetHashCode();