Example #1
0
def test_size_q():
    n = 13
    m = 3
    c = dict(q=[n,m])
    c = format_and_copy_cone(c)

    assert cone_len(c) == n+m
Example #2
0
def test_size_s():
    n = 13
    m = 3
    c = dict(s=[n,m])
    c = format_and_copy_cone(c)

    assert cone_len(c) == (n*(n+1))/2 + (m*(m+1))/2
Example #3
0
def test_size_s():
    n = 13
    m = 3
    c = dict(s=[n, m])
    c = format_and_copy_cone(c)

    assert cone_len(c) == (n * (n + 1)) / 2 + (m * (m + 1)) / 2
Example #4
0
def test_size_q():
    n = 13
    m = 3
    c = dict(q=[n, m])
    c = format_and_copy_cone(c)

    assert cone_len(c) == n + m
Example #5
0
def test_cone():
    d = dict(f=1, l=20, ep=4, ed=7, q=[3,4,9,10], s=[3,2,4], p=[.1, -.7])
    c = format_and_copy_cone(d)

    expected = (d['f'] + d['l'] + 3*d['ep'] + 3*d['ed'] +
                sum(d['q']) + len(d['p'])*3 + sum([i*(i+1)/2 for i in d['s']]))

    assert cone_len(c) == expected
Example #6
0
def test_cone():
    d = dict(f=1, l=20, ep=4, ed=7, q=[3, 4, 9, 10], s=[3, 2, 4], p=[.1, -.7])
    c = format_and_copy_cone(d)

    expected = (d['f'] + d['l'] + 3 * d['ep'] + 3 * d['ed'] + sum(d['q']) +
                len(d['p']) * 3 + sum([i * (i + 1) / 2 for i in d['s']]))

    assert cone_len(c) == expected
Example #7
0
def test_size_f():
    n = 13
    d = dict(f=n)

    assert cone_len(d) == n
Example #8
0
def test_size_p():
    a = [-.4, .7]
    c = dict(p=a)
    c = format_and_copy_cone(c)

    assert cone_len(c) == 3*len(a)
Example #9
0
def test_size_ed():
    n = 13
    c = dict(ed=n)

    assert cone_len(c) == 3*n
Example #10
0
def test_size_l():
    n = 13
    c = dict(l=n)

    assert cone_len(c) == n
Example #11
0
def test_size_f():
    n = 13
    d = dict(f=n)

    assert cone_len(d) == n
Example #12
0
def test_size_p():
    a = [-.4, .7]
    c = dict(p=a)
    c = format_and_copy_cone(c)

    assert cone_len(c) == 3 * len(a)
Example #13
0
def test_size_ed():
    n = 13
    c = dict(ed=n)

    assert cone_len(c) == 3 * n
Example #14
0
def test_size_l():
    n = 13
    c = dict(l=n)

    assert cone_len(c) == n