// File: /workspace/github_cpp_makefile_star2_O2/liujan[P]MPI_multi_thread_randomforest/RandomForest.cpp
// Function: RandomForest::readTestSample(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool RandomForest::readTestSample(string file){
	ifstream test("test.csv");
	if (!test.is_open()){
		cout << "[Error] : Failed to open file " << file << endl;
		return false;
	}
	cout << "reading test sample ..." << endl;
	test_samples.clear();
	string s;
	getline(test, s); //���˵���һ�б�ǩ

	double value;
	char dot;
	int id;

	while (true) {
		test >> id;
		if (test.eof())
			break;

		vector<double> features;
		for (int i = 0; i < numOfFeatures; i++){
			test >> dot;
			test >> value;
			features.push_back(value);
		}

		test_samples.push_back(make_pair(id, features));

		if (test.peek() == '\n')
			test.get();
	}

	test.close();
	cout << "reading test sample successful" << endl;
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xda3(%rip), %rsi       # 0x61bc
leaq -0x2a0(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x2370
leaq -0x228(%rbp), %rdi
callq 0x2070
movl %eax, %r14d
testb %al, %al
je 0x5551
movq 0x4b8a(%rip), %rdi      # 0x9fd0
leaq 0xd78(%rip), %rsi       # 0x61c5
callq 0x21e0
movq %rax, %rdi
callq 0x2110
movb %r14b, -0x29(%rbp)
addq $0x18, %r15
movq %r15, -0x38(%rbp)
movq %r15, %rdi
callq 0x5692
leaq -0x88(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x2a0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x2050
leaq -0x2a0(%rbp), %r12
leaq -0x50(%rbp), %rbx
leaq -0x2a(%rbp), %r13
leaq -0x78(%rbp), %r14
movq %r12, %rdi
leaq -0x30(%rbp), %rsi
callq 0x2140
movq -0x2a0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x280(%rbp,%rax)
jne 0x5579
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
andq $0x0, -0x40(%rbp)
movl $0x269, %r15d           # imm = 0x269
subl $0x1, %r15d
jb 0x5507
movq %r12, %rdi
movq %r13, %rsi
callq 0x2290
movq %r12, %rdi
movq %r14, %rsi
callq 0x2150
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5668
jmp 0x54de
movl -0x30(%rbp), %eax
movl %eax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
callq 0x28c4
movq -0x38(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x57b4
leaq -0x68(%rbp), %rdi
callq 0x2726
movq %r12, %rdi
callq 0x20d0
cmpl $0xa, %eax
jne 0x5544
movq %r12, %rdi
callq 0x2260
movq %rbx, %rdi
callq 0x2726
jmp 0x54a7
movq 0x4a78(%rip), %rdi      # 0x9fd0
leaq 0xc11(%rip), %rsi       # 0x6170
callq 0x21e0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21c0
movq %rax, %rdi
callq 0x2110
jmp 0x55b0
leaq -0x2a0(%rbp), %rdi
callq 0x2060
movq 0x4a44(%rip), %rdi      # 0x9fd0
leaq 0xc4a(%rip), %rsi       # 0x61dd
callq 0x21e0
movq %rax, %rdi
callq 0x2110
leaq -0x98(%rbp), %rdi
callq 0x2100
movb -0x29(%rbp), %r14b
leaq -0x2a0(%rbp), %rdi
callq 0x2080
movl %r14d, %eax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x55ea
jmp 0x55ea
movq %rax, %rbx
jmp 0x5609
jmp 0x55f1
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x2726
jmp 0x55f4
movq %rax, %rbx
jmp 0x55fd
jmp 0x55f1
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2726
leaq -0x98(%rbp), %rdi
callq 0x2100
leaq -0x2a0(%rbp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x2340
nop