@staticmethod
def _convert_coefficients(coef):
    """
        Convert 'x', and '-x' into ('x', 1) and ('x', -1), respectively.

        Args:
            coef (list[(int, float) or int]): coef
        Returns:
            tuple: ind, val
        Raises:
            RuntimeError: unsupported type
        """
    ind = []
    val = []
    for e in coef:
        if isinstance(e, tuple):
            assert len(e) == 2
            ind.append(e[0])
            val.append(e[1])
        elif isinstance(e, int):
            if e >= 0:
                ind.append(e)
                val.append(1)
            else:
                ind.append(-e)
                val.append(-1)
        else:
            raise RuntimeError('unsupported type:' + str(e))
    return ind, val
