-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtech.v3.datatype.argops.html
46 lines (46 loc) · 8.47 KB
/
tech.v3.datatype.argops.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>tech.v3.datatype.argops documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="highlight/solarized-light.css" /><script type="text/javascript" src="highlight/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> with <a href="https://github.com/xsc/codox-theme-rdash">RDash UI</a> theme</h2><h1><a href="index.html"><span class="project-title"><span class="project-name"></span> <span class="project-version">1.000-beta-20</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">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>tech</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>v3</span></div></div></li><li class="depth-3 branch"><a href="tech.v3.dataset.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>dataset</span></div></a></li><li class="depth-3"><a href="tech.v3.datatype.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>datatype</span></div></a></li><li class="depth-4 branch current"><a href="tech.v3.datatype.argops.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>argops</span></div></a></li><li class="depth-4"><a href="tech.v3.datatype.functional.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>functional</span></div></a></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>libs</span></div></div></li><li class="depth-4"><a href="tech.v3.libs.cljs-ajax.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cljs-ajax</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="tech.v3.datatype.argops.html#var-argfilter"><div class="inner"><span>argfilter</span></div></a></li><li class="depth-1"><a href="tech.v3.datatype.argops.html#var-arggroup"><div class="inner"><span>arggroup</span></div></a></li><li class="depth-1"><a href="tech.v3.datatype.argops.html#var-arglast-every"><div class="inner"><span>arglast-every</span></div></a></li><li class="depth-1"><a href="tech.v3.datatype.argops.html#var-argmax"><div class="inner"><span>argmax</span></div></a></li><li class="depth-1"><a href="tech.v3.datatype.argops.html#var-argmin"><div class="inner"><span>argmin</span></div></a></li><li class="depth-1"><a href="tech.v3.datatype.argops.html#var-argsort"><div class="inner"><span>argsort</span></div></a></li><li class="depth-1"><a href="tech.v3.datatype.argops.html#var-binary-search"><div class="inner"><span>binary-search</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">tech.v3.datatype.argops</h1><div class="doc"><div class="markdown"><p>Index-space algorithms. Implements a subset of the jvm-version.</p>
</div></div><div class="public anchor" id="var-argfilter"><h3>argfilter</h3><div class="usage"><code>(argfilter pred data)</code><code>(argfilter data)</code></div><div class="doc"><div class="markdown"><p>Return an array of indexes that pass the filter.</p>
</div></div><div class="src-link"><a href="https://github.com/cnuernber/tmdjs/blob/master/src/tech/v3/datatype/argops.cljs#L82">view source</a></div></div><div class="public anchor" id="var-arggroup"><h3>arggroup</h3><div class="usage"><code>(arggroup data)</code></div><div class="doc"><div class="markdown"><p>Return a map from value->indexes that hold that value.</p>
</div></div><div class="src-link"><a href="https://github.com/cnuernber/tmdjs/blob/master/src/tech/v3/datatype/argops.cljs#L118">view source</a></div></div><div class="public anchor" id="var-arglast-every"><h3>arglast-every</h3><div class="usage"><code>(arglast-every rdr pred)</code></div><div class="doc"><div class="markdown"><p>Return the last index where (pred (rdr idx) (rdr (dec idx))) was true by
comparing every value and keeping track of the last index where pred was true.</p>
</div></div><div class="src-link"><a href="https://github.com/cnuernber/tmdjs/blob/master/src/tech/v3/datatype/argops.cljs#L149">view source</a></div></div><div class="public anchor" id="var-argmax"><h3>argmax</h3><div class="usage"><code>(argmax rdr)</code></div><div class="doc"><div class="markdown"><p>Return the last index of the max item in the reader.</p>
</div></div><div class="src-link"><a href="https://github.com/cnuernber/tmdjs/blob/master/src/tech/v3/datatype/argops.cljs#L178">view source</a></div></div><div class="public anchor" id="var-argmin"><h3>argmin</h3><div class="usage"><code>(argmin rdr)</code></div><div class="doc"><div class="markdown"><p>Return the last index of the min item in the reader.</p>
</div></div><div class="src-link"><a href="https://github.com/cnuernber/tmdjs/blob/master/src/tech/v3/datatype/argops.cljs#L184">view source</a></div></div><div class="public anchor" id="var-argsort"><h3>argsort</h3><div class="usage"><code>(argsort compare-fn options data)</code><code>(argsort compare-fn data)</code><code>(argsort data)</code></div><div class="doc"><div class="markdown"><p>Return an array of indexes that order the provided data by compare-fn. compare-fn must
be a boolean function such as < or >. You can use a full custom comparator returning
-1,0 or 1 by using the <code>:comparator</code> option.</p>
<ul>
<li><code>compare-fn</code> - Boolean binary predicate such as < or >.</li>
</ul>
<p>Options:</p>
<ul>
<li><code>:nan-strategy</code> - defaults to <code>:last</code> - if the data has a numeric elemwise-datatype, a
nan-aware comparsing will be used that will place nan data first, last, or throw an exception
as specified by the three possible options - <code>:first</code>, <code>:last</code>, and <code>:exception</code>.</li>
<li><code>:comparator</code> - comparator to use. This overrides compare-fn and takes two arguments
but returns a number.</li>
</ul>
<p>Examples:</p>
<pre><code class="language-clojure">cljs.user> ;;Persistent vectors do not indicate datatype so nan-aware comparison is disabled.
cljs.user> (argops/argsort [##NaN 1 2 3 ##NaN])
#typed-buffer[[:int32 5][0 1 2 3 4]
cljs.user> ;;But with a container that indicates datatype nan will be handled
cljs.user> (argops/argsort (dtype/make-container :float32 [##NaN 1 2 3 ##NaN]))
#typed-buffer[[:int32 5][1 2 3 4 0]
cljs.user> ;;example setting nan strategy and using custom comparator.
cljs.user> (argops/argsort nil ;;no compare fn
{:nan-strategy :first
:comparator #(compare %2 %1)}
(dtype/make-container :float32 [##NaN 1 2 3 ##NaN]))
#typed-buffer[[:int32 5][0 4 3 2 1]
</code></pre>
</div></div><div class="src-link"><a href="https://github.com/cnuernber/tmdjs/blob/master/src/tech/v3/datatype/argops.cljs#L10">view source</a></div></div><div class="public anchor" id="var-binary-search"><h3>binary-search</h3><div class="usage"><code>(binary-search data target options)</code><code>(binary-search data target)</code></div><div class="doc"><div class="markdown"><p>Returns a long result that points to just before the value or exactly points to the
value. In the case where the target is after the last value will return
elem-count. If value is present multiple times the index will point to the first
value.</p>
<p>Options:</p>
<ul>
<li><code>:comparator</code> - a specific comparator to use; defaults to <code>comparator</code>.</li>
</ul>
</div></div><div class="src-link"><a href="https://github.com/cnuernber/tmdjs/blob/master/src/tech/v3/datatype/argops.cljs#L190">view source</a></div></div></div></body></html>