// File: 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
subq $0x300, %rsp            # imm = 0x300
movq %rsi, -0x2c0(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x2b8(%rbp)
leaq 0x7245(%rip), %rsi      # 0x1d1a1
leaq -0x220(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
movl $0x8, %edx
callq 0x9cb0
movq -0x2b0(%rbp), %rdi
callq 0x9ae0
movb %al, -0x2a1(%rbp)
jmp 0x15f88
movb -0x2a1(%rbp), %al
testb $0x1, %al
jne 0x1600b
jmp 0x15f94
movq 0x13035(%rip), %rdi     # 0x28fd0
leaq 0x71b3(%rip), %rsi      # 0x1d155
callq 0x9660
movq %rax, -0x2c8(%rbp)
jmp 0x15fb0
movq -0x2c0(%rbp), %rsi
movq -0x2c8(%rbp), %rdi
callq 0x95d0
movq %rax, -0x2d0(%rbp)
jmp 0x15fcc
movq -0x2d0(%rbp), %rdi
movq 0x12fce(%rip), %rsi     # 0x28fa8
callq 0x96b0
jmp 0x15fe1
movb $0x0, -0x1(%rbp)
movl $0x1, -0x230(%rbp)
jmp 0x16286
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x162a0
movq 0x12fbe(%rip), %rdi     # 0x28fd0
leaq 0x7191(%rip), %rsi      # 0x1d1aa
callq 0x9660
movq %rax, -0x2d8(%rbp)
jmp 0x16027
movq -0x2d8(%rbp), %rdi
movq 0x12f73(%rip), %rsi     # 0x28fa8
callq 0x96b0
jmp 0x1603c
movq -0x2b8(%rbp), %rdi
addq $0x18, %rdi
callq 0x16440
leaq -0x250(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x9960
movq -0x2e0(%rbp), %rsi
leaq -0x220(%rbp), %rdi
callq 0x90f0
jmp 0x16074
jmp 0x16076
jmp 0x16078
leaq -0x220(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x93a0
jmp 0x1608d
movq -0x220(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x220(%rbp,%rax), %rdi
callq 0x9cc0
movb %al, -0x2e1(%rbp)
jmp 0x160ad
movb -0x2e1(%rbp), %al
testb $0x1, %al
jne 0x160b9
jmp 0x160d5
jmp 0x1621d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x16278
leaq -0x278(%rbp), %rdi
callq 0x16340
movl $0x0, -0x27c(%rbp)
cmpl $0x269, -0x27c(%rbp)    # imm = 0x269
jge 0x16160
leaq -0x220(%rbp), %rdi
leaq -0x259(%rbp), %rsi
callq 0x98f0
jmp 0x1610c
leaq -0x220(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x9530
jmp 0x16121
leaq -0x278(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x16360
jmp 0x16136
jmp 0x16138
movl -0x27c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x27c(%rbp)
jmp 0x160eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x1620f
movq -0x2b8(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x2f0(%rbp)
leaq -0x2a0(%rbp), %rdi
leaq -0x260(%rbp), %rsi
leaq -0x278(%rbp), %rdx
callq 0x16400
jmp 0x1618e
movq -0x2f0(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x163d0
jmp 0x161a3
leaq -0x2a0(%rbp), %rdi
callq 0xa560
leaq -0x220(%rbp), %rdi
callq 0x9220
movl %eax, -0x2f4(%rbp)
jmp 0x161c3
movl -0x2f4(%rbp), %eax
cmpl $0xa, %eax
jne 0x161fe
leaq -0x220(%rbp), %rdi
callq 0x9800
jmp 0x161dc
jmp 0x161fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0xa560
jmp 0x1620f
leaq -0x278(%rbp), %rdi
callq 0xa580
jmp 0x16076
leaq -0x278(%rbp), %rdi
callq 0xa580
jmp 0x16278
leaq -0x220(%rbp), %rdi
callq 0x9120
jmp 0x1622b
movq 0x12d9e(%rip), %rdi     # 0x28fd0
leaq 0x6f89(%rip), %rsi      # 0x1d1c2
callq 0x9660
movq %rax, -0x300(%rbp)
jmp 0x16247
movq -0x300(%rbp), %rdi
movq 0x12d53(%rip), %rsi     # 0x28fa8
callq 0x96b0
jmp 0x1625c
movb $0x1, -0x1(%rbp)
movl $0x1, -0x230(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x93b0
jmp 0x16286
leaq -0x250(%rbp), %rdi
callq 0x93b0
jmp 0x162a0
leaq -0x220(%rbp), %rdi
callq 0x9170
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
leaq -0x220(%rbp), %rdi
callq 0x9170
movq -0x228(%rbp), %rdi
callq 0x9c10
nopl (%rax,%rax)