title: Crout LU decomposition in R
body: <p>Just wondering if anybody would share an implementation of the Crout algorithm for a LU decomposition (A = L * U) in R. There's a lu function in pracma library but uses Doolite instead.</p>
  <pre><code>&gt; A
       [,1] [,2] [,3]
  [1,]  -10   30   50
  [2,]   -6   16   22
  [3,]   -2    1   -5
  &gt; lu(A)
  $L
       [,1] [,2] [,3]
  [1,]  1.0  0.0    0
  [2,]  0.6  1.0    0
  [3,]  0.2  2.5    1
  
  $U
       [,1] [,2] [,3]
  [1,]  -10   30   50
  [2,]    0   -2   -8
  [3,]    0    0    5
  </code></pre>
  <p>Whereas for the Crout algorithm you'd get something like this instead:</p>
  <pre><code>$L
       [,1] [,2] [,3]
  [1,]  -10    0    0
  [2,]   -6   -2    0
  [3,]   -2   -5    5
  
  $U
       [,1] [,2] [,3]
  [1,]    1   -3   -5
  [2,]    0    1    4
  [3,]    0    0    1
  </code></pre>
  <p>I've been googling for something like that for a while but didn't found any working implementation in R.</p>
  <p>Thanks!</p>