# from chapter2_vec import *
# labels = {'a', 'b', 'c', 'd', 'e'}
# function = {'a':1, 'b':2, 'c':3, 'd':4, 'e':5}
# v = Vec(labels, function)
# print(v.set_item('a',5))
# print(v.get_labels())
# print(v.get_function())
# print(v.get_item('a'))
# print(v.get_item('q'))
# v2 = v.scalar_mul(2)
# print(v2.get_function())
# print(v2.get_labels())

from vec import *
# v = Vec({'a', 'b', 'c'}, {'b':0})
# print(v['b'])
# v['a'] = 1
# print(v['a'])
# print(Vec({'a', 'b', 'c'}, {'a':0}) == Vec({'a', 'b', 'c'}, {'b':0}))
# print(Vec({'a', 'b', 'c'}, {'a': 0}) == Vec({'a', 'b', 'c'}, {}))
# print(Vec({'a', 'b', 'c'}, {}) == Vec({'a', 'b', 'c'}, {'a': 0}))
# print(Vec({'x','y','z'},{'y':1,'x':2}) == Vec({'x','y','z'},{'y':1,'z':0}))
# print(Vec({'a','b','c'}, {'a':0,'c':1}) == Vec({'a','b','c'}, {'a':0,'c':1,'b':4}))
# print(Vec({'a','b','c'}, {'a':0,'c':1,'b':4}) == Vec({'a','b','c'}, {'a':0,'c':1}))
# print(Vec({'a','b'},{'a':1}) == Vec({'a','b'},{'b':1}))
# print(Vec({'a','b'},{'a':1}) == Vec({'a','b'},{'a':2}))
print()
a = Vec({'a','e','i','o','u'}, {'a':0,'e':1,'i':2})
b = Vec({'a','e','i','o','u'}, {'o':4,'u':7})
c = Vec({'a','e','i','o','u'}, {'a':0,'e':1,'i':2,'o':4,'u':7})
print(a + b == c)
print(a)
print(b)
print(c)
print(a == Vec({'a','e','i','o','u'}, {'a':0,'e':1,'i':2}))
print(b == Vec({'a','e','i','o','u'}, {'o':4,'u':7}))
d = Vec({'x','y','z'}, {'x':2,'y':1})
e = Vec({'x','y','z'}, {'z':4,'y':-1})
f = Vec({'x','y','z'}, {'x':2,'y':0,'z':4})
print(d + e == f)
print(d == Vec({'x','y','z'}, {'x':2,'y':1}))
print(e == Vec({'x','y','z'}, {'z':4,'y':-1}))
print(b + Vec({'a','e','i','o','u'}, {}) == b)
print() #something VEEERY broken about the way I'm running these tests, keep getting different
#answers on multiple runs and no idea why

# u = Vec({1,3,5,7},{1:1,3:2,5:3,7:4})
# print(-u)
# print('should be Vec({1, 3, 5, 7},{1: -1, 3: -2, 5: -3, 7: -4})')
# print(u)
# print(u == Vec({1,3,5,7},{1:1,3:2,5:3,7:4}))
# print('want True')
# print(-Vec({'a','b','c'}, {'a':1}) == Vec({'a','b','c'}, {'a':-1})
# print('want treu')
