def test_norma_1_r1(): assert norma(np.array([1])) == 1
def test_norma_nao_canonica_r2(): u = np.array([2**0.5, 0]) funcional_linear = lambda u, v: 2*u[0]*v[0] + u[0]*v[1] + u[1]*v[0] + u[1]*v[1] assert norma(u, funcional_linear = funcional_linear) == 2
def test_norma_0_1_r1(): assert norma(np.array([0, 1])) == np.linalg.norm(np.array([0, 1]))
def test_norma_canonica_r2(): u = np.array([2**0.5, 0]) assert norma(u) == 2**(0.5)
def test_norma_2_r1(): assert norma(np.array([2])) == 2