'Gets a slice from a matrix
Parameters
matrix : LinOp
The matrix in the block equality.
constraints : list
A list of constraints to append to.
row_start : int
The first row of the matrix section.
row_end : int
The last row + 1 of the matrix section.
col_start : int
The first column of the matrix section.
col_end : int
The last column + 1 of the matrix section.'

@staticmethod
def get_slice(matrix, constraints, row_start, row_end, col_start, col_end):

    key = (slice(row_start, row_end, None), slice(col_start, col_end, None))
    rows = (row_end - row_start)
    cols = (col_end - col_start)
    (slc, idx_constr) = index.graph_implementation([matrix], (rows, cols), [key])
    constraints += idx_constr
    return slc
