// File: /workspace/github_cpp_makefile_star2_O2/liujan[P]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 0xe92(%rip), %rsi       # 0x6205
leaq -0x2a0(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x22b0
leaq -0x228(%rbp), %rdi
callq 0x2060
movl %eax, %r14d
testb %al, %al
je 0x54ab
movq 0x4c38(%rip), %rdi      # 0x9fd8
leaq 0xe67(%rip), %rsi       # 0x620e
callq 0x21a0
movq %rax, %rdi
callq 0x20f0
movb %r14b, -0x29(%rbp)
addq $0x18, %r15
movq %r15, -0x38(%rbp)
movq %r15, %rdi
callq 0x561a
leaq -0x88(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x2a0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x2040
leaq -0x2a0(%rbp), %r12
leaq -0x50(%rbp), %rbx
leaq -0x2a(%rbp), %r13
leaq -0x78(%rbp), %r14
movq %r12, %rdi
leaq -0x30(%rbp), %rsi
callq 0x2120
movq -0x2a0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x280(%rbp,%rax)
jne 0x54d3
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
andq $0x0, -0x40(%rbp)
movl $0x269, %r15d           # imm = 0x269
subl $0x1, %r15d
jb 0x5461
movq %r12, %rdi
movq %r13, %rsi
callq 0x2210
movq %r12, %rdi
movq %r14, %rsi
callq 0x2130
movq %rbx, %rdi
movq %r14, %rsi
callq 0x55f0
jmp 0x5438
movl -0x30(%rbp), %eax
movl %eax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
callq 0x2804
movq -0x38(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x577a
leaq -0x68(%rbp), %rdi
callq 0x2666
movq %r12, %rdi
callq 0x20b0
cmpl $0xa, %eax
jne 0x549e
movq %r12, %rdi
callq 0x2200
movq %rbx, %rdi
callq 0x2666
jmp 0x5401
movq 0x4b26(%rip), %rdi      # 0x9fd8
leaq 0xd00(%rip), %rsi       # 0x61b9
callq 0x21a0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
jmp 0x550a
leaq -0x2a0(%rbp), %rdi
callq 0x2050
movq 0x4af2(%rip), %rdi      # 0x9fd8
leaq 0xd39(%rip), %rsi       # 0x6226
callq 0x21a0
movq %rax, %rdi
callq 0x20f0
leaq -0x98(%rbp), %rdi
callq 0x20e0
movb -0x29(%rbp), %r14b
leaq -0x2a0(%rbp), %rdi
callq 0x2070
movl %r14d, %eax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5544
jmp 0x5544
movq %rax, %rbx
jmp 0x5563
jmp 0x554b
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x2666
jmp 0x554e
movq %rax, %rbx
jmp 0x5557
jmp 0x554b
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2666
leaq -0x98(%rbp), %rdi
callq 0x20e0
leaq -0x2a0(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2290
nop