Exemple #1
0
def odd_even():
    # generate random vector containing 99 elements
    x = np.random.rand(1, 99)
    algs.main(x)
    # generate random vector containing 999 elements
    x = np.random.rand(1, 999)
    algs.main(x)
Exemple #2
0
def test_duplicated():
    # generate random vector containing 100 elements
    x = np.random.rand(1, 100)
    y = x.tolist()
    z = y[0]
    # add the first element to the list again (duplicate it)
    y.append(z)
    algs.main(y)
Exemple #3
0
def run_stuff():
    print("This is run_stuff() from ", __file__)
    lengths = np.arange(100,1100,100)
    bcounts = []
    qcounts = []
    for le in lengths:
        x = np.random.rand(le)
        print("Unsorted input:\n", x, "\n")
        ab, cb, aq, cq = algs.main(x)
        bcounts.append([ab, cb])
        qcounts.append([aq, cq])
    return bcounts, qcounts
Exemple #4
0
def test_single():
    # generate random vector containing 1 element
    x = np.random.rand(1, 1)
    algs.main(x)
Exemple #5
0
def test_empty():
    # generate random vector of length 0
    x = np.empty([1, 1])
    algs.main(x)  # check if it fails if the vector is empty
Exemple #6
0
def test_main():
    # generate random vector of length 100
    x = np.random.rand(100)
    algs.main(x)