// File: toxaart[P]hierarchical_block_sparse_lib/test_source/test_matrix_operations.cc
// Function: void test_invchol<hbsm::HierarchicalBlockSparseMatrix<double>>()
static void test_invchol() {
  if (verbose)
    std::cout << "Test test_invchol()" << std::endl;
  MatrixType A;
  MatrixType Z;
  typename MatrixType::Params param;
  param.blocksize = 2;
 //set_block_size<MatrixType>(param, 2);//Has effect only for block sparse matrix
  A.set_params(param);
  A.resize(5, 5);
    {
      SparseMatrix tmp;
      set_row(tmp, 0, 5, 0, 1, 0, 0 );
      set_row(tmp, 1, 0, 6, 2, 0, 0 );
      set_row(tmp, 2, 1, 2, 5, 3, 0 );
      set_row(tmp, 3, 0, 0, 3, 8, 0 );
      set_row(tmp, 4, 0, 0, 0, 0, 7 );
      tmp.assign(A);
    }


    MatrixType::inv_chol(A, Z);
    MatrixType Z_ref;
    Z_ref.set_params(param);
    Z_ref.resize(5,5);
    {
      SparseMatrix tmp;
      set_row(tmp, 0, 0.447213595499958,                  0, -0.098373875367593,  0.060157954894827,                  0 );
      set_row(tmp, 1, 0,                  0.408248290463863, -0.163956458945988,  0.100263258158045,                  0 );
      set_row(tmp, 2, 0,                                  0,  0.491869376837965, -0.300789774474136,                  0 );
      set_row(tmp, 3, 0,                                  0,                  0,  0.414421467053253,                  0 );
      set_row(tmp, 4, 0,                                  0,                  0,                  0,  0.377964473009227 );
      tmp.assign(Z_ref);
    }
    verify_that_matrices_are_almost_equal(Z, Z_ref, 1e-10);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
leaq -0x88(%rbp), %rdi
callq 0x84d0
leaq -0x110(%rbp), %rdi
callq 0x84d0
jmp 0x8125
movl $0x2, -0x120(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x8570
jmp 0x8144
xorl %eax, %eax
movl %eax, %ecx
leaq -0x88(%rbp), %rdi
movl $0x5, %edx
movl %edx, %esi
callq 0x8600
jmp 0x815d
leaq -0x168(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x8750
movq -0x240(%rbp), %rdi
xorl %esi, %esi
movsd 0x2de97(%rip), %xmm0    # 0x36018
movsd 0x2de97(%rip), %xmm2    # 0x36020
xorps %xmm4, %xmm4
movaps %xmm4, %xmm1
movaps %xmm4, %xmm3
callq 0x352e0
jmp 0x8199
leaq -0x168(%rbp), %rdi
movl $0x1, %esi
movsd 0x2de7b(%rip), %xmm1    # 0x36028
movsd 0x2de53(%rip), %xmm2    # 0x36008
xorps %xmm4, %xmm4
movaps %xmm4, %xmm0
movaps %xmm4, %xmm3
callq 0x352e0
jmp 0x81c5
leaq -0x168(%rbp), %rdi
movl $0x2, %esi
movsd 0x2de47(%rip), %xmm0    # 0x36020
movsd 0x2de27(%rip), %xmm1    # 0x36008
movsd 0x2de2f(%rip), %xmm2    # 0x36018
movsd 0x2de1f(%rip), %xmm3    # 0x36010
xorps %xmm4, %xmm4
callq 0x352e0
jmp 0x81fb
leaq -0x168(%rbp), %rdi
movl $0x3, %esi
movsd 0x2de01(%rip), %xmm2    # 0x36010
movsd 0x2dec1(%rip), %xmm3    # 0x360d8
xorps %xmm4, %xmm4
movaps %xmm4, %xmm0
movaps %xmm4, %xmm1
callq 0x352e0
jmp 0x8227
leaq -0x168(%rbp), %rdi
movl $0x4, %esi
xorps %xmm3, %xmm3
movsd 0x2ddfa(%rip), %xmm4    # 0x36038
movaps %xmm3, %xmm0
movaps %xmm3, %xmm1
movaps %xmm3, %xmm2
callq 0x352e0
jmp 0x824e
leaq -0x168(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x8790
jmp 0x8263
leaq -0x168(%rbp), %rdi
callq 0x87d0
leaq -0x88(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x12b10
jmp 0x8284
leaq -0x1f0(%rbp), %rdi
callq 0x84d0
jmp 0x8292
leaq -0x1f0(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x8570
jmp 0x82a7
xorl %eax, %eax
movl %eax, %ecx
leaq -0x1f0(%rbp), %rdi
movl $0x5, %edx
movl %edx, %esi
callq 0x8600
jmp 0x82c0
leaq -0x238(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x8750
movq -0x248(%rbp), %rdi
xorl %esi, %esi
movsd 0x2df94(%rip), %xmm0    # 0x36278
movsd 0x2df94(%rip), %xmm2    # 0x36280
movsd 0x2df94(%rip), %xmm3    # 0x36288
xorps %xmm4, %xmm4
movaps %xmm4, %xmm1
callq 0x352e0
jmp 0x8301
leaq -0x238(%rbp), %rdi
movl $0x1, %esi
movsd 0x2df7b(%rip), %xmm1    # 0x36290
movsd 0x2df7b(%rip), %xmm2    # 0x36298
movsd 0x2df7b(%rip), %xmm3    # 0x362a0
xorps %xmm4, %xmm4
movaps %xmm4, %xmm0
callq 0x352e0
jmp 0x8332
leaq -0x238(%rbp), %rdi
movl $0x2, %esi
movsd 0x2df62(%rip), %xmm2    # 0x362a8
movsd 0x2df62(%rip), %xmm3    # 0x362b0
xorps %xmm4, %xmm4
movaps %xmm4, %xmm0
movaps %xmm4, %xmm1
callq 0x352e0
jmp 0x835e
leaq -0x238(%rbp), %rdi
movl $0x3, %esi
movsd 0x2df46(%rip), %xmm3    # 0x362b8
xorps %xmm4, %xmm4
movaps %xmm4, %xmm0
movaps %xmm4, %xmm1
movaps %xmm4, %xmm2
callq 0x352e0
jmp 0x8385
leaq -0x238(%rbp), %rdi
movl $0x4, %esi
xorps %xmm3, %xmm3
movsd 0x2df24(%rip), %xmm4    # 0x362c0
movaps %xmm3, %xmm0
movaps %xmm3, %xmm1
movaps %xmm3, %xmm2
callq 0x352e0
jmp 0x83ac
leaq -0x238(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x8790
jmp 0x83c1
leaq -0x238(%rbp), %rdi
callq 0x87d0
leaq -0x110(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
movsd 0x2de0d(%rip), %xmm0    # 0x361f0
callq 0x137f0
jmp 0x83ea
leaq -0x1f0(%rbp), %rdi
callq 0x11250
leaq -0x110(%rbp), %rdi
callq 0x11250
leaq -0x88(%rbp), %rdi
callq 0x11250
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
jmp 0x84a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
jmp 0x849d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x87d0
jmp 0x849d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
jmp 0x8491
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x118(%rbp)
movl %eax, -0x11c(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x87d0
leaq -0x1f0(%rbp), %rdi
callq 0x11250
leaq -0x110(%rbp), %rdi
callq 0x11250
leaq -0x88(%rbp), %rdi
callq 0x11250
movq -0x118(%rbp), %rdi
callq 0x2340
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)