title: fast cholesky factorization of an array of matrices
body: <p>I would like to know how to perform a fast Cholesky factorization on an array of matrices. Suppose I have a 3x3x1000 array A of pd matrices and would like to find cholesky factorzations of these 1000 matrices. I know I can easily write something like </p>
  
  <pre><code>for n=1:1000
      cl(:,:,n) = chol(A(:,:,n);
  end
  </code></pre>
  
  <p>However, because of the for loop this is a fairly slow procedure. Is there any way of speeding up this and avoiding the 'for' loop altogether. Any ideas are appreciated. </p>
  
  <p>One idea I had was to transform the array into a block diagonal matrix and take the chol factorization of it and hence would have a block matrix of cholesky factorizations, however I do not know yet how to perform this without having to create a full 3000x3000 matrix (and such matrix sizes could make the procedure slow as well). I am not familiar with using sparse matrices on matlab and maybe that could be one of the solutions. </p>