Example #1
0
        public static SquarredMatrix MultiplyWithIdentityMatrix(SquarredMatrix inputMatrix)
        {
            SquarredMatrix result = new SquarredMatrix(inputMatrix.SizeOfMatrix);

            //copy inputMatrix to result
            return(result);
        }
Example #2
0
        public static void PrintMatrix(SquarredMatrix operand)
        {
            for (int i = 0; i < operand.SizeOfMatrix; i++)
            {
                for (int j = 0; j < operand.SizeOfMatrix; j++)
                {
                    Console.Write(operand[i, j] + " ");
                }
                Console.WriteLine("\n");
            }

            Console.WriteLine("------------------------------");
        }
Example #3
0
        public static SquarredMatrix operator-(SquarredMatrix operand1, SquarredMatrix operand2)
        {
            SquarredMatrix result = new SquarredMatrix(operand1.SizeOfMatrix);

            for (int i = 0; i < operand1.SizeOfMatrix; i++)
            {
                for (int j = 0; j < operand2.SizeOfMatrix; j++)
                {
                    result[i, j] = operand1[i, j] - operand2[i, j];
                }
            }
            return(result);
        }
Example #4
0
        public void MoneyMoney()
        {
            Money m  = new Money(1018);
            Money m1 = new Money(26, 56);
            Money m2 = new Money(1, 58);
            Money m3 = m1 + m2;
            //Console.WriteLine("string: {0}", m1.ToString());
            //Console.WriteLine("int: {0}", (int)m1);
            //Console.WriteLine("float: {0}", (float)m1);
            //Console.WriteLine(m3);
            //Console.WriteLine("------------SquarredMatrix------------");
            SquarredMatrix matrix1 = new SquarredMatrix(3);
            SquarredMatrix matrix2 = new SquarredMatrix(3);
            SquarredMatrix matrix3 = matrix1 + matrix2;

            SquarredMatrix.PrintMatrix(matrix1);
            SquarredMatrix.PrintMatrix(matrix2);
            SquarredMatrix.PrintMatrix(matrix3);
            Console.ReadKey();
        }
Example #5
0
 public static double[,] MatrixToArray(SquarredMatrix inputMatrix)
 {
     double[,] result = new double[inputMatrix.SizeOfMatrix, inputMatrix.SizeOfMatrix];
     result           = (double[, ])inputMatrix.matrix.Clone();
     return(result);
 }