Exemplo n.º 1
0
        public void zdscal_TestCaseData_ManuallyScaledSequenceEqual(int n, double a, params Complex[] x)
        {
            var expected = x.Select(z => a * z).ToArray();

            m_Level1BLAS.zdscal(n, a, x);

            Assert.That(x.SequenceEqual(expected));
        }
Exemplo n.º 2
0
        public void zdscale_ExtendedTestCaseData(double a)
        {
            int n         = 3;
            int startX    = 1;
            int increment = 2;

            var x = new Complex[] { 1, 2, 3, 4 - 5.9 * Complex.ImaginaryOne, 5, 6 + Complex.ImaginaryOne };

            Complex[] actual = x.ToArray();
            m_Level1BLAS.zdscal(n, a, actual, increment, startX);

            Complex[] expected = x.ToArray();
            m_BenchmarkLevel1BLAS.zdscal(n, a, expected, increment, startX);

            Assert.That(actual, new ComplexArrayNUnitConstraint(expected, tolerance: 1E-9));
        }