<p>I don't know if the question is still relevant to you or not, but another solution to the question is to invert the coefficient matrix and then multiply the inverted matrix to the vector b. There are many matrix inversion algorithm. One such algorithm can be found in the following paper</p>

<p><a href="https://arxiv.org/pdf/1801.04723.pdf" rel="nofollow noreferrer">SPIN: A Fast and Scalable Matrix Inversion Method in Apache Spark</a></p>

<p>You can find the complete code on <a href="https://github.com/chandan-misra/Spark-Matrix-Inverse/blob/master/StrassenInverse.java" rel="nofollow noreferrer">GitHub link</a> also.</p>

<p>Cheers!!</p>
Solve system of linear equations in Spark
<p>I have a system of linear equations in the form of <code>Ax = b</code> to solve in Spark.</p>

<p><code>A</code> is <code>n by n</code></p>

<p><code>b</code> is <code>n by 1</code></p>

<p>I represent<code>A</code> in the form of <code>IndexedRowMatrix</code> or <code>RowMatrix</code> and <code>b</code> in the form of <code>DenseMatrix</code> or <code>DenseVector</code>.</p>

<p>How can I solve this system to calculate the <code>x</code> vector?</p>

<p>If the suggested solution is <a href="https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/linalg/CholeskyDecomposition.scala" rel="nofollow">Cholesky Decomposition</a>, would you please guide me through doing it as it is not part of the public API ? For example if the original matrix <code>A</code> is:</p>

<pre><code>1,2,3,4
2,1,5,6
3,5,1,7
4,6,7,1
</code></pre>

<p>and <code>b</code> is:</p>

<pre><code>5,6,7,8
</code></pre>

<p>What is passed as argument to the <code>solve</code> method ?</p>

<p>Any other solution other than inversing <code>A</code> would be very helpful.</p>