4 lines
11 KiB
HTML
4 lines
11 KiB
HTML
<!DOCTYPE html PUBLIC ""
|
||
"">
|
||
<html><head><meta charset="UTF-8" /><title>sparse-array.core documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Sparse-array</span> <span class="project-version">0.3.0</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to Sparse-array</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>sparse-array</span></div></div></li><li class="depth-2 branch current"><a href="sparse-array.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2"><a href="sparse-array.extract.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>extract</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="sparse-array.core.html#var-*safe-sparse-operations*"><div class="inner"><span>*safe-sparse-operations*</span></div></a></li><li class="depth-1"><a href="sparse-array.core.html#var-arity"><div class="inner"><span>arity</span></div></a></li><li class="depth-1"><a href="sparse-array.core.html#var-child-arity"><div class="inner"><span>child-arity</span></div></a></li><li class="depth-1"><a href="sparse-array.core.html#var-dense-array.3F"><div class="inner"><span>dense-array?</span></div></a></li><li class="depth-1"><a href="sparse-array.core.html#var-dense-dimensions"><div class="inner"><span>dense-dimensions</span></div></a></li><li class="depth-1"><a href="sparse-array.core.html#var-dense-to-sparse"><div class="inner"><span>dense-to-sparse</span></div></a></li><li class="depth-1"><a href="sparse-array.core.html#var-get"><div class="inner"><span>get</span></div></a></li><li class="depth-1"><a href="sparse-array.core.html#var-make-sparse-array"><div class="inner"><span>make-sparse-array</span></div></a></li><li class="depth-1"><a href="sparse-array.core.html#var-merge-arrays"><div class="inner"><span>merge-arrays</span></div></a></li><li class="depth-1"><a href="sparse-array.core.html#var-merge-dense-with-sparse"><div class="inner"><span>merge-dense-with-sparse</span></div></a></li><li class="depth-1"><a href="sparse-array.core.html#var-merge-sparse-arrays"><div class="inner"><span>merge-sparse-arrays</span></div></a></li><li class="depth-1"><a href="sparse-array.core.html#var-put"><div class="inner"><span>put</span></div></a></li><li class="depth-1"><a href="sparse-array.core.html#var-sparse-array.3F"><div class="inner"><span>sparse-array?</span></div></a></li><li class="depth-1"><a href="sparse-array.core.html#var-sparse-to-dense"><div class="inner"><span>sparse-to-dense</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">sparse-array.core</h1><div class="doc"><div class="markdown"><p>Operations on sparse arrays.</p></div></div><div class="public anchor" id="var-*safe-sparse-operations*"><h3>*safe-sparse-operations*</h3><h4 class="dynamic">dynamic</h4><div class="usage"></div><div class="doc"><div class="markdown"><p>Whether spase array operations should be conducted safely, with careful checking of data conventions and exceptions thrown if expectations are not met. Normally <code>false</code>.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/sparse-array/blob/master/src/sparse_array/core.clj#L6">view source</a></div></div><div class="public anchor" id="var-arity"><h3>arity</h3><div class="usage"><code>(arity x)</code></div><div class="doc"><div class="markdown"><p>Return the arity of the sparse array <code>x</code>.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/sparse-array/blob/master/src/sparse_array/core.clj#L299">view source</a></div></div><div class="public anchor" id="var-child-arity"><h3>child-arity</h3><div class="usage"><code>(child-arity x)</code></div><div class="doc"><div class="markdown"><p>Return the largest arity among the arities of the next dimension layer of the sparse array <code>x</code>.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/sparse-array/blob/master/src/sparse_array/core.clj#L304">view source</a></div></div><div class="public anchor" id="var-dense-array.3F"><h3>dense-array?</h3><div class="usage"><code>(dense-array? x)</code><code>(dense-array? x d)</code></div><div class="doc"><div class="markdown"><p>Basically, any vector can be considered as a dense array of one dimension. If we’re seeking a dense array of more than one dimension, the number of dimensions should be specified as <code>d</code>.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/sparse-array/blob/master/src/sparse_array/core.clj#L192">view source</a></div></div><div class="public anchor" id="var-dense-dimensions"><h3>dense-dimensions</h3><div class="usage"><code>(dense-dimensions x)</code></div><div class="doc"><div class="markdown"><p>How many usable dimensions (represented as vectors) does the dense array <code>x</code> have?</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/sparse-array/blob/master/src/sparse_array/core.clj#L177">view source</a></div></div><div class="public anchor" id="var-dense-to-sparse"><h3>dense-to-sparse</h3><div class="usage"><code>(dense-to-sparse x)</code><code>(dense-to-sparse x axes)</code></div><div class="doc"><div class="markdown"><p>Return a sparse array representing the content of the dense array <code>x</code>, assuming these <code>axes</code> if specified. <em>NOTE THAT</em> if insufficient values of <code>axes</code> are specified, the resulting sparse array will be malformed.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/sparse-array/blob/master/src/sparse_array/core.clj#L278">view source</a></div></div><div class="public anchor" id="var-get"><h3>get</h3><div class="usage"><code>(get array & coordinates)</code></div><div class="doc"><div class="markdown"><p>Return the value in this sparse <code>array</code> at these <code>coordinates</code>.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/sparse-array/blob/master/src/sparse_array/core.clj#L151">view source</a></div></div><div class="public anchor" id="var-make-sparse-array"><h3>make-sparse-array</h3><div class="usage"><code>(make-sparse-array & dimensions)</code></div><div class="doc"><div class="markdown"><p>Make a sparse array with these <code>dimensions</code>. Every member of <code>dimensions</code> must be a keyword; otherwise, <code>nil</code> will be returned.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/sparse-array/blob/master/src/sparse_array/core.clj#L17">view source</a></div></div><div class="public anchor" id="var-merge-arrays"><h3>merge-arrays</h3><div class="usage"><code>(merge-arrays a1 a2)</code></div><div class="doc"><div class="markdown"><p>Merge two arrays <code>a1</code>, <code>a2</code>, which may be either dense or sparse but which should have the same number of axes and compatible dimensions, and return a new dense array preferring values from <code>a2</code>.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/sparse-array/blob/master/src/sparse_array/core.clj#L246">view source</a></div></div><div class="public anchor" id="var-merge-dense-with-sparse"><h3>merge-dense-with-sparse</h3><div class="usage"><code>(merge-dense-with-sparse d s)</code></div><div class="doc"><div class="markdown"><p>Merge this dense array <code>d</code> with this sparse array <code>s</code>, returning a new dense array with the same arity as <code>d</code>, preferring values from <code>s</code> where there is conflict</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/sparse-array/blob/master/src/sparse_array/core.clj#L228">view source</a></div></div><div class="public anchor" id="var-merge-sparse-arrays"><h3>merge-sparse-arrays</h3><div class="usage"><code>(merge-sparse-arrays a1 a2)</code></div><div class="doc"><div class="markdown"><p>Return a sparse array taking values from sparse arrays <code>a1</code> and <code>a2</code>, but preferring values from <code>a2</code> where there is a conflict. <code>a1</code> and <code>a2</code> must have the <strong>same</strong> dimensions in the <strong>same</strong> order, or <code>nil</code> will be returned.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/sparse-array/blob/master/src/sparse_array/core.clj#L201">view source</a></div></div><div class="public anchor" id="var-put"><h3>put</h3><div class="usage"><code>(put array value & coordinates)</code></div><div class="doc"><div class="markdown"><p>Return a sparse array like this <code>array</code> but with this <code>value</code> at these <code>coordinates</code>. Returns <code>nil</code> if any coordinate is invalid.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/sparse-array/blob/master/src/sparse_array/core.clj#L109">view source</a></div></div><div class="public anchor" id="var-sparse-array.3F"><h3>sparse-array?</h3><div class="usage"><code>(sparse-array? x)</code><code>(sparse-array? x & axes)</code></div><div class="doc"><div class="markdown"><p><code>true</code> if <code>x</code> is a sparse array conforming to the conventions established by this library, else <code>false</code>.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/sparse-array/blob/master/src/sparse_array/core.clj#L43">view source</a></div></div><div class="public anchor" id="var-sparse-to-dense"><h3>sparse-to-dense</h3><div class="usage"><code>(sparse-to-dense x)</code><code>(sparse-to-dense x arity)</code></div><div class="doc"><div class="markdown"><p>Return a dense array representing the content of the sparse array <code>x</code>.</p>
|
||
<p><strong>NOTE THAT</strong> this has the potential to consume very large amounts of memory.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/sparse-array/blob/master/src/sparse_array/core.clj#L316">view source</a></div></div></div></body></html> |