// File: /workspace/github_cpp_makefile_star2_O1/KokiKishimoto[P]cp_decomposition/cp.cpp
// Function: CP::CP(Data&, int, int, double, double, double)
CP(Data& traindata, int vecDim_, int randomSeed, double learningRate, double threshold, double lambda_) : vecDim(vecDim_), lambda(lambda_) {
		op = SignalOperation();

		rnd = std::mt19937(randomSeed);
		double bnd = sqrt(6.0) / sqrt((double)vecDim * 2);
		std::uniform_real_distribution<> dist(-bnd, bnd);

		subjVec.resize(traindata.entity_counter);
		initializeModel(subjVec, traindata.entity_counter, dist);

		objVec.resize(traindata.entity_counter);
		initializeModel(objVec, traindata.entity_counter, dist);

		relationVec.resize(traindata.relation_counter);
		initializeModel(relationVec, traindata.relation_counter, dist);

		updater = Updater(learningRate, threshold);

		outVec1.resize(vecDim);
		outVec2.resize(vecDim);
		outVec3.resize(vecDim);

		norms.resize(3);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x13d8, %rsp           # imm = 0x13D8
movsd %xmm2, 0x48(%rsp)
movsd %xmm1, 0x40(%rsp)
movsd %xmm0, 0x38(%rsp)
movl %ecx, %ebx
movl %edx, %r12d
movq %rsi, %rbp
movq %rdi, %r13
leaq 0x30(%rdi), %rax
movq %rax, 0x28(%rsp)
leaq 0x48(%rdi), %r14
leaq 0x60(%rdi), %r15
addq $0x78, %rdi
xorpd %xmm0, %xmm0
movupd %xmm0, 0x60(%r13)
movupd %xmm0, 0x50(%r13)
movupd %xmm0, 0x40(%r13)
movupd %xmm0, 0x30(%r13)
movq $0x0, 0x70(%r13)
movq %rdi, 0x30(%rsp)
callq 0x2cd2
leaq 0x190(%r13), %rax
movq %rax, 0x20(%rsp)
leaq 0x1a8(%r13), %rax
movq %rax, 0x18(%rsp)
leaq 0x1c0(%r13), %rax
movq %rax, 0x10(%rsp)
leaq 0x1d8(%r13), %rax
movq %rax, 0x8(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x1e0(%r13)
movupd %xmm0, 0x1d0(%r13)
movupd %xmm0, 0x1c0(%r13)
movupd %xmm0, 0x1b0(%r13)
movupd %xmm0, 0x1a0(%r13)
movupd %xmm0, 0x190(%r13)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x1f8(%r13)
movl %r12d, 0x200(%r13)
leaq 0x208(%r13), %rdi
movq $0x1571, 0x208(%r13) # imm = 0x1571
movl $0x1571, %ecx           # imm = 0x1571
movl $0x42, %eax
movq %rcx, %rdx
shrq $0x1e, %rdx
xorl %ecx, %edx
imull $0x6c078965, %edx, %ecx # imm = 0x6C078965
addl %eax, %ecx
addl $-0x41, %ecx
movq %rcx, (%r13,%rax,8)
incq %rax
cmpq $0x2b1, %rax            # imm = 0x2B1
jne 0x3249
movq $0x270, 0x1588(%r13) # imm = 0x270
movl %ebx, %eax
movq %rax, 0x50(%rsp)
movl $0x1, %ecx
movq %rax, %rdx
shrq $0x1e, %rdx
xorl %eax, %edx
imull $0x6c078965, %edx, %eax # imm = 0x6C078965
addl %ecx, %eax
movq %rax, 0x50(%rsp,%rcx,8)
incq %rcx
cmpq $0x270, %rcx            # imm = 0x270
jne 0x3284
leaq 0x50(%rsp), %rsi
movq $0x270, 0x1380(%rsi) # imm = 0x270
movl $0x1388, %edx           # imm = 0x1388
callq 0x21e0
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
addsd %xmm0, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movq 0x28(%rsp), %rbx
jb 0x32e1
sqrtsd %xmm0, %xmm0
jmp 0x32e6
callq 0x21c0
movsd 0x3d22(%rip), %xmm1     # 0x7010
divsd %xmm0, %xmm1
movapd 0x3d36(%rip), %xmm0     # 0x7030
xorpd %xmm1, %xmm0
movlpd %xmm0, 0x50(%rsp)
movsd %xmm1, 0x58(%rsp)
movslq (%rbp), %rsi
movq %rbx, %rdi
callq 0x47ba
movl (%rbp), %edx
leaq 0x50(%rsp), %rcx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x47f6
movslq (%rbp), %rsi
movq %r14, %rdi
callq 0x47ba
movl (%rbp), %edx
leaq 0x50(%rsp), %rcx
movq %r13, %rdi
movq %r14, %rsi
callq 0x47f6
movslq 0x4(%rbp), %rsi
movq %r15, %rdi
callq 0x47ba
movl 0x4(%rbp), %edx
leaq 0x50(%rsp), %rcx
movq %r13, %rdi
movq %r15, %rsi
callq 0x47f6
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x8(%r13)
movsd %xmm0, 0x10(%r13)
movabsq $0x3e45798ee2308c3a, %rax # imm = 0x3E45798EE2308C3A
movq %rax, 0x18(%r13)
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x20(%r13)
movslq 0x200(%r13), %rsi
movq 0x20(%rsp), %rdi
callq 0x48a8
movslq 0x200(%r13), %rsi
movq 0x18(%rsp), %rdi
callq 0x48a8
movslq 0x200(%r13), %rsi
movq 0x10(%rsp), %rdi
callq 0x48a8
movl $0x3, %esi
movq 0x8(%rsp), %rdi
callq 0x48a8
addq $0x13d8, %rsp           # imm = 0x13D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
jmp 0x3469
movq %rax, %r12
movq 0x8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x340b
movq 0x1e8(%r13), %rsi
subq %rdi, %rsi
callq 0x2260
movq 0x10(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3427
movq 0x1d0(%r13), %rsi
subq %rdi, %rsi
callq 0x2260
movq 0x18(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3443
movq 0x1b8(%r13), %rsi
subq %rdi, %rsi
callq 0x2260
movq 0x20(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x345f
movq 0x1a0(%r13), %rsi
subq %rdi, %rsi
callq 0x2260
movq 0x30(%rsp), %rdi
callq 0x3bac
movq %r15, %rdi
callq 0x48da
movq %r14, %rdi
callq 0x48da
movq 0x28(%rsp), %rdi
callq 0x48da
movq %r12, %rdi
callq 0x23b0
nop