numl.Math.LinearAlgebra.Matrix.Remove C# (CSharp) Method

Remove() public method

Removes this object.
public Remove ( int index, VectorType t ) : Matrix
index int Zero-based index of the.
t VectorType .
return Matrix
        public Matrix Remove(int index, VectorType t)
        {
            int max = t == VectorType.Row ? Rows : Cols;
            int row = t == VectorType.Row ? Rows - 1 : Rows;
            int col = t == VectorType.Col ? Cols - 1 : Cols;

            Matrix m = new Matrix(row, col);
            int j = -1;
            for (int i = 0; i < max; i++)
            {
                if (i == index) continue;
                m[++j, t] = this[i, t];
            }

            return m;
        }