Computes the hitting probabilities for all states to the target states.

    The hitting probability of state i to the target set A is defined as the minimal,
    non-negative solution of:

    .. math::
        h_i^A &= 1                    \:\:\:\:  i\in A \\
        h_i^A &= \sum_j p_{ij} h_i^A  \:\:\:\:  i \notin A

    Parameters
    ----------
    T : (M, M) ndarray or scipy.sparse matrix
        Transition matrix
    B : array_like
        List of integer state labels for the target set

    Returns
    -------
    h : ndarray(n)
        a vector with hitting probabilities

def hitting_probability(T, target):
    """
    Computes the hitting probabilities for all states to the target states.

    The hitting probability of state i to the target set A is defined as the minimal,
    non-negative solution of:

    .. math::
        h_i^A &= 1                    \:\:\:\:  i\in A \\
        h_i^A &= \sum_j p_{ij} h_i^A  \:\:\:\:  i \notin A

    Parameters
    ----------
    T : (M, M) ndarray or scipy.sparse matrix
        Transition matrix
    B : array_like
        List of integer state labels for the target set

    Returns
    -------
    h : ndarray(n)
        a vector with hitting probabilities
    """
    T = _types.ensure_ndarray_or_sparse(T, ndim=2, uniform=True, kind='numeric')
    target = _types.ensure_int_vector(target)
    if _issparse(T):
        _showSparseConversionWarning()  # currently no sparse implementation!
        return dense.hitting_probability.hitting_probability(T.toarray(), target)
    else:
        return dense.hitting_probability.hitting_probability(T, target)