Exemple #1
0
        /// <summary>
        /// Verify if is reversible real.
        /// </summary>
        /// <param name="count">Samples count.</param>
        /// <param name="maximumError">Maximum error value.</param>
        /// <param name="forward">Forward delegate.</param>
        /// <param name="inverse">Inverse delegate.</param>
        private void VerifyIsReversibleReal(
            int count,
            double maximumError,
            Func <double[], double[]> forward,
            Func <double[], double[]> inverse)
        {
            var samples = SignalGenerator.Random(x => x, GetUniform(1), count);
            var work    = new double[samples.Length];

            samples.CopyTo(work, 0);

            work = forward(work);

            Assert.IsFalse(work.AlmostEqualListWithError(samples, maximumError));

            work = inverse(work);

            AssertHelpers.AlmostEqualList(samples, work, maximumError);
        }