public Matrix GetMatrix(int[] r, int[] c)
{
var result = new Matrix(r.Length, c.Length);
double[][] b = result.Data;
try
{
for (int i = 0; i < r.Length; i++)
{
for (int j = 0; j < c.Length; j++)
{
b[i][j] = matrix[r[i]][c[j]];
}
}
}
catch (IndexOutOfRangeException)
{
throw new MatrixError("Submatrix indices");
}
return result;
}