Ejemplo n.º 1
0
def test_matrix_combination():
    n = 4
    x = v3.random_vector()
    y1 = v3.vector(x)
    matrix = v3.identity()
    for i in range(4):
        r_matrix = v3.random_matrix()
        y1 = v3.transform(r_matrix, y1)
        matrix = v3.combine(r_matrix, matrix)
    y2 = v3.transform(matrix, x)
    assert v3.is_similar_vector(y1, y2)
Ejemplo n.º 2
0
def test_matrix_combination():
  n = 4
  x = v3.random_vector()
  y1 = v3.vector(x)
  matrix = v3.identity()
  for i in range(4):
    r_matrix = v3.random_matrix()
    y1 = v3.transform(r_matrix, y1)
    matrix = v3.combine(r_matrix, matrix)
  y2 = v3.transform(matrix, x)
  assert v3.is_similar_vector(y1, y2)
Ejemplo n.º 3
0
def test_inverse():
    m = v3.random_matrix()
    m_left_inv = v3.left_inverse(m)
    assert v3.is_similar_matrix(v3.identity(), v3.combine(m_left_inv, m))
Ejemplo n.º 4
0
def test_inverse():
  m = v3.random_matrix()
  m_left_inv = v3.left_inverse(m)
  assert v3.is_similar_matrix(v3.identity(), v3.combine(m_left_inv, m))