<divclass="content sourceset-depenent-content"data-active=""data-togglable=":kmath-core:dokkaHtmlPartial/commonMain"><divclass="symbol monospace"><spanclass="token keyword"></span><spanclass="token keyword">fun </span><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="symmetric.html">T</a><spanclass="token operator"> : </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a><spanclass="token punctuation">, </span><spanclass="token keyword"></span><ahref="symmetric.html">A</a><spanclass="token operator"> : </span><ahref="../space.kscience.kmath.operations/-ring/index.html">Ring</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="symmetric.html">T</a><spanclass="token operator">></span><spanclass="token operator">></span><ahref="-matrix-builder/index.html">MatrixBuilder</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="symmetric.html">T</a><spanclass="token punctuation">, </span><spanclass="token keyword"></span><ahref="symmetric.html">A</a><spanclass="token operator">></span><spanclass="token punctuation">.</span><ahref="symmetric.html"><spanclass="token function">symmetric</span></a><spanclass="token punctuation">(</span>builder<spanclass="token operator">: </span><spanclass="token punctuation">(</span><spanclass="token keyword"></span>i<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token punctuation">, </span><spanclass="token keyword"></span>j<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token punctuation">)</span><spanclass="token operator"> -></span><spanclass="token keyword"></span><ahref="symmetric.html">T</a><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="index.html#-828842962%2FClasslikes%2F244675578">Matrix</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="symmetric.html">T</a><spanclass="token operator">></span><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><pclass="paragraph">Naive implementation of a symmetric matrix builder, that adds a <ahref="-symmetric-matrix-feature/index.html">SymmetricMatrixFeature</a> tag. The resulting matrix contains full <codeclass="lang-kotlin">size^2</code> number of elements, but caches elements during calls to save <ahref="symmetric.html">builder</a> calls. <ahref="symmetric.html">builder</a> is always called in the upper triangle region meaning that <codeclass="lang-kotlin">i <= j</code></p></div></div>