示例#1
0
        public TMatrix TrasponirovanieMatrix(TMatrix matrix1)
        {
            double  tmp;
            TMatrix resMatrix = matrix1;

            for (int i = 0; i < matrix1.nSize; i++)
            {
                for (int j = 0; j < i; j++)
                {
                    tmp             = resMatrix[i, j];
                    resMatrix[i, j] = resMatrix[j, i];
                    resMatrix[j, i] = tmp;
                }
            }
            return(resMatrix);
        }
示例#2
0
        public TMatrix MulMatrix(TMatrix matrix1, TMatrix matrix2)
        {
            double tmp;
            TMatrix resMatrix = new TMatrix(matrix1.mSize,matrix2.nSize);

            for (int i = 0; i < matrix1.mSize; i++)
            {
                for (int j = 0; j < matrix2.nSize; j++)
                {
                    tmp = resMatrix[i, j];
                    for (int k = 0; k < matrix1.nSize; k++)
                    {
                        tmp += matrix1[i, k] * matrix2[k, j];
                    }
                    resMatrix[i, j] = tmp;
                }
            }
            return resMatrix;
        }
示例#3
0
        public TMatrix MulMatrix(TMatrix matrix1, TMatrix matrix2)
        {
            double  tmp;
            TMatrix resMatrix = new TMatrix(matrix1.mSize, matrix2.nSize);

            for (int i = 0; i < matrix1.mSize; i++)
            {
                for (int j = 0; j < matrix2.nSize; j++)
                {
                    tmp = resMatrix[i, j];
                    for (int k = 0; k < matrix1.nSize; k++)
                    {
                        tmp += matrix1[i, k] * matrix2[k, j];
                    }
                    resMatrix[i, j] = tmp;
                }
            }
            return(resMatrix);
        }
示例#4
0
 public TMatrix TrasponirovanieMatrix(TMatrix matrix1)
 {
     double tmp;
     TMatrix resMatrix = matrix1;
     for (int i = 0; i < matrix1.nSize; i++)
     {
         for (int j = 0; j < i; j++)
         {
             tmp = resMatrix[i, j];
             resMatrix[i, j] = resMatrix[j, i];
             resMatrix[j, i] = tmp;
         }
     }
     return resMatrix;
 }