<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-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><spanclass="parameters "><spanclass="parameter ">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></span></span><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="clearfix"><spanclass="floating-right">(<ahref="https://github.com/SciProgCentre/kmath/tree/master/kmath-core/src/commonMain/kotlin/space/kscience/kmath/linear/MatrixBuilder.kt#L59">source</a>)</span></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>