// File: /workspace/github_cpp_makefile_star2_O2/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, %r13d
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, %rbp
leaq 0x30(%rdi), %rax
movq %rax, 0x8(%rsp)
leaq 0x48(%rdi), %r14
leaq 0x60(%rdi), %r15
addq $0x78, %rdi
xorpd %xmm0, %xmm0
movupd %xmm0, 0x60(%rbp)
movupd %xmm0, 0x50(%rbp)
movupd %xmm0, 0x40(%rbp)
movupd %xmm0, 0x30(%rbp)
andq $0x0, 0x70(%rbp)
movq %rdi, 0x30(%rsp)
callq 0x29be
leaq 0x190(%rbp), %rax
movq %rax, 0x28(%rsp)
leaq 0x1a8(%rbp), %rax
movq %rax, 0x20(%rsp)
leaq 0x1c0(%rbp), %rax
movq %rax, 0x18(%rsp)
leaq 0x1d8(%rbp), %rax
movq %rax, 0x10(%rsp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x1e0(%rbp)
movupd %xmm0, 0x1d0(%rbp)
movupd %xmm0, 0x1c0(%rbp)
movupd %xmm0, 0x1b0(%rbp)
movupd %xmm0, 0x1a0(%rbp)
movupd %xmm0, 0x190(%rbp)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x1f8(%rbp)
movl %ebx, 0x200(%rbp)
leaq 0x208(%rbp), %rbx
movq %rbx, %rdi
callq 0x4278
movslq %r13d, %rsi
leaq 0x50(%rsp), %rdi
callq 0x439e
leaq 0x50(%rsp), %rsi
movl $0x1388, %edx           # imm = 0x1388
movq %rbx, %rdi
callq 0x21c0
cvtsi2sdl 0x200(%rbp), %xmm0
addsd %xmm0, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x2e2e
sqrtsd %xmm0, %xmm0
jmp 0x2e33
callq 0x21a0
movq 0x8(%rsp), %rbx
movsd 0x31d0(%rip), %xmm1     # 0x6010
divsd %xmm0, %xmm1
movapd 0x31e4(%rip), %xmm0     # 0x6030
xorpd %xmm1, %xmm0
movlpd %xmm0, 0x50(%rsp)
movsd %xmm1, 0x58(%rsp)
movslq (%r12), %rsi
movq %rbx, %rdi
callq 0x4282
movl (%r12), %edx
leaq 0x50(%rsp), %rcx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x42b8
movslq (%r12), %rsi
movq %r14, %rdi
callq 0x4282
movl (%r12), %edx
leaq 0x50(%rsp), %rcx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x42b8
movslq 0x4(%r12), %rsi
movq %r15, %rdi
callq 0x4282
movl 0x4(%r12), %edx
leaq 0x50(%rsp), %rcx
movq %rbp, %rdi
movq %r15, %rsi
callq 0x42b8
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x8(%rbp)
movsd %xmm0, 0x10(%rbp)
movabsq $0x3e45798ee2308c3a, %rax # imm = 0x3E45798EE2308C3A
movq %rax, 0x18(%rbp)
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x20(%rbp)
movslq 0x200(%rbp), %rsi
movq 0x28(%rsp), %rdi
callq 0x434a
movslq 0x200(%rbp), %rsi
movq 0x20(%rsp), %rdi
callq 0x434a
movslq 0x200(%rbp), %rsi
movq 0x18(%rsp), %rdi
callq 0x434a
pushq $0x3
popq %rsi
movq 0x10(%rsp), %rdi
callq 0x434a
addq $0x13d8, %rsp           # imm = 0x13D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2f42
jmp 0x2f42
movq %rax, %r12
jmp 0x2f77
movq %rax, %r12
movq 0x10(%rsp), %rdi
callq 0x4ac8
movq 0x18(%rsp), %rdi
callq 0x4ac8
movq 0x20(%rsp), %rdi
callq 0x4ac8
movq 0x28(%rsp), %rdi
callq 0x4ac8
movq 0x30(%rsp), %rdi
callq 0x34de
movq %r15, %rdi
callq 0x437c
movq %r14, %rdi
callq 0x437c
movq 0x8(%rsp), %rdi
callq 0x437c
movq %r12, %rdi
callq 0x2350
nop