-SparseArrayDOK{T,N}(storage::Union{AbstractDict,AbstractDictionary}, dims, unstored...)</code></pre><p>Construct an <code>N</code>-dimensional <a href="#SparseArraysBase.SparseArrayDOK"><code>SparseArrayDOK</code></a> containing elements of type <code>T</code>. Both <code>T</code> and <code>N</code> can either be supplied explicitly or be determined by the <code>storage</code> and the length or number of <code>dims</code>.</p><p>This constructor does not take ownership of the supplied storage, and will result in an independent container.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/ITensor/SparseArraysBase.jl/blob/d741b7fd473b7ca568bc94c2e45042cb6683324c/src/sparsearraydok.jl#L66-L77">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="SparseArraysBase.sparserand" href="#SparseArraysBase.sparserand"><code>SparseArraysBase.sparserand</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">sparserand([rng], [T::Type], dims; density::Real=0.5, randfun::Function=rand) -> A::SparseArrayDOK{T}</code></pre><p>Create a random size <code>dims</code> sparse array in which the probability of any element being stored is independently given by <code>density</code>. The optional <code>rng</code> argument specifies a random number generator, see also <code>Random</code>. The optional <code>T</code> argument specifies the element type, which defaults to <code>Float64</code>. The optional <code>randfun</code> argument can be used to control the type of random elements, and should support the signature <code>randfun(rng, T, N)</code> to generate <code>N</code> entries of type <code>T</code>.</p><p>See also <a href="#SparseArraysBase.sparserand!"><code>sparserand!</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/ITensor/SparseArraysBase.jl/blob/d741b7fd473b7ca568bc94c2e45042cb6683324c/src/abstractsparsearray.jl#L48-L59">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="SparseArraysBase.sparserand!" href="#SparseArraysBase.sparserand!"><code>SparseArraysBase.sparserand!</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">sparserand!([rng], A::AbstractArray; density::Real=0.5, randfun::Function=rand) -> A</code></pre><p>Overwrite part of an array with random entries, where the probability of overwriting is independently given by <code>density</code>. The optional <code>rng</code> argument specifies a random number generator, see also <code>Random</code>. The optional <code>randfun</code> argument can be used to control the type of random elements, and should support the signature <code>randfun(rng, T, N)</code> to generate <code>N</code> entries of type <code>T</code>.</p><p>See also <a href="#SparseArraysBase.sparserand"><code>sparserand</code></a>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/ITensor/SparseArraysBase.jl/blob/d741b7fd473b7ca568bc94c2e45042cb6683324c/src/abstractsparsearray.jl#L74-L83">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="SparseArraysBase.sparsezeros" href="#SparseArraysBase.sparsezeros"><code>SparseArraysBase.sparsezeros</code></a> — <span class="docstring-category">Function</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">sparsezeros([T::Type], dims) -> A::SparseArrayDOK{T}</code></pre><p>Create an empty size <code>dims</code> sparse array. The optional <code>T</code> argument specifies the element type, which defaults to <code>Float64</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/ITensor/SparseArraysBase.jl/blob/d741b7fd473b7ca568bc94c2e45042cb6683324c/src/abstractsparsearray.jl#L38-L43">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.1 on <span class="colophon-date" title="Tuesday 4 March 2025 15:30">Tuesday 4 March 2025</span>. Using Julia version 1.11.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
0 commit comments