s="header-section-number">6.1</span> Compressed Row Storage</h2>
<p>Sparse matrices are represented in Stan using compressed row storage
(CSR). For example, the matrix <span class="math display">\[ A = \begin{bmatrix} 19 &amp; 27 &amp; 0 &amp; 0
\\ 0 &amp; 0 &amp; 0 &amp; 0 \\ 0 &amp; 0 &amp; 0 &amp; 52 \\ 81 &amp; 0 &amp; 95 &amp; 33 \end{bmatrix}
\]</span> is translated into a vector of the non-zero real values, read by
row from the matrix <span class="math inline">\(A\)</span>, <span class="math display"