def build_constraint_matrix(constrs)
      cbeg = []
      cind = []
      cval = []
      constrs.each.map do |constr|
        cbeg << cind.length
        constr.expression.terms.each do |var, coeff|
          cind << var.index
          cval << coeff
        end
      end

      [cbeg, cind, cval]
    end
def build_constraint_matrix(constrs)
      cbeg = []
      cind = []
      cval = []
      constrs.each.map do |constr|
        cbeg << cind.length
        constr.expression.terms.each do |var, coeff|
          cind << var.index
          cval << coeff
        end
      end

      [cbeg, cind, cval]
    end
Construct a matrix of values for the given list of constraints