示例#1
0
        public void RemoveLinhaEColunaTest()
        {
            var _matriz = new Matriz(new int[, ] {
                { 2, 1, 2 }, { -3, 4, 1 }, { 3, 2, 5 }
            });
            var _matrizReduzida = _matriz.RemoveLinhaEColuna(_matriz.GetMatrizValue(), 2, 3);

            Assert.True(_matrizReduzida.GetLength(0) == 2);
        }
示例#2
0
        public void CalcularDeterminane5x5()
        {
            var _matriz = new Matriz(new int[, ] {
                { 1, 2, 3, -3, 1 }, { 0, 4, 0, 0, 0 }, { 0, 1, 0, 1, 1 }, { 0, -6, 6, 1, 3 }, { 0, 2, 0, -1, 1 }
            });
            var determinante = _matriz.CalcularDeterminanteNxN(_matriz.GetMatrizValue(), 1);

            Assert.True(determinante == -48);
        }
示例#3
0
        public void CalcularDeterminante4x4()
        {
            var _matriz = new Matriz(new int[, ] {
                { 4, 5, -3, 0 }, { 2, -1, 3, 1 }, { 1, -3, 2, 1 }, { 0, 2, -2, 5 }
            });
            var determinante = _matriz.CalcularDeterminanteNxN(_matriz.GetMatrizValue(), 1);

            Assert.True(determinante == 210);
        }
示例#4
0
        public void CalcularDeterminante3x3()
        {
            var _matriz = new Matriz(new int[, ] {
                { 2, 1, 2 }, { -3, 4, 1 }, { 3, 2, 5 }
            });
            var determinante = _matriz.CalcularDeterminanteNxN(_matriz.GetMatrizValue(), 1);

            Assert.True(determinante == 18);
        }
示例#5
0
        public void CalcularCofator1x3Test()
        {
            var _matriz = new Matriz(new int[, ] {
                { 2, 1, 2 }, { -3, 4, 1 }, { 3, 2, 5 }
            });
            var _cofator = _matriz.CalcularCofator(1, 3, _matriz.GetMatrizValue());

            Assert.True(_cofator == -18);
        }
示例#6
0
        public void RemoveLinhaEColuna4x4Test()
        {
            var _matriz = new Matriz(new int[, ] {
                { 4, 5, -3, 0 }, { 2, -1, 3, 1 }, { 1, -3, 2, 1 }, { 0, 2, -2, 5 }
            });
            var _matrizReduzida = _matriz.RemoveLinhaEColuna(_matriz.GetMatrizValue(), 1, 1);

            Assert.True(_matrizReduzida.GetLength(0) == 3);
        }
示例#7
0
        public void Print2dTest()
        {
            var _matriz = new Matriz(new int[, ] {
                { 4, 5, -3, 0 }, { 2, -1, 3, 1 }, { 1, -3, 2, 1 }, { 0, 2, -2, 5 }
            });

            _matriz.print2DMatriz(_matriz.GetMatrizValue());
            Assert.True(true);
        }