예제 #1
0
        public void TestSingleThreadedNormalization()
        {
            BaseNormalizer normlize         = new SingleThreadedNormalization();
            var            mtrx             = GetDataForSingleThreadedNormalization();
            var            normalizedMatrix = normlize.Normalize(mtrx);

            Assert.Equal(normalizedMatrix[0, 0], -0.5);
            Assert.Equal(normalizedMatrix[1, 1], -0.25);
            Assert.Equal(normalizedMatrix[3, 2], 0);
            Assert.Equal(normalizedMatrix[4, 3], 0.25);
            Assert.Equal(normalizedMatrix[4, 4], 0.5);
        }
예제 #2
0
        public void TestMultyThreadedNormalization()
        {
            BaseNormalizer normlize         = new MultiThreadedNormalization();
            var            mtrx             = GetDataForSingleThreadedNormalization();
            var            normalizedMatrix = normlize.Normalize(mtrx);



            BaseNormalizer normlize1         = new SingleThreadedNormalization();
            var            mtrx1             = GetDataForSingleThreadedNormalization();
            var            normalizedMatrix1 = normlize1.Normalize(mtrx1);


            for (int i = 0; i < normalizedMatrix.LinesNumber; i++)
            {
                for (int j = 0; j < normalizedMatrix.ColumnsNumber; j++)
                {
                    Assert.Equal(normalizedMatrix[i, j], normalizedMatrix1[i, j]);
                }
            }
        }