Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testObject()
        public virtual void testObject()
        {
            assertEquals(LAPLACE.B, B, 0);
            assertEquals(LAPLACE.Mu, MU, 0);
            LaplaceDistribution other = new LaplaceDistribution(MU, B);

            assertEquals(LAPLACE, other);
            assertEquals(LAPLACE.GetHashCode(), other.GetHashCode());
            other = new LaplaceDistribution(MU + 1, B);
            assertFalse(LAPLACE.Equals(other));
            other = new LaplaceDistribution(MU, B + 1);
            assertFalse(LAPLACE.Equals(other));
        }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }
            LaplaceDistribution other = (LaplaceDistribution)obj;

            if (System.BitConverter.DoubleToInt64Bits(_b) != Double.doubleToLongBits(other._b))
            {
                return(false);
            }
            return(System.BitConverter.DoubleToInt64Bits(_mu) == Double.doubleToLongBits(other._mu));
        }