// File: jingdao[P]PointCloudApp/main.cpp
// Function: testEigenvalue()
void testEigenvalue() {
	int n=4;
	double A[4*4] = {0.35,0.09,-0.44,0.25,
					 0.45,0.07,-0.33,-0.32,
					 -0.14,-0.54,-0.03,-0.13,
					 -0.17,0.35,0.17,0.11};
	double lambda_real[4] = {};
	double lambda_imag[4] = {};
	double v[4*4] = {};
	Normal::eigenvalue(n,A,lambda_real,lambda_imag,v);
	printf("lambda: ");
	for (int i=0;i<n;i++)
		printf("%f+%fi ",lambda_real[i],lambda_imag[i]);
	printf("\n");
	for (int i=0;i<n;i++) {
		printf("v%d: ",i);
		for (int j=0;j<n;j++) {
			if (lambda_imag[i]==0)
				printf("%f ",v[i*n+j]);
			else if (lambda_imag[i]>0)
				printf("%f+%fi ",v[i*n+j],v[(i+1)*n+j]);
			else
				printf("%f+%fi ",v[(i-1)*n+j],-v[i*n+j]);

		}
		printf("\n");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movl $0x4, -0x4(%rbp)
leaq -0x90(%rbp), %rdi
leaq 0x109e0(%rip), %rsi     # 0x13010
movl $0x80, %edx
callq 0x2180
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2100
leaq -0xd0(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2100
leaq -0x150(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x2100
movl -0x4(%rbp), %edi
leaq -0x90(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
leaq -0xd0(%rbp), %rcx
leaq -0x150(%rbp), %r8
callq 0x11cd0
leaq 0x10ab2(%rip), %rdi     # 0x13150
movb $0x0, %al
callq 0x2050
movl $0x0, -0x154(%rbp)
movl -0x154(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x26f9
movslq -0x154(%rbp), %rax
movsd -0xb0(%rbp,%rax,8), %xmm0
movslq -0x154(%rbp), %rax
movsd -0xd0(%rbp,%rax,8), %xmm1
leaq 0x10a78(%rip), %rdi     # 0x13159
movb $0x2, %al
callq 0x2050
movl -0x154(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x154(%rbp)
jmp 0x26af
leaq 0x112e5(%rip), %rdi     # 0x139e5
movb $0x0, %al
callq 0x2050
movl $0x0, -0x158(%rbp)
movl -0x158(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x2890
movl -0x158(%rbp), %esi
leaq 0x10a34(%rip), %rdi     # 0x13161
movb $0x0, %al
callq 0x2050
movl $0x0, -0x15c(%rbp)
movl -0x15c(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x286e
movslq -0x158(%rbp), %rax
movsd -0xd0(%rbp,%rax,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2796
jp 0x2796
movl -0x158(%rbp), %eax
imull -0x4(%rbp), %eax
addl -0x15c(%rbp), %eax
cltq
movsd -0x150(%rbp,%rax,8), %xmm0
leaq 0x109dd(%rip), %rdi     # 0x13167
movb $0x1, %al
callq 0x2050
jmp 0x2858
movslq -0x158(%rbp), %rax
movsd -0xd0(%rbp,%rax,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x27f8
movl -0x158(%rbp), %eax
imull -0x4(%rbp), %eax
addl -0x15c(%rbp), %eax
cltq
movsd -0x150(%rbp,%rax,8), %xmm0
movl -0x158(%rbp), %eax
addl $0x1, %eax
imull -0x4(%rbp), %eax
addl -0x15c(%rbp), %eax
cltq
movsd -0x150(%rbp,%rax,8), %xmm1
leaq 0x1096a(%rip), %rdi     # 0x13159
movb $0x2, %al
callq 0x2050
jmp 0x2856
movl -0x158(%rbp), %eax
subl $0x1, %eax
imull -0x4(%rbp), %eax
addl -0x15c(%rbp), %eax
cltq
movsd -0x150(%rbp,%rax,8), %xmm0
movl -0x158(%rbp), %eax
imull -0x4(%rbp), %eax
addl -0x15c(%rbp), %eax
cltq
movsd -0x150(%rbp,%rax,8), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
leaq 0x1090a(%rip), %rdi     # 0x13159
movb $0x2, %al
callq 0x2050
jmp 0x2858
jmp 0x285a
movl -0x15c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x15c(%rbp)
jmp 0x273e
leaq 0x11170(%rip), %rdi     # 0x139e5
movb $0x0, %al
callq 0x2050
movl -0x158(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x158(%rbp)
jmp 0x2711
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopl (%rax)