// File: 0asa[P]TTree-source/RandomForest.cpp
// Function: RandomForest::learn()
double RandomForest::learn() {
	clock_t clock_start = clock();
	for (int t = 0 ; t < nbtree ; ++t) {
		term[t] = new ClassicTree(db,nmin,k);
		std::vector<unsigned int> bsls = Sampler::bootstrap((*ls));
		term[t]->setLearnFonction(NOTBESTFIRST);
		term[t]->setLS(&bsls);
		term[t]->setAttCand(cand);
		term[t]->learn();
		fprintf(_treeinfo, "Tree %03d - Complexity : %03d - ",t+1,term[t]->getComplexity());
		// 09-07-2012
		fprintf(_treeinfo, "MaxDepth : %03d - ",term[t]->getMaxDepth());
		Result result(db);
		result = test(t+1,ts);
		fprintf(_treeinfo,"Error rate : %f %%\n", result.getErrorRate());
		result.printProb(_treeinfo);
	}
	
	return (clock() - clock_start);	
}

// Assembly:
subq $0x138, %rsp            # imm = 0x138
movq %rdi, 0x130(%rsp)
movq 0x130(%rsp), %rax
movq %rax, 0x40(%rsp)
callq 0x3180
movq %rax, 0x128(%rsp)
movl $0x0, 0x124(%rsp)
movq 0x40(%rsp), %rcx
movl 0x124(%rsp), %eax
cmpl 0x58(%rcx), %eax
jae 0x2316a
movl $0x170, %edi            # imm = 0x170
callq 0x3270
movq %rax, %rdi
movq 0x40(%rsp), %rax
movq %rdi, %rcx
movq %rcx, 0x38(%rsp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
movl 0x5c(%rax), %ecx
callq 0x132d0
jmp 0x22ec4
movq 0x40(%rsp), %rax
movq 0x38(%rsp), %rsi
movq 0x60(%rax), %rcx
movslq 0x124(%rsp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x20(%rax), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x23850
movq 0x40(%rsp), %rax
movq 0x60(%rax), %rax
movslq 0x124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
xorl %esi, %esi
callq 0x167d0
jmp 0x22f0d
movq 0x40(%rsp), %rax
movq 0x60(%rax), %rax
movslq 0x124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x204d0
jmp 0x22f31
movq 0x40(%rsp), %rax
movq 0x30(%rax), %rsi
movq 0x60(%rax), %rax
movslq 0x124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x20510
jmp 0x22f51
movq 0x40(%rsp), %rax
movq 0x60(%rax), %rax
movslq 0x124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
jmp 0x22f70
movq 0x40(%rsp), %rcx
movq 0x60(%rcx), %rax
movq 0x68(%rcx), %rcx
movq %rcx, 0x28(%rsp)
movslq 0x124(%rsp), %rcx
movl %ecx, %edx
incl %edx
movl %edx, 0x30(%rsp)
movq (%rax,%rcx,8), %rdi
callq 0x20530
movl %eax, 0x34(%rsp)
jmp 0x22fa1
movl 0x34(%rsp), %ecx
movl 0x30(%rsp), %edx
movq 0x28(%rsp), %rdi
leaq 0xd946(%rip), %rsi      # 0x308fb
xorl %eax, %eax
callq 0x3360
movq 0x40(%rsp), %rcx
movq 0x60(%rcx), %rax
movq 0x68(%rcx), %rcx
movq %rcx, 0x18(%rsp)
movslq 0x124(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1c570
movl %eax, 0x24(%rsp)
jmp 0x22fe5
movl 0x24(%rsp), %edx
movq 0x18(%rsp), %rdi
leaq 0xd927(%rip), %rsi      # 0x3091c
xorl %eax, %eax
callq 0x3360
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x24ac0
jmp 0x23014
movq 0x40(%rsp), %rsi
movl 0x124(%rsp), %edx
incl %edx
movq 0x28(%rsi), %rcx
leaq 0x48(%rsp), %rdi
callq 0x231a0
jmp 0x23032
leaq 0xa0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x6fc0
jmp 0x23046
leaq 0x48(%rsp), %rdi
callq 0x24b00
movq 0x40(%rsp), %rax
movq 0x68(%rax), %rax
movq %rax, 0x8(%rsp)
leaq 0xa0(%rsp), %rdi
movsd 0xcfa2(%rip), %xmm0     # 0x30010
callq 0x24ba0
movsd %xmm0, 0x10(%rsp)
jmp 0x2307b
movsd 0x10(%rsp), %xmm0
movq 0x8(%rsp), %rdi
leaq 0xd3a3(%rip), %rsi      # 0x30430
movb $0x1, %al
callq 0x3360
movq 0x40(%rsp), %rax
movq 0x68(%rax), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x24b20
jmp 0x230ac
leaq 0xa0(%rsp), %rdi
callq 0x24b00
leaq 0xf8(%rsp), %rdi
callq 0x6830
movl 0x124(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x124(%rsp)
jmp 0x22e84
movq 0x38(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
movl $0x170, %esi            # imm = 0x170
callq 0x3280
jmp 0x23184
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
jmp 0x2315b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
jmp 0x2314e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x24b00
leaq 0xa0(%rsp), %rdi
callq 0x24b00
leaq 0xf8(%rsp), %rdi
callq 0x6830
jmp 0x23184
callq 0x3180
subq 0x128(%rsp), %rax
cvtsi2sd %rax, %xmm0
addq $0x138, %rsp            # imm = 0x138
retq
movq 0x118(%rsp), %rdi
callq 0x33e0
nopw %cs:(%rax,%rax)