Exemple #1
0
        public IntMatrix MultiplyRow(uint r, int factor)
        {
            var newM = IntMatrix.FromArray(M);

            for (uint c = 0; c < newM.Cols; c++)
            {
                newM[r, c] *= factor;
            }
            return(newM);
        }
Exemple #2
0
        public IntMatrix AddRows(uint rSrc, uint rDst, int factor)
        {
            var newM = IntMatrix.FromArray(M);

            for (uint c = 0; c < newM.Cols; c++)
            {
                newM[rDst, c] += factor * newM[rSrc, c];
            }
            return(newM);
        }
Exemple #3
0
        public IntMatrix SwapRows(uint r1, uint r2)
        {
            var newM = IntMatrix.FromArray(M);

            for (uint c = 0; c < newM.Cols; c++)
            {
                (newM[r1, c], newM[r2, c]) = (newM[r1, c], newM[r2, c]);
            }
            return(newM);
        }