# Path: umap/utils.py
# @numba.njit("i4(i8[:])")
# def tau_rand_int(state):
#     """A fast (pseudo)-random number generator.
# 
#     Parameters
#     ----------
#     state: array of int64, shape (3,)
#         The internal state of the rng
# 
#     Returns
#     -------
#     A (pseudo)-random int32 value
#     """
#     state[0] = (((state[0] & 4294967294) << 12) & 0xFFFFFFFF) ^ (
#         (((state[0] << 13) & 0xFFFFFFFF) ^ state[0]) >> 19
#     )
#     state[1] = (((state[1] & 4294967288) << 4) & 0xFFFFFFFF) ^ (
#         (((state[1] << 2) & 0xFFFFFFFF) ^ state[1]) >> 25
#     )
#     state[2] = (((state[2] & 4294967280) << 17) & 0xFFFFFFFF) ^ (
#         (((state[2] << 3) & 0xFFFFFFFF) ^ state[2]) >> 11
#     )
# 
#     return state[0] ^ state[1] ^ state[2]


import numpy as np
import numba
import umap.distances as dist
from umap.utils import tau_rand_int
from tqdm.auto import tqdm
                    * (weight_k * drk + weight_j * drj)
                    / (dens_mu[i] * dens_re_std)
                    / n_vertices
                )

            if dist_squared > 0.0:
                grad_coeff = -2.0 * a * b * pow(dist_squared, b - 1.0)
                grad_coeff /= a * pow(dist_squared, b) + 1.0
            else:
                grad_coeff = 0.0

            for d in range(dim):
                grad_d = clip(grad_coeff * (current[d] - other[d]))

                if densmap_flag:
                    # FIXME: grad_cor_coeff might be referenced before assignment

                    grad_d += clip(2 * grad_cor_coeff * (current[d] - other[d]))

                current[d] += grad_d * alpha
                if move_other:
                    other[d] += -grad_d * alpha

            epoch_of_next_sample[i] += epochs_per_sample[i]

            n_neg_samples = int(
                (n - epoch_of_next_negative_sample[i]) / epochs_per_negative_sample[i]
            )

            for p in range(n_neg_samples):

# Path: umap/utils.py
# @numba.njit("i4(i8[:])")
# def tau_rand_int(state):
#     """A fast (pseudo)-random number generator.
# 
#     Parameters
#     ----------
#     state: array of int64, shape (3,)
#         The internal state of the rng
# 
#     Returns
#     -------
#     A (pseudo)-random int32 value
#     """
#     state[0] = (((state[0] & 4294967294) << 12) & 0xFFFFFFFF) ^ (
#         (((state[0] << 13) & 0xFFFFFFFF) ^ state[0]) >> 19
#     )
#     state[1] = (((state[1] & 4294967288) << 4) & 0xFFFFFFFF) ^ (
#         (((state[1] << 2) & 0xFFFFFFFF) ^ state[1]) >> 25
#     )
#     state[2] = (((state[2] & 4294967280) << 17) & 0xFFFFFFFF) ^ (
#         (((state[2] << 3) & 0xFFFFFFFF) ^ state[2]) >> 11
#     )
# 
#     return state[0] ^ state[1] ^ state[2]


# Path: umap/layouts.py
import numpy as np
import numba
import umap.distances as dist
from umap.utils import tau_rand_int
from tqdm.auto import tqdm

                    * (weight_k * drk + weight_j * drj)
                    / (dens_mu[i] * dens_re_std)
                    / n_vertices
                )

            if dist_squared > 0.0:
                grad_coeff = -2.0 * a * b * pow(dist_squared, b - 1.0)
                grad_coeff /= a * pow(dist_squared, b) + 1.0
            else:
                grad_coeff = 0.0

            for d in range(dim):
                grad_d = clip(grad_coeff * (current[d] - other[d]))

                if densmap_flag:
                    # FIXME: grad_cor_coeff might be referenced before assignment

                    grad_d += clip(2 * grad_cor_coeff * (current[d] - other[d]))

                current[d] += grad_d * alpha
                if move_other:
                    other[d] += -grad_d * alpha

            epoch_of_next_sample[i] += epochs_per_sample[i]

            n_neg_samples = int(
                (n - epoch_of_next_negative_sample[i]) / epochs_per_negative_sample[i]
            )

            for p in range(n_neg_samples):

                k = tau_rand_int(rng_state) % n_vertices