'Computes a matrix and vector representing a list of constraints.
In the matrix, each constraint is given a block of rows.
Each variable coefficient is inserted as a block with upper
left corner at matrix[variable offset, constraint offset].
The constant term in the constraint is added to the vector.
Parameters
mat_cache : MatrixCache
The cached version of the matrix-vector pair.
caching : bool
Is the data being cached?'

def _lin_matrix(self, mat_cache, caching=False):

    active_constr = []
    constr_offsets = []
    vert_offset = 0
    for constr in mat_cache.constraints:
        has_param = (len(lu.get_expr_params(constr.expr)) > 0)
        if ((has_param and (not caching)) or ((not has_param) and caching)):
            if has_param:
                constr = lu.copy_constr(constr, lu.replace_params_with_consts)
            active_constr.append(constr)
            constr_offsets.append(vert_offset)
        vert_offset += (constr.size[0] * constr.size[1])
    if (len(active_constr) > 0):
        (V, I, J, const_vec) = canonInterface.get_problem_matrix(active_constr, self.sym_data.var_offsets, constr_offsets)
        conv_vec = self.vec_intf.const_to_matrix(const_vec, convert_scalars=True)
        mat_cache.const_vec[:const_vec.size] += conv_vec
        for (i, vals) in enumerate([V, I, J]):
            mat_cache.coo_tup[i].extend(vals)
