// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/./Eigen/src/QR/ColPivHouseholderQR.h
// Function: Eigen::ColPivHouseholderQR<Eigen::Matrix<double, 3, 3, 0, 3, 3>>::compute(Eigen::Matrix<double, 3, 3, 0, 3, 3> const&)
ColPivHouseholderQR<MatrixType>& ColPivHouseholderQR<MatrixType>::compute(const MatrixType& matrix)
{
  check_template_parameters();
  
  using std::abs;
  Index rows = matrix.rows();
  Index cols = matrix.cols();
  Index size = matrix.diagonalSize();
  
  // the column permutation is stored as int indices, so just to be sure:
  eigen_assert(cols<=NumTraits<int>::highest());

  m_qr = matrix;
  m_hCoeffs.resize(size);

  m_temp.resize(cols);

  m_colsTranspositions.resize(matrix.cols());
  Index number_of_transpositions = 0;

  m_colSqNorms.resize(cols);
  for(Index k = 0; k < cols; ++k)
    m_colSqNorms.coeffRef(k) = m_qr.col(k).squaredNorm();

  RealScalar threshold_helper = m_colSqNorms.maxCoeff() * numext::abs2(NumTraits<Scalar>::epsilon()) / RealScalar(rows);

  m_nonzero_pivots = size; // the generic case is that in which all pivots are nonzero (invertible case)
  m_maxpivot = RealScalar(0);

  for(Index k = 0; k < size; ++k)
  {
    // first, we look up in our table m_colSqNorms which column has the biggest squared norm
    Index biggest_col_index;
    RealScalar biggest_col_sq_norm = m_colSqNorms.tail(cols-k).maxCoeff(&biggest_col_index);
    biggest_col_index += k;

    // since our table m_colSqNorms accumulates imprecision at every step, we must now recompute
    // the actual squared norm of the selected column.
    // Note that not doing so does result in solve() sometimes returning inf/nan values
    // when running the unit test with 1000 repetitions.
    biggest_col_sq_norm = m_qr.col(biggest_col_index).tail(rows-k).squaredNorm();

    // we store that back into our table: it can't hurt to correct our table.
    m_colSqNorms.coeffRef(biggest_col_index) = biggest_col_sq_norm;

    // Track the number of meaningful pivots but do not stop the decomposition to make
    // sure that the initial matrix is properly reproduced. See bug 941.
    if(m_nonzero_pivots==size && biggest_col_sq_norm < threshold_helper * RealScalar(rows-k))
      m_nonzero_pivots = k;

    // apply the transposition to the columns
    m_colsTranspositions.coeffRef(k) = biggest_col_index;
    if(k != biggest_col_index) {
      m_qr.col(k).swap(m_qr.col(biggest_col_index));
      std::swap(m_colSqNorms.coeffRef(k), m_colSqNorms.coeffRef(biggest_col_index));
      ++number_of_transpositions;
    }

    // generate the householder vector, store it below the diagonal
    RealScalar beta;
    m_qr.col(k).tail(rows-k).makeHouseholderInPlace(m_hCoeffs.coeffRef(k), beta);

    // apply the householder transformation to the diagonal coefficient
    m_qr.coeffRef(k,k) = beta;

    // remember the maximum absolute value of diagonal coefficients
    if(abs(beta) > m_maxpivot) m_maxpivot = abs(beta);

    // apply the householder transformation
    m_qr.bottomRightCorner(rows-k, cols-k-1)
        .applyHouseholderOnTheLeft(m_qr.col(k).tail(rows-k-1), m_hCoeffs.coeffRef(k), &m_temp.coeffRef(k+1));

    // update our table of squared norms of the columns
    m_colSqNorms.tail(cols-k-1) -= m_qr.row(k).tail(cols-k-1).cwiseAbs2();
  }

  m_colsPermutation.setIdentity(PermIndexType(cols));
  for(PermIndexType k = 0; k < size/*m_nonzero_pivots*/; ++k)
    m_colsPermutation.applyTranspositionOnTheRight(k, PermIndexType(m_colsTranspositions.coeff(k)));

  m_det_pq = (number_of_transpositions%2) ? -1 : 1;
  m_isInitialized = true;

  return *this;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %r13
movsd (%rsi), %xmm0
movsd %xmm0, (%rdi)
movsd 0x8(%rsi), %xmm0
movsd %xmm0, 0x8(%rdi)
movsd 0x10(%rsi), %xmm0
leaq 0x10(%rdi), %rax
movsd %xmm0, 0x10(%rdi)
movsd 0x18(%rsi), %xmm0
movsd %xmm0, 0x18(%rdi)
movsd 0x20(%rsi), %xmm0
movsd %xmm0, 0x20(%rdi)
movsd 0x28(%rsi), %xmm0
movsd %xmm0, 0x28(%rdi)
movsd 0x30(%rsi), %xmm0
movsd %xmm0, 0x30(%rdi)
movsd 0x38(%rsi), %xmm0
movsd %xmm0, 0x38(%rdi)
movsd 0x40(%rsi), %xmm0
movsd %xmm0, 0x40(%rdi)
leaq 0x88(%rdi), %rcx
movq %rcx, 0x98(%rsp)
leaq 0xa0(%rdi), %rcx
movq %rcx, 0x10(%rsp)
movl $0x14, %ecx
movsd -0x10(%rax), %xmm0
movsd -0x8(%rax), %xmm1
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
movsd (%rax), %xmm2
mulsd %xmm2, %xmm2
addsd %xmm1, %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, (%r13,%rcx,8)
incq %rcx
addq $0x18, %rax
cmpq $0x17, %rcx
jne 0x10d688
leaq 0x48(%r13), %rax
movq %rax, 0x90(%rsp)
movsd 0xb0(%r13), %xmm0
maxsd 0xa8(%r13), %xmm0
maxsd 0xa0(%r13), %xmm0
mulsd 0x4bff3(%rip), %xmm0    # 0x1596e0
divsd 0x46aeb(%rip), %xmm0    # 0x1541e0
movsd %xmm0, 0x88(%rsp)
movq $0x3, 0xd0(%r13)
movq $0x0, 0xc8(%r13)
leaq 0x8(%r13), %rdi
xorl %r14d, %r14d
movq %r13, %rbx
movq $0x0, 0x8(%rsp)
cmpq $0x2, %r14
jne 0x10d731
xorl %eax, %eax
jmp 0x10d76c
movq 0x10(%rsp), %rax
movsd (%rax,%r14,8), %xmm0
movl $0x15, %ecx
xorl %eax, %eax
leaq -0x14(%rcx), %rdx
movsd (%rbx,%rcx,8), %xmm1
ucomisd %xmm0, %xmm1
cmovaq %rdx, %rax
maxsd %xmm0, %xmm1
leaq (%r14,%rcx), %rdx
incq %rdx
incq %rcx
movapd %xmm1, %xmm0
cmpq $0x17, %rdx
jne 0x10d743
leaq (%rax,%r14), %rcx
cmpq $0x3, %rcx
jae 0x10daaf
leaq (%rcx,%rcx,2), %rdx
leaq (,%rdx,8), %rdx
addq %r13, %rdx
movsd (%rdx,%r14,8), %xmm0
mulsd %xmm0, %xmm0
cmpq $0x2, %r14
movq %rdi, 0xb8(%rsp)
je 0x10d7c2
leaq (%rax,%rax,2), %rsi
leaq (%rdi,%rsi,8), %rsi
movq %r14, %rdi
movsd (%rsi,%rdi,8), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rdi
cmpq $0x2, %rdi
jne 0x10d7ac
movl $0x3, %esi
subq %r14, %rsi
movsd %xmm0, 0xa0(%r13,%rcx,8)
cmpq $0x3, 0xd0(%r13)
jne 0x10d7fb
xorps %xmm1, %xmm1
cvtsi2sd %esi, %xmm1
mulsd 0x88(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x10d7fb
movq %r14, 0xd0(%r13)
movq %rcx, 0x70(%r13,%r14,8)
testq %rax, %rax
je 0x10d87c
leaq (%r14,%r14,2), %rax
movsd (%r13,%rax,8), %xmm0
movsd (%rdx), %xmm1
movsd %xmm1, (%r13,%rax,8)
movsd %xmm0, (%rdx)
movsd 0x8(%r13,%rax,8), %xmm0
movsd 0x8(%rdx), %xmm1
movsd %xmm1, 0x8(%r13,%rax,8)
movsd %xmm0, 0x8(%rdx)
movsd 0x10(%r13,%rax,8), %xmm0
movsd 0x10(%rdx), %xmm1
movsd %xmm1, 0x10(%r13,%rax,8)
movsd %xmm0, 0x10(%rdx)
movsd 0xa0(%r13,%r14,8), %xmm0
movsd 0xa0(%r13,%rcx,8), %xmm1
movsd %xmm1, 0xa0(%r13,%r14,8)
movsd %xmm0, 0xa0(%r13,%rcx,8)
incq 0x8(%rsp)
leaq (%r14,%r14,2), %rax
leaq (,%rax,8), %r15
addq %r13, %r15
leaq (%r15,%r14,8), %rbp
movq %rbp, 0x18(%rsp)
movq %rsi, 0xb0(%rsp)
movq %rsi, 0x20(%rsp)
movq %r15, 0x30(%rsp)
movq %r13, 0x40(%rsp)
movl $0x3, %eax
movq %rax, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movq 0x90(%rsp), %rax
leaq (%rax,%r14,8), %rsi
leaq 0x18(%rsp), %rdi
movq %rsi, 0xa0(%rsp)
leaq 0xc0(%rsp), %rdx
callq 0x10dace
movsd 0xc0(%rsp), %xmm0
movsd %xmm0, (%rbp)
andpd 0x4179a(%rip), %xmm0    # 0x14f090
ucomisd 0xc8(%r13), %xmm0
jbe 0x10d90a
movsd %xmm0, 0xc8(%r13)
movl $0x2, %ebp
subq %r14, %rbp
leaq 0x1(%r14), %rax
movq %rax, 0xa8(%rsp)
leaq 0x8(,%r14,8), %rax
leaq (%rax,%rax,2), %r12
leaq (%r13,%r12), %rax
leaq (%rax,%r14,8), %rax
movq %rax, 0x60(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x68(%rsp)
movq %rbp, 0x70(%rsp)
movq %r13, 0x78(%rsp)
movl $0x3, %ecx
movq %rcx, 0x80(%rsp)
leaq 0x8(%r15,%r14,8), %rax
movq %rax, 0x18(%rsp)
movq %rbp, 0x20(%rsp)
movq %r15, 0x30(%rsp)
movq %r13, 0x40(%rsp)
movq %rcx, 0x48(%rsp)
movq %rcx, 0x50(%rsp)
movq 0x98(%rsp), %rax
leaq 0x8(%rax,%r14,8), %rcx
leaq 0x60(%rsp), %rdi
leaq 0x18(%rsp), %r15
movq %r15, %rsi
movq 0xa0(%rsp), %rdx
callq 0x10db7c
leaq (,%r14,8), %rax
addq %r13, %rax
addq %rax, %r12
movq %r12, 0x18(%rsp)
movq %rbp, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movq %r13, 0x40(%rsp)
movl $0x1, %eax
movq %rax, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movq 0x10(%rsp), %rcx
leaq 0x8(%rcx,%r14,8), %rax
movq %rax, 0x60(%rsp)
movq %rbp, 0x70(%rsp)
movq %rcx, 0x78(%rsp)
movl $0x3, %r12d
movq %r12, 0x80(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0xc8(%rsp)
leaq 0x7(%rsp), %rax
movq %rax, 0xd0(%rsp)
leaq 0xc8(%rsp), %rdi
movq %r15, %rsi
callq 0x10e5de
addq $0x8, %rbx
movq 0xb8(%rsp), %rdi
addq $0x18, %rdi
movq 0xa8(%rsp), %rax
movq %rax, %r14
cmpq %r12, %rax
jne 0x10d727
leaq 0x60(%r13), %r14
xorl %eax, %eax
movl %eax, 0x60(%r13,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x10da52
xorl %r15d, %r15d
movl 0x70(%r13,%r15,8), %edx
movq %r14, %rdi
movl %r15d, %esi
callq 0x10e04a
incq %r15
cmpq $0x3, %r15
jne 0x10da63
movq 0x8(%rsp), %rax
andl $0x1, %eax
negq %rax
orq $0x1, %rax
movq %rax, 0xd8(%r13)
movb $0x1, 0xb8(%r13)
movq %r13, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4be70(%rip), %rdi     # 0x159926
leaq 0x4bf10(%rip), %rsi     # 0x1599cd
leaq 0x4bf22(%rip), %rcx     # 0x1599e6
movl $0x77, %edx
callq 0x4290