// File: 0asa[P]TTree-source/ClassicNodeTree.cpp
// Function: ClassicNodeTree::computeGroupVimp()
void ClassicNodeTree::computeGroupVimp() {
	resetGroupVimp();
	Node* n = root;
	Score sc;
	//Scorer s(db);
	//ScoreInfo si;
	//std::vector<unsigned int> left;
	//std::vector<unsigned int> right;
	Stack stack;
	stack.push(n);
	while (!stack.empty()) {
		n = stack.pop();
		if (!n->isLeaf()) {
			std::vector<unsigned int> set = n->getLS();
			ContingencyTable ctable = ((TreeNodeTest*)n->getTest())->weak->test(&set).getContingencyTable(((TreeNodeTest*)n->getTest())->getTh());
			//ctable.print();
			ctable.compact(((TreeNodeTest*)n->getTest())->getTh()); // inappropié !
			int group = ((TreeNodeTest*)n->getTest())->getGroup();
			groupVimp[group] += sc.getMutualInfo(ctable)*set.size();
			//printf("setsize=%03d\tGroup\t%d\t%0.6f th=%0.6f\n",set.size(),group,sc.getMutualInfo(ctable)*set.size(),((TreeNodeTest*)n->getTest())->getTh());
			//printf("Score = %0.6f\n",sc.getScore(ctable));
			stack.push(n->getLeft());
			stack.push(n->getRight());
		}
	}
}

// Assembly:
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rdi, 0x1b0(%rsp)
movq 0x1b0(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x1cdc0
movq 0x80(%rsp), %rax
movq 0x50(%rax), %rax
movq %rax, 0x1a8(%rsp)
leaq 0x1a4(%rsp), %rdi
callq 0xcdf0
leaq 0x188(%rsp), %rdi
callq 0x2d660
jmp 0x10b74
movq 0x1a8(%rsp), %rsi
leaq 0x188(%rsp), %rdi
callq 0x2d680
jmp 0x10b8b
jmp 0x10b8d
leaq 0x188(%rsp), %rdi
callq 0x2d720
movb %al, 0x7f(%rsp)
jmp 0x10ba0
movb 0x7f(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x10baf
jmp 0x10ea6
leaq 0x188(%rsp), %rdi
callq 0x2d6d0
movq %rax, 0x70(%rsp)
jmp 0x10bc3
movq 0x70(%rsp), %rax
movq %rax, 0x1a8(%rsp)
movq 0x1a8(%rsp), %rdi
callq 0x21aa0
movb %al, 0x6f(%rsp)
jmp 0x10be3
movb 0x6f(%rsp), %al
testb $0x1, %al
jne 0x10ea1
jmp 0x10bf1
movq 0x1a8(%rsp), %rdi
callq 0xcba0
movq %rax, 0x60(%rsp)
jmp 0x10c05
movq 0x60(%rsp), %rsi
leaq 0x160(%rsp), %rdi
callq 0xcbb0
jmp 0x10c19
movq 0x1a8(%rsp), %rdi
callq 0x12660
movq %rax, 0x58(%rsp)
jmp 0x10c2d
movq 0x58(%rsp), %rax
movq 0x18(%rax), %rsi
movq (%rsi), %rax
movq 0x20(%rax), %rax
leaq 0x90(%rsp), %rdi
leaq 0x160(%rsp), %rdx
callq *%rax
jmp 0x10c51
movq 0x1a8(%rsp), %rdi
callq 0x12660
movq %rax, 0x50(%rsp)
jmp 0x10c65
movq 0x50(%rsp), %rdi
callq 0x12670
movsd %xmm0, 0x48(%rsp)
jmp 0x10c77
movsd 0x48(%rsp), %xmm0
leaq 0xe8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x24e90
jmp 0x10c94
leaq 0x90(%rsp), %rdi
callq 0x24b00
movq 0x1a8(%rsp), %rdi
callq 0x12660
movq %rax, 0x40(%rsp)
jmp 0x10cb5
movq 0x40(%rsp), %rdi
callq 0x12670
movsd %xmm0, 0x38(%rsp)
jmp 0x10cc7
movsd 0x38(%rsp), %xmm0
leaq 0xe8(%rsp), %rdi
callq 0x16f90
jmp 0x10cdc
movq 0x1a8(%rsp), %rdi
callq 0x12660
movq %rax, 0x30(%rsp)
jmp 0x10cf0
movq 0x30(%rsp), %rdi
callq 0x2dc20
movl %eax, 0x2c(%rsp)
jmp 0x10d00
movl 0x2c(%rsp), %eax
movl %eax, 0x8c(%rsp)
leaq 0x1a4(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x26a40
movsd %xmm0, 0x20(%rsp)
jmp 0x10d28
leaq 0x160(%rsp), %rdi
callq 0x8bf0
movq 0x80(%rsp), %rdi
movq %rax, %xmm0
movaps 0x1fa07(%rip), %xmm1    # 0x30750
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x1fa0b(%rip), %xmm1    # 0x30760
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
addq $0x68, %rdi
movslq 0x8c(%rsp), %rsi
callq 0xcda0
movsd 0x20(%rsp), %xmm0
movsd 0x10(%rsp), %xmm2
movsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movq 0x1a8(%rsp), %rdi
callq 0x21af0
movq %rax, 0x18(%rsp)
jmp 0x10dab
movq 0x18(%rsp), %rsi
leaq 0x188(%rsp), %rdi
callq 0x2d680
jmp 0x10dbf
movq 0x1a8(%rsp), %rdi
callq 0x21b00
movq %rax, 0x8(%rsp)
jmp 0x10dd3
movq 0x8(%rsp), %rsi
leaq 0x188(%rsp), %rdi
callq 0x2d680
jmp 0x10de7
leaq 0xe8(%rsp), %rdi
callq 0x16d70
leaq 0x160(%rsp), %rdi
callq 0x6830
jmp 0x10ea1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x180(%rsp)
movl %eax, 0x17c(%rsp)
jmp 0x10ed5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x180(%rsp)
movl %eax, 0x17c(%rsp)
jmp 0x10ec8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x180(%rsp)
movl %eax, 0x17c(%rsp)
jmp 0x10e92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x180(%rsp)
movl %eax, 0x17c(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x24b00
jmp 0x10e92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x180(%rsp)
movl %eax, 0x17c(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x16d70
leaq 0x160(%rsp), %rdi
callq 0x6830
jmp 0x10ec8
jmp 0x10b8d
leaq 0x188(%rsp), %rdi
callq 0x2d670
leaq 0x1a4(%rsp), %rdi
callq 0xd410
addq $0x1b8, %rsp            # imm = 0x1B8
retq
leaq 0x188(%rsp), %rdi
callq 0x2d670
leaq 0x1a4(%rsp), %rdi
callq 0xd410
movq 0x180(%rsp), %rdi
callq 0x33e0
nop