コード例 #1
0
def test():
    # get the package
    import gsl
    # make a permutation
    p = gsl.permutation(shape=100).init()
    # check that we got a valid permutation back
    assert p
    # and return it
    return p
コード例 #2
0
def test():
    # get the package
    import gsl
    # make a permutation
    p = gsl.permutation(shape=100).init()
    # verify we can access its elements
    for i in range(len(p)): assert i == p[i]
    # and return it
    return p
コード例 #3
0
def test():
    # get the package
    import gsl
    # make a permutation
    p = gsl.permutation(shape=100).init()
    # check that we got a valid permutation back
    assert p
    # and return it
    return p
コード例 #4
0
ファイル: permutation_copy.py プロジェクト: lijun99/pyre
def test():
    # get the package
    import gsl
    # make a permutation
    p = gsl.permutation(shape=100).init()
    # check that we got a valid permutation back
    assert p
    # clone it
    q = p.clone()
    # check that it is valid
    assert q
    # and return them
    return p, q