Пример #1
0
def test_norma_1_r1():
    assert norma(np.array([1])) == 1
Пример #2
0
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
Пример #3
0
def test_norma_0_1_r1():
    assert norma(np.array([0, 1])) == np.linalg.norm(np.array([0, 1]))
Пример #4
0
def test_norma_canonica_r2():
    u = np.array([2**0.5, 0])
    assert norma(u) == 2**(0.5)
Пример #5
0
def test_norma_2_r1():
    assert norma(np.array([2])) == 2