// File: nikosgalanis[P]Vectors-Similarity-Search-and-Clustering/programs/Clustering/../../algorithms/Clustering/clustering.h
// Function: Clustering<double>::update()
void update(void) {
			// we want to keep a map containing the true values of the vectors, in order to find the median
			std::vector<std::vector<std::vector<T>>> centroids_map(k);
			// insert the vectors in the map
			for (int i = 0; i < n_points; i++) {
				int assigned = assigned_centroid.at(i);
				centroids_map.at(assigned).push_back(feature_vectors.at(i));
			}
			// for each centroid 
			for (int i = 0; i < k; i++) {
				// for each one of its dimenions
				for (int j = 0; j < (int)space_dim; j++) {
					vector<T> current_component;
					// parse through all of its assigned vectors in order to find the median
					for (int n = 0; n < (int)centroids_map.at(i).size(); n++) {
						current_component.push_back(centroids_map.at(i).at(n).at(j));
					}
					centroids.at(i).at(j) = our_math::median(current_component);
				}
			}
		}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x60(%rsp)
movslq (%rax), %rax
movq %rax, 0x68(%rsp)
leaq 0xd7(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0x17cb0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
leaq 0xd8(%rsp), %rdi
callq 0x17cc0
jmp 0x1571f
leaq 0xd7(%rsp), %rdi
callq 0x17d40
movl $0x0, 0xc0(%rsp)
movq 0x60(%rsp), %rcx
movl 0xc0(%rsp), %eax
cmpl 0x4(%rcx), %eax
jge 0x15818
movq 0x60(%rsp), %rdi
addq $0x60, %rdi
movslq 0xc0(%rsp), %rsi
callq 0xf110
movq %rax, 0x58(%rsp)
jmp 0x15769
movq 0x58(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xbc(%rsp)
movslq 0xbc(%rsp), %rsi
leaq 0xd8(%rsp), %rdi
callq 0x17d50
movq %rax, 0x50(%rsp)
jmp 0x15793
movq 0x60(%rsp), %rdi
addq $0x48, %rdi
movslq 0xc0(%rsp), %rsi
callq 0x6f30
movq %rax, 0x48(%rsp)
jmp 0x157b0
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0x34e0
jmp 0x157c1
jmp 0x157c3
movl 0xc0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc0(%rsp)
jmp 0x15737
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0xd7(%rsp), %rdi
callq 0x17d40
jmp 0x15a41
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
jmp 0x15a34
movl $0x0, 0xb8(%rsp)
movq 0x60(%rsp), %rcx
movl 0xb8(%rsp), %eax
cmpl (%rcx), %eax
jge 0x15a1f
movl $0x0, 0xb4(%rsp)
movq 0x60(%rsp), %rcx
movl 0xb4(%rsp), %eax
cmpl 0x8(%rcx), %eax
jge 0x15a07
leaq 0x98(%rsp), %rdi
callq 0x3460
movl $0x0, 0x94(%rsp)
movl 0x94(%rsp), %eax
movl %eax, 0x3c(%rsp)
movslq 0xb8(%rsp), %rsi
leaq 0xd8(%rsp), %rdi
callq 0x17d50
movq %rax, 0x40(%rsp)
jmp 0x15896
movq 0x40(%rsp), %rdi
callq 0x4df0
movq %rax, %rcx
movl 0x3c(%rsp), %eax
cmpl %ecx, %eax
jge 0x15942
movslq 0xb8(%rsp), %rsi
leaq 0xd8(%rsp), %rdi
callq 0x17d50
movq %rax, 0x30(%rsp)
jmp 0x158cb
movq 0x30(%rsp), %rdi
movslq 0x94(%rsp), %rsi
callq 0x6f30
movq %rax, 0x28(%rsp)
jmp 0x158e4
movq 0x28(%rsp), %rdi
movslq 0xb4(%rsp), %rsi
callq 0xb000
movq %rax, 0x20(%rsp)
jmp 0x158fd
movq 0x20(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0x3470
jmp 0x15911
jmp 0x15913
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x1586f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
jmp 0x159f8
leaq 0x78(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x45a0
jmp 0x15956
leaq 0x78(%rsp), %rdi
callq 0x17d90
movsd %xmm0, 0x18(%rsp)
jmp 0x15968
movq 0x60(%rsp), %rdi
addq $0x30, %rdi
movslq 0xb8(%rsp), %rsi
callq 0x6f30
movq %rax, 0x10(%rsp)
jmp 0x15985
movq 0x10(%rsp), %rdi
movslq 0xb4(%rsp), %rsi
callq 0xb000
movq %rax, 0x8(%rsp)
jmp 0x1599e
movq 0x8(%rsp), %rax
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x78(%rsp), %rdi
callq 0x3550
leaq 0x98(%rsp), %rdi
callq 0x3550
movl 0xb4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb4(%rsp)
jmp 0x15842
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x3550
leaq 0x98(%rsp), %rdi
callq 0x3550
jmp 0x15a34
jmp 0x15a09
movl 0xb8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb8(%rsp)
jmp 0x15823
leaq 0xd8(%rsp), %rdi
callq 0x17e20
addq $0xf8, %rsp
retq
leaq 0xd8(%rsp), %rdi
callq 0x17e20
movq 0xc8(%rsp), %rdi
callq 0x2400
nop