// File: nikosgalanis[P]Vectors-Similarity-Search-and-Clustering/programs/Hypercube/../../algorithms/Search/Hypercube/headers/../../LSH/headers/hashing.h
// Function: lsh::HashFunction::HashFunction(int, double, unsigned int, unsigned int)
HashFunction(int dim, double w, uint32_t m, uint32_t M) : dim(dim), w(w), s(dim, 0), m(m), M(M), const_m_values(dim) {
				// we want to use a uniform real distributor, thus we must initialize it
				// we want to randomize the input each time
				std::random_device mch;
				std::default_random_engine generator(mch());
				std::uniform_real_distribution<double> distribution(0.0, w);
				// initialize the random vector in the space `dim` using the uniform distribution
				for (int i = 0; i < this->dim; i++) {
					s.at(i) = distribution(generator);
				}

				// initialize the const m vector
				for (int i = 0; i < this->dim; i++) {
					const_m_values[i] = our_math::modular_power(m, i, M);
				}
			}

// Assembly:
subq $0x1448, %rsp           # imm = 0x1448
movq %rdi, 0x1440(%rsp)
movl %esi, 0x143c(%rsp)
movsd %xmm0, 0x1430(%rsp)
movl %edx, 0x142c(%rsp)
movl %ecx, 0x1428(%rsp)
movq 0x1440(%rsp), %rax
movq %rax, 0x40(%rsp)
movl 0x143c(%rsp), %ecx
movl %ecx, (%rax)
movsd 0x1430(%rsp), %xmm0
movsd %xmm0, 0x8(%rax)
addq $0x10, %rax
movq %rax, 0x48(%rsp)
movslq 0x143c(%rsp), %rax
movq %rax, 0x50(%rsp)
movq $0x0, 0x1420(%rsp)
leaq 0x141f(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x36f0
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rcx
leaq 0x1420(%rsp), %rdx
callq 0xa5b0
jmp 0x9b33
leaq 0x141f(%rsp), %rdi
callq 0x46f0
movq 0x40(%rsp), %rax
movl 0x142c(%rsp), %ecx
movl %ecx, 0x28(%rax)
movl 0x1428(%rsp), %ecx
movl %ecx, 0x2c(%rax)
addq $0x30, %rax
movq %rax, 0x28(%rsp)
movslq 0x143c(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x140b(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xa630
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0xa640
jmp 0x9b97
leaq 0x140b(%rsp), %rdi
callq 0xa6c0
leaq 0x80(%rsp), %rdi
callq 0x9e70
jmp 0x9bb3
leaq 0x80(%rsp), %rdi
callq 0x9f10
movl %eax, 0x24(%rsp)
jmp 0x9bc6
movl 0x24(%rsp), %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x78(%rsp), %rdi
callq 0x9f20
jmp 0x9bda
movsd 0x1430(%rsp), %xmm1
leaq 0x68(%rsp), %rdi
xorps %xmm0, %xmm0
callq 0xa6d0
jmp 0x9bf2
movl $0x0, 0x64(%rsp)
movq 0x40(%rsp), %rcx
movl 0x64(%rsp), %eax
cmpl (%rcx), %eax
jge 0x9ce0
leaq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0xa700
movsd %xmm0, 0x18(%rsp)
jmp 0x9c22
movq 0x40(%rsp), %rdi
addq $0x10, %rdi
movslq 0x64(%rsp), %rsi
callq 0xa730
movq %rax, 0x10(%rsp)
jmp 0x9c3c
movq 0x10(%rsp), %rax
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x9bfa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1410(%rsp)
movl %eax, 0x140c(%rsp)
leaq 0x141f(%rsp), %rdi
callq 0x46f0
jmp 0x9d61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1410(%rsp)
movl %eax, 0x140c(%rsp)
leaq 0x140b(%rsp), %rdi
callq 0xa6c0
jmp 0x9d57
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1410(%rsp)
movl %eax, 0x140c(%rsp)
jmp 0x9d4d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1410(%rsp)
movl %eax, 0x140c(%rsp)
leaq 0x80(%rsp), %rdi
callq 0xa340
jmp 0x9d4d
movl $0x0, 0x60(%rsp)
movq 0x40(%rsp), %rcx
movl 0x60(%rsp), %eax
cmpl (%rcx), %eax
jge 0x9d38
movl 0x142c(%rsp), %edi
movl 0x60(%rsp), %esi
movl 0x1428(%rsp), %edx
callq 0xa770
movl %eax, 0xc(%rsp)
jmp 0x9d12
movq 0x40(%rsp), %rdi
addq $0x30, %rdi
movslq 0x60(%rsp), %rsi
callq 0xa7e0
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
movl 0x60(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x9ce8
leaq 0x80(%rsp), %rdi
callq 0xa340
addq $0x1448, %rsp           # imm = 0x1448
retq
movq 0x28(%rsp), %rdi
callq 0xa800
movq 0x48(%rsp), %rdi
callq 0x3510
movq 0x1410(%rsp), %rdi
callq 0x23c0
nop