99from graphblas .core .vector import Vector
1010
1111from cfpq_decomposer .abstract_decomposer import AbstractDecomposer
12- from cfpq_decomposer .constants import HASH_PRIME_MODULUS , HASH_COUNT , MIN_LSH_BUCKET_SIZE , SMALL_BUCKET_ID
12+ from cfpq_decomposer .constants import HASH_PRIME_MODULUS , HASH_FUNCTIONS_COUNT , MIN_LSH_BUCKET_SIZE , SMALL_BUCKET_ID
1313from cfpq_matrix .matrix_utils import drop_zeros_inplace
1414
1515
@@ -70,7 +70,7 @@ def _compute_row_hashes(matrix: Matrix) -> npt.NDArray[Any]:
7070 hash_weights = np .random .default_rng ().integers (
7171 low = 1 ,
7272 high = np .iinfo (np .int64 ).max ,
73- size = HASH_COUNT ,
73+ size = HASH_FUNCTIONS_COUNT ,
7474 dtype = np .int64
7575 )
7676 row_hashes = row_signatures_matrix .to_dense (fill_value = 0 ) @ hash_weights
@@ -79,13 +79,13 @@ def _compute_row_hashes(matrix: Matrix) -> npt.NDArray[Any]:
7979 @staticmethod
8080 def _compute_row_signatures_matrix (matrix : Matrix ) -> Matrix :
8181 num_rows , num_cols = matrix .shape
82- hash_coefficients = np .random .randint (1 , HASH_PRIME_MODULUS , size = HASH_COUNT , dtype = np .int64 )
83- hash_offsets = np .random .randint (0 , HASH_PRIME_MODULUS , size = HASH_COUNT , dtype = np .int64 )
82+ hash_coefficients = np .random .randint (1 , HASH_PRIME_MODULUS , size = HASH_FUNCTIONS_COUNT , dtype = np .int64 )
83+ hash_offsets = np .random .randint (0 , HASH_PRIME_MODULUS , size = HASH_FUNCTIONS_COUNT , dtype = np .int64 )
8484 column_indices = np .arange (num_cols , dtype = np .int64 )
8585 hash_matrix = Matrix .from_dense (
8686 (column_indices [:, None ] * hash_coefficients [None , :] + hash_offsets [None , :]) % HASH_PRIME_MODULUS
8787 )
88- row_signatures_matrix = Matrix (INT64 , num_rows , HASH_COUNT )
88+ row_signatures_matrix = Matrix (INT64 , num_rows , HASH_FUNCTIONS_COUNT )
8989 row_signatures_matrix << semiring .min_second (matrix @ hash_matrix )
9090 return row_signatures_matrix
9191
0 commit comments