comms.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:arlpy 作者: org-arl 项目源码 文件源码
def invert_map(x):
    """Generate an inverse map.

    :param x: map, such as that generated by :func:`gray_code`
    :returns: an inverse map y, such that ``y[x[j]] = j``

    >>> import arlpy
    >>> x = arlpy.comms.gray_code(8)
    >>> y = arlpy.comms.invert_map(x)
    >>> x[2]
    3
    >>> y[3]
    2
    """
    y = _np.empty_like(x)
    y[x] = _np.arange(len(x))
    return y
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号