title: Eigen efficient inverse of symmetric positive definite matrix
body: <p>In Eigen, if we have symmetric positive definite matrix <code>A</code> then we can calculate the inverse of <code>A</code> by</p>
  
  <pre><code>A.inverse();
  </code></pre>
  
  <p>or</p>
  
  <pre><code>A.llt().solve(I);
  </code></pre>
  
  <p>where <code>I</code> is an identity matrix of the same size as <code>A</code>.  But is there a more efficient way to calculate the inverse of symmetric positive definite matrix?  </p>
  
  <p>For example if we write the Cholesky decomposition of <code>A</code> as <code>A = LL^{T}</code>, then <code>L^{-T} L^{-1}</code> is an inverse of <code>A</code> since <code>A L^{-T} L^{-1} = LL^{T} L^{-T} L^{-1} = I</code> (and where <code>L^{-T}</code> denotes the inverse of the transpose of <code>L</code>).</p>
  
  <p>So we could obtain the Cholesky decomposition of <code>A</code>, calculate its inverse, and then obtain the cross-product of that inverse to find the inverse of <code>A</code>.  But my instinct is that calculating these explicit steps will be slower than using <code>A.llt().solve(I)</code> as above.</p>
  
  <p>And before anybody asks, I do indeed need an explicit inverse - it is a calculation for part of a Gibbs sampler.</p>