// File: isaacbrodsky[P]K-means-plus-plus/k-means-multi.cpp
// Function: Cluster_set::Identify_mean_values()
void Cluster_set::Identify_mean_values(void){

	// local variables
	int iCluster_index, iAttribute_index;
	vector<float> vfValues;

	// allocate memory for the local vector
	vfValues.resize(iAttribute_ct);

	if (iIteration < 1) { // if this is the first iteration - initialize the cluster mean values
		if (bUsePlusPlus) {
			Initialize_plus_plus();
		}
		else { // Use the first k instances.
			for (iCluster_index = 0; iCluster_index < iK_count; iCluster_index++){ // read K-instances
				for (iAttribute_index = 0; iAttribute_index < iAttribute_ct; iAttribute_index++){ // read attributes
					vvfMeans[iCluster_index][iAttribute_index]
						= vclInput_data[iCluster_index].vfAttribute[iAttribute_index];
				} // for
			} //for
		}
	} // if

	// save the existing mean values
	for (iCluster_index = 0; iCluster_index < iK_count; iCluster_index++){
		for (iAttribute_index = 0; iAttribute_index < iAttribute_ct; iAttribute_index++){

			// copy the new_means values into the old_means values storage
			vvfOld_means[iCluster_index][iAttribute_index] = vvfMeans[iCluster_index][iAttribute_index];
		} // for
	} //for

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x28(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0xa0a0
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rdi
movslq 0x9c(%rax), %rsi
callq 0xa330
jmp 0x5ed7
movq -0x48(%rbp), %rax
cmpl $0x1, 0x98(%rax)
jge 0x5fb2
movq -0x48(%rbp), %rax
testb $0x1, 0xa1(%rax)
je 0x5f1f
movq -0x48(%rbp), %rdi
callq 0x6b30
jmp 0x5f00
jmp 0x5fb0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4c40
jmp 0x604d
movl $0x0, -0xc(%rbp)
movq -0x48(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x30(%rcx), %eax
jge 0x5fae
movl $0x0, -0x10(%rbp)
movq -0x48(%rbp), %rcx
movl -0x10(%rbp), %eax
cmpl 0x9c(%rcx), %eax
jge 0x5f9e
movq -0x48(%rbp), %rdi
addq $0x80, %rdi
movslq -0xc(%rbp), %rsi
callq 0xa5f0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0xa3c0
movq -0x48(%rbp), %rdi
movss (%rax), %xmm0
movss %xmm0, -0x4c(%rbp)
movslq -0xc(%rbp), %rsi
callq 0xa4e0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0xa3c0
movss -0x4c(%rbp), %xmm0
movss %xmm0, (%rax)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x5f39
jmp 0x5fa0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x5f26
jmp 0x5fb0
jmp 0x5fb2
movl $0x0, -0xc(%rbp)
movq -0x48(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x30(%rcx), %eax
jge 0x603e
movl $0x0, -0x10(%rbp)
movq -0x48(%rbp), %rcx
movl -0x10(%rbp), %eax
cmpl 0x9c(%rcx), %eax
jge 0x602e
movq -0x48(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0xa4e0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0xa3c0
movq -0x48(%rbp), %rdi
movss (%rax), %xmm0
movss %xmm0, -0x50(%rbp)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0xa4e0
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0xa3c0
movss -0x50(%rbp), %xmm0
movss %xmm0, (%rax)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x5fcc
jmp 0x6030
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x5fb9
leaq -0x28(%rbp), %rdi
callq 0x4c40
addq $0x50, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x4530
nopw %cs:(%rax,%rax)