//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: protected void assertGradient(final ParameterLimitsTransform transform, final double modelParam)
        protected internal virtual void assertGradient(ParameterLimitsTransform transform, double modelParam)
        {
            const double eps = 1e-5;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double g = transform.transformGradient(modelParam);
            double g = transform.transformGradient(modelParam);
            double fdg;

            try
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double down = transform.transform(modelParam - eps);
                double down = transform.transform(modelParam - eps);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double up = transform.transform(modelParam + eps);
                double up = transform.transform(modelParam + eps);
                fdg = (up - down) / 2 / eps;
            }
//JAVA TO C# CONVERTER WARNING: 'final' catch parameters are not available in C#:
//ORIGINAL LINE: catch (final IllegalArgumentException e)
            catch (legalArgumentException)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double fp = transform.transform(modelParam);
                double fp = transform.transform(modelParam);
                try
                {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double up = transform.transform(modelParam + eps);
                    double up = transform.transform(modelParam + eps);
                    fdg = (up - fp) / eps;
                }
//JAVA TO C# CONVERTER WARNING: 'final' catch parameters are not available in C#:
//ORIGINAL LINE: catch (final IllegalArgumentException e2)
                catch (legalArgumentException)
                {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double down = transform.transform(modelParam - eps);
                    double down = transform.transform(modelParam - eps);
                    fdg = (fp - down) / eps;
                }
            }
            assertEquals(g, fdg, 1e-6);
        }
        // reverse
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: protected void assertReverseRoundTrip(final ParameterLimitsTransform transform, final double fitParam)
        protected internal virtual void assertReverseRoundTrip(ParameterLimitsTransform transform, double fitParam)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double mp = transform.inverseTransform(fitParam);
            double mp = transform.inverseTransform(fitParam);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double fp = transform.transform(mp);
            double fp = transform.transform(mp);

            assertEquals(fitParam, fp, 1e-8);
        }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: protected void assertGradientRoundTrip(final ParameterLimitsTransform transform, final double modelParam)
        protected internal virtual void assertGradientRoundTrip(ParameterLimitsTransform transform, double modelParam)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double g = transform.transformGradient(modelParam);
            double g = transform.transformGradient(modelParam);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double fp = transform.transform(modelParam);
            double fp = transform.transform(modelParam);
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final double gInv = transform.inverseTransformGradient(fp);
            double gInv = transform.inverseTransformGradient(fp);

            assertEquals(g, 1.0 / gInv, 1e-8);
        }
示例#4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expectedExceptions = IllegalArgumentException.class) public void testOutOfRange2()
        public virtual void testOutOfRange2()
        {
            UPPER_LIMIT.transform(1.01);
        }
示例#5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expectedExceptions = IllegalArgumentException.class) public void testOutOfRange1()
        public virtual void testOutOfRange1()
        {
            LOWER_LIMIT.transform(-3);
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expectedExceptions = IllegalArgumentException.class) public void testOutOfRange1()
        public virtual void testOutOfRange1()
        {
            RANGE_LIMITS.transform(-3);
        }