public void SetSubmatrix(int row, int col, OMatrix matrix) { var box1 = new Box2i(col, row, matrix.ColumnCount, matrix.RowCount); var box2 = new Box2i(row, col, matrix.RowCount, matrix.ColumnCount); if (!Box2i.Intersection(box1, box2).IsEmpty) { throw new ArgumentException("To preserve symmetry, submatrix should not intersect its own transpose"); } _data.SetSubMatrix(row, matrix.RowCount, col, matrix.ColumnCount, ((BaseMatrix)matrix.Value).Data); _data.SetSubMatrix(col, matrix.ColumnCount, row, matrix.RowCount, ((BaseMatrix)matrix.Value).Data.Transpose()); }