Ejemplo n.º 1
0
        public MatrixNd Transpose()
        {
            MatrixNd matrix = new MatrixNd(n, m);

            for (int i = 0; i < m; ++i)
            {
                for (int j = 0; j < n; ++j)
                {
                    matrix[j, i] = this[i, j];
                }
            }
            return(matrix);
        }
Ejemplo n.º 2
0
        public MatrixNd Mul(MatrixNd right)
        {
            if (right.RowSize != this.ColumnSize)
            {
                throw new ArgumentException();
            }
            int      l      = right.ColumnSize;
            MatrixNd matrix = new MatrixNd(m, l);

            for (int i = 0; i < m; ++i)
            {
                for (int j = 0; j < l; ++j)
                {
                    for (int k = 0; k < n; ++k)
                    {
                        matrix[i, j] += this[i, k] * right[k, j];
                    }
                }
            }
            return(matrix);
        }
 public MatrixNd Transpose()
 {
     MatrixNd matrix = new MatrixNd(n, m);
     for (int i = 0; i < m; ++i)
     {
         for (int j = 0; j < n; ++j)
         {
             matrix[j, i] = this[i, j];
         }
     }
     return matrix;
 }
 public MatrixNd Mul(MatrixNd right)
 {
     if (right.RowSize != this.ColumnSize) throw new ArgumentException();
     int l = right.ColumnSize;
     MatrixNd matrix = new MatrixNd(m, l);
     for (int i = 0; i < m; ++i)
     {
         for (int j = 0; j < l; ++j)
         {
             for (int k = 0; k < n; ++k)
             {
                 matrix[i, j] += this[i, k] * right[k, j];
             }
         }
     }
     return matrix;
 }