示例#1
0
        public static void Main(string[] args)
        {
            double[,] mat = new double[5, 5];
            for (int c = 0; c < 5; c++)
            {
                for (int c1 = 0; c1 < 5; c1++)
                {
                    Console.Write($"Enter the element [{c},{c1}] = ");
                    mat [c, c1] = double.Parse(Console.ReadLine());
                }
            }
            for (int c = 0; c < 5; c++)
            {
                for (int c1 = 0; c1 < 5; c1++)
                {
                    Console.Write($"\t{mat[c,c1]}");
                }
                Console.WriteLine("");
            }

            Matrix theMat = new Matrix(mat, 5, 5);

            theMat.GaussJordan();
            Console.WriteLine("After guass elimination = ");
            MatrixOutput.Print(theMat);
        }         // END MAIN
示例#2
0
        public void Print()
        {
            int expType = theExpression.getExpType();

            if (expType == 1)
            {
                Console.WriteLine($"{theExpression.getTag()} = ");
                MatrixOutput.Print(theExpression.getMatrix());
            }
            else if (expType == 2)
            {
                Console.WriteLine($"{theExpression.getTag()} = {theExpression.getNumber().getNumber()}");
            }
        }