'Converts the cached representation of the constraints matrix.
Parameters
mat_cache : MatrixCache
The cached version of the matrix-vector pair.
Returns
A (matrix, vector) tuple.'

def _cache_to_matrix(self, mat_cache):

    param_cache = self._init_matrix_cache(mat_cache.constraints, mat_cache.size[0])
    self._lin_matrix(param_cache)
    (rows, cols) = mat_cache.size
    (V, I, J) = mat_cache.coo_tup
    (Vp, Ip, Jp) = param_cache.coo_tup
    if ((len(V) + len(Vp)) > 0):
        matrix = sp.coo_matrix(((V + Vp), ((I + Ip), (J + Jp))), (rows, cols))
        matrix = self.matrix_intf.const_to_matrix(matrix, convert_scalars=True)
    else:
        matrix = self.matrix_intf.zeros(rows, cols)
    combo_vec = (mat_cache.const_vec + param_cache.const_vec)
    const_vec = intf.from_2D_to_1D(combo_vec)
    return (matrix, (- const_vec))
