# Path: geomdl/linalg.py
# def vector_cross(vector1, vector2):
# def vector_dot(vector1, vector2):
# def vector_multiply(vector_in, scalar):
# def vector_sum(vector1, vector2, coeff=1.0):
# def vector_normalize(vector_in, decimals=18):
# def vector_generate(start_pt, end_pt, normalize=False):
# def vector_mean(*args):
# def vector_magnitude(vector_in):
# def vector_angle_between(vector1, vector2, **kwargs):
# def vector_is_zero(vector_in, tol=10e-8):
# def point_translate(point_in, vector_in):
# def point_distance(pt1, pt2):
# def point_mid(pt1, pt2):
# def matrix_identity(n):
# def matrix_pivot(m, sign=False):
# def matrix_inverse(m):
# def matrix_determinant(m):
# def matrix_transpose(m):
# def matrix_multiply(mat1, mat2):
# def matrix_scalar(m, sc):
# def triangle_normal(tri):
# def triangle_center(tri, uv=False):
# def binomial_coefficient(k, i):
# def lu_decomposition(matrix_a):
# def forward_substitution(matrix_l, matrix_b):
# def backward_substitution(matrix_u, matrix_y):
# def lu_solve(matrix_a, b):
# def lu_factor(matrix_a, b):
# def linspace(start, stop, num, decimals=18):
# def frange(start, stop, step=1.0):
# def convex_hull(points):
#     def cmp(a, b):
#     def turn(p, q, r):
#     def keep_left(hull, r):
# def is_left(point0, point1, point2):
# def wn_poly(point, vertices):


import pytest
from geomdl import linalg

def test_vector_normalize2():
    with pytest.raises(ValueError):
        vec = (0, 0)
        linalg.vector_normalize(vec)


def test_vector_normalize3():
    with pytest.raises(TypeError):
        linalg.vector_normalize(5)


def test_vector3_normalize():
    vec = (5, 2.5, 5)
    result = [0.667, 0.333, 0.667]
    to_check = linalg.vector_normalize(vec, decimals=3)
    assert to_check == result


def test_vector4_normalize():
    vec = (5, 2.5, 5, 10)
    result = [0.4, 0.2, 0.4, 0.8]
    to_check = linalg.vector_normalize(vec)
    assert to_check == result


def test_vector_generate1():
    with pytest.raises(ValueError):
        pt1 = ()
        pt2 = (1, 2, 3)

# Path: geomdl/linalg.py
# def vector_cross(vector1, vector2):
# def vector_dot(vector1, vector2):
# def vector_multiply(vector_in, scalar):
# def vector_sum(vector1, vector2, coeff=1.0):
# def vector_normalize(vector_in, decimals=18):
# def vector_generate(start_pt, end_pt, normalize=False):
# def vector_mean(*args):
# def vector_magnitude(vector_in):
# def vector_angle_between(vector1, vector2, **kwargs):
# def vector_is_zero(vector_in, tol=10e-8):
# def point_translate(point_in, vector_in):
# def point_distance(pt1, pt2):
# def point_mid(pt1, pt2):
# def matrix_identity(n):
# def matrix_pivot(m, sign=False):
# def matrix_inverse(m):
# def matrix_determinant(m):
# def matrix_transpose(m):
# def matrix_multiply(mat1, mat2):
# def matrix_scalar(m, sc):
# def triangle_normal(tri):
# def triangle_center(tri, uv=False):
# def binomial_coefficient(k, i):
# def lu_decomposition(matrix_a):
# def forward_substitution(matrix_l, matrix_b):
# def backward_substitution(matrix_u, matrix_y):
# def lu_solve(matrix_a, b):
# def lu_factor(matrix_a, b):
# def linspace(start, stop, num, decimals=18):
# def frange(start, stop, step=1.0):
# def convex_hull(points):
#     def cmp(a, b):
#     def turn(p, q, r):
#     def keep_left(hull, r):
# def is_left(point0, point1, point2):
# def wn_poly(point, vertices):


# Path: tests/test_linalg.py
import pytest
from geomdl import linalg


def test_vector_normalize2():
    with pytest.raises(ValueError):
        vec = (0, 0)
        linalg.vector_normalize(vec)


def test_vector_normalize3():
    with pytest.raises(TypeError):
        linalg.vector_normalize(5)


def test_vector3_normalize():
    vec = (5, 2.5, 5)
    result = [0.667, 0.333, 0.667]
    to_check = linalg.vector_normalize(vec, decimals=3)
    assert to_check == result


def test_vector4_normalize():
    vec = (5, 2.5, 5, 10)
    result = [0.4, 0.2, 0.4, 0.8]
    to_check = linalg.vector_normalize(vec)
    assert to_check == result


def test_vector_generate1():
    with pytest.raises(ValueError):
        pt1 = ()
        pt2 = (1, 2, 3)

        linalg.vector_generate(pt1, pt2)