コード例 #1
0
ファイル: Matrix3D.cs プロジェクト: beda2280/wpf-1
 /// <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());
     }
 }
コード例 #2
0
ファイル: Matrix4.cs プロジェクト: VB6Hobbyst7/GDI3D
 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());
 }
コード例 #3
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);
            }
        }
コード例 #4
0
ファイル: Matrix3.cs プロジェクト: WKleinschmit/netDxf
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>A 32-bit signed integer that is the hash code for this 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());
 }
コード例 #5
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());
 }
コード例 #6
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());
 }
コード例 #7
0
ファイル: Matrix.cs プロジェクト: wesreid/xwt
        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);
        }
コード例 #8
0
ファイル: Matrix2x2.cs プロジェクト: KallDrexx/RayTracer
 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);
     }
 }
コード例 #9
0
ファイル: Matrix3x3.cs プロジェクト: ndech/Alpha
 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);
     }
 }
コード例 #10
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());
 }
コード例 #11
0
ファイル: Matrix.cs プロジェクト: hhinterview/SampSharp
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
 /// </returns>
 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);
     }
 }
コード例 #12
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);
     }
 }
コード例 #13
0
ファイル: Matrix.cs プロジェクト: aquarius20th/Granular
 public override int GetHashCode()
 {
     return(M11.GetHashCode() ^ M12.GetHashCode() ^
            M21.GetHashCode() ^ M22.GetHashCode() ^
            OffsetX.GetHashCode() ^ OffsetY.GetHashCode());
 }
コード例 #14
0
ファイル: Matrix3x2.cs プロジェクト: MananAdhvaryu/GWS
 /// <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()));
 }