//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);
        }
//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);
        }
示例#3
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 testOutOfRange4()
        public virtual void testOutOfRange4()
        {
            UPPER_LIMIT.transformGradient(1.01);
        }
示例#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 testOutOfRange3()
        public virtual void testOutOfRange3()
        {
            LOWER_LIMIT.transformGradient(-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 testOutOfRange3()
        public virtual void testOutOfRange3()
        {
            RANGE_LIMITS.transformGradient(-3);
        }