def print_vec(text, a):
    """print the contents of a vector to the console"""
    n = a.shape[0]
    print('%s[ = (' % text, end='')
    for i in range(n):
        s = ' %g, ' % a[i]
        print(s, end='')
    print(')')
