Esempio n. 1
0
        private static Dimensions GetDestinationSize(MaTran table1, MaTran table2)
        {
            int rows;

            if (table1.Rows > table2.Rows)
            {
                rows = table1.Rows;
            }
            else
            {
                rows = table2.Rows;
            }

            int columns;

            if (table1.Columns > table2.Columns)
            {
                columns = table1.Columns;
            }
            else
            {
                columns = table2.Columns;
            }
            return(new Dimensions(rows, columns));
        }
Esempio n. 2
0
        private void Giai()
        {
            MaTran matran1    = new MaTran(mt1);
            MaTran matran2    = new MaTran(mt2);
            MaTran giaimatran = matran1 * matran2;

            AddVaoKetQua(giaimatran);
        }
Esempio n. 3
0
 private void AddVaoKetQua(MaTran table)
 {
     mtkq = new int[table.Rows, table.Columns];
     for (int i = 0; i < table.Rows; i++)
     {
         for (int j = 0; j < table.Columns; j++)
         {
             mtkq[i, j] = table[i, j];
         }
     }
 }
Esempio n. 4
0
        public static MaTran operator *(MaTran table1, MaTran table2)
        {
            MaTran result = new MaTran(table1.Rows, table2.Columns);

            for (int i = 0; i < table1.Rows; i++)
            {
                for (int j = 0; j < table2.Columns; j++)
                {
                    for (int k = 0; k < table1.Columns; k++)
                    {
                        result[i, j] += table1[i, k] * table2[k, j];
                    }
                }
            }
            return(result);
        }