# Path: umap/utils.py
# @numba.njit()
# def norm(vec):
#     """Compute the (standard l2) norm of a vector.
# 
#     Parameters
#     ----------
#     vec: array of shape (dim,)
# 
#     Returns
#     -------
#     The l2 norm of vec.
#     """
#     result = 0.0
#     for i in range(vec.shape[0]):
#         result += vec[i] ** 2
#     return np.sqrt(result)


import locale
import numba
import numpy as np
from umap.utils import norm
        return 0.0
    else:
        return float(n_features - num_true_true) / (n_features)


@numba.njit()
def sparse_sokal_michener(ind1, data1, ind2, data2, n_features):
    num_true_true = arr_intersect(ind1, ind2).shape[0]
    num_non_zero = arr_union(ind1, ind2).shape[0]
    num_not_equal = num_non_zero - num_true_true

    return (2.0 * num_not_equal) / (n_features + num_not_equal)


@numba.njit()
def sparse_sokal_sneath(ind1, data1, ind2, data2):
    num_true_true = arr_intersect(ind1, ind2).shape[0]
    num_non_zero = arr_union(ind1, ind2).shape[0]
    num_not_equal = num_non_zero - num_true_true

    if num_not_equal == 0.0:
        return 0.0
    else:
        return num_not_equal / (0.5 * num_true_true + num_not_equal)


@numba.njit()
def sparse_cosine(ind1, data1, ind2, data2):
    aux_inds, aux_data = sparse_mul(ind1, data1, ind2, data2)
    result = 0.0

# Path: umap/utils.py
# @numba.njit()
# def norm(vec):
#     """Compute the (standard l2) norm of a vector.
# 
#     Parameters
#     ----------
#     vec: array of shape (dim,)
# 
#     Returns
#     -------
#     The l2 norm of vec.
#     """
#     result = 0.0
#     for i in range(vec.shape[0]):
#         result += vec[i] ** 2
#     return np.sqrt(result)


# Path: umap/sparse.py
import locale
import numba
import numpy as np
from umap.utils import norm

        return 0.0
    else:
        return float(n_features - num_true_true) / (n_features)


@numba.njit()
def sparse_sokal_michener(ind1, data1, ind2, data2, n_features):
    num_true_true = arr_intersect(ind1, ind2).shape[0]
    num_non_zero = arr_union(ind1, ind2).shape[0]
    num_not_equal = num_non_zero - num_true_true

    return (2.0 * num_not_equal) / (n_features + num_not_equal)


@numba.njit()
def sparse_sokal_sneath(ind1, data1, ind2, data2):
    num_true_true = arr_intersect(ind1, ind2).shape[0]
    num_non_zero = arr_union(ind1, ind2).shape[0]
    num_not_equal = num_non_zero - num_true_true

    if num_not_equal == 0.0:
        return 0.0
    else:
        return num_not_equal / (0.5 * num_true_true + num_not_equal)


@numba.njit()
def sparse_cosine(ind1, data1, ind2, data2):
    aux_inds, aux_data = sparse_mul(ind1, data1, ind2, data2)
    result = 0.0

    norm1 = norm(data1)