示例#1
0
 public static MatrixByArr[,] CreateMatrixArray(int colsize, int rowsize, MatrixByArr src)
 {
     MatrixByArr[,] blockmatrix = new MatrixByArr[colsize, rowsize];
     for (int c = 0; c < colsize; c++)
     {
         for (int r = 0; r < rowsize; r++)
         {
             blockmatrix[c, r] = src.CloneT();
         }
     }
     return(blockmatrix);
 }
示例#2
0
        public MatrixBySparseMatrix CloneT()
        {
            MatrixBySparseMatrix clone = new MatrixBySparseMatrix(_ColSize, _RowSize, BlkSize);

            foreach (var bc_br_bval in blkmatrix.EnumElements())
            {
                int         bc   = bc_br_bval.Item1;
                int         br   = bc_br_bval.Item2;
                MatrixByArr bval = bc_br_bval.Item3;

                clone.blkmatrix[bc, br] = bval.CloneT();
            }
            return(clone);
        }
示例#3
0
        public static MatrixByArr M_Mt(MatrixByArr lmat, MatrixByArr rmat)
        {
            // M + Mt
            HDebug.Assert(lmat.ColSize == rmat.RowSize);
            HDebug.Assert(lmat.RowSize == rmat.ColSize);
            MatrixByArr MMt = lmat.CloneT();

            for (int c = 0; c < MMt.ColSize; c++)
            {
                for (int r = 0; r < MMt.RowSize; r++)
                {
                    MMt[c, r] += rmat[r, c];
                }
            }
            return(MMt);
        }