Skip to content

Commit

Permalink
Deploying to gh-pages from @ a19defa 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Nov 3, 2024
1 parent ae297aa commit 8f86a3b
Show file tree
Hide file tree
Showing 7 changed files with 1,115 additions and 1,139 deletions.
278 changes: 137 additions & 141 deletions docs/counts_8hpp_source.html

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,19 @@ <h1>Quick start</h1>
<div class="line"><span class="keyword">auto</span> col_mean_and_var = <a class="code hl_function" href="namespacetatami__stats_1_1variances.html#ac9ec52e261ebef9d024fa88d9318bb26">tatami_stats::variances::by_column</a>(mat.get(), vopt);</div>
<div class="ttc" id="aclasstatami_1_1DenseRowMatrix_html"><div class="ttname"><a href="https://tatami-inc.github.io/tatami/classtatami_1_1DenseRowMatrix.html">tatami::DenseRowMatrix</a></div></div>
<div class="ttc" id="anamespacetatami__stats_1_1medians_html_aec4803eb6b9ba02620a0dd349ea06119"><div class="ttname"><a href="namespacetatami__stats_1_1medians.html#aec4803eb6b9ba02620a0dd349ea06119">tatami_stats::medians::by_row</a></div><div class="ttdeci">std::vector&lt; Output_ &gt; by_row(const tatami::Matrix&lt; Value_, Index_ &gt; *p, const Options &amp;mopt)</div><div class="ttdef"><b>Definition</b> medians.hpp:315</div></div>
<div class="ttc" id="anamespacetatami__stats_1_1variances_html_ac9ec52e261ebef9d024fa88d9318bb26"><div class="ttname"><a href="namespacetatami__stats_1_1variances.html#ac9ec52e261ebef9d024fa88d9318bb26">tatami_stats::variances::by_column</a></div><div class="ttdeci">std::vector&lt; Output_ &gt; by_column(const tatami::Matrix&lt; Value_, Index_ &gt; *p, const Options &amp;vopt)</div><div class="ttdef"><b>Definition</b> variances.hpp:489</div></div>
<div class="ttc" id="astructtatami__stats_1_1variances_1_1Options_html"><div class="ttname"><a href="structtatami__stats_1_1variances_1_1Options.html">tatami_stats::variances::Options</a></div><div class="ttdoc">Variance calculation options.</div><div class="ttdef"><b>Definition</b> variances.hpp:31</div></div>
<div class="ttc" id="astructtatami__stats_1_1variances_1_1Options_html_a067e87951e90ca4510b110c13efe56cb"><div class="ttname"><a href="structtatami__stats_1_1variances_1_1Options.html#a067e87951e90ca4510b110c13efe56cb">tatami_stats::variances::Options::num_threads</a></div><div class="ttdeci">int num_threads</div><div class="ttdef"><b>Definition</b> variances.hpp:42</div></div>
<div class="ttc" id="astructtatami__stats_1_1variances_1_1Options_html_aeb3ee96b5c18332bd57e0633c3593c53"><div class="ttname"><a href="structtatami__stats_1_1variances_1_1Options.html#aeb3ee96b5c18332bd57e0633c3593c53">tatami_stats::variances::Options::skip_nan</a></div><div class="ttdeci">bool skip_nan</div><div class="ttdef"><b>Definition</b> variances.hpp:36</div></div>
<div class="ttc" id="anamespacetatami__stats_1_1variances_html_ac9ec52e261ebef9d024fa88d9318bb26"><div class="ttname"><a href="namespacetatami__stats_1_1variances.html#ac9ec52e261ebef9d024fa88d9318bb26">tatami_stats::variances::by_column</a></div><div class="ttdeci">std::vector&lt; Output_ &gt; by_column(const tatami::Matrix&lt; Value_, Index_ &gt; *p, const Options &amp;vopt)</div><div class="ttdef"><b>Definition</b> variances.hpp:480</div></div>
<div class="ttc" id="astructtatami__stats_1_1variances_1_1Options_html"><div class="ttname"><a href="structtatami__stats_1_1variances_1_1Options.html">tatami_stats::variances::Options</a></div><div class="ttdoc">Variance calculation options.</div><div class="ttdef"><b>Definition</b> variances.hpp:30</div></div>
<div class="ttc" id="astructtatami__stats_1_1variances_1_1Options_html_a067e87951e90ca4510b110c13efe56cb"><div class="ttname"><a href="structtatami__stats_1_1variances_1_1Options.html#a067e87951e90ca4510b110c13efe56cb">tatami_stats::variances::Options::num_threads</a></div><div class="ttdeci">int num_threads</div><div class="ttdef"><b>Definition</b> variances.hpp:41</div></div>
<div class="ttc" id="astructtatami__stats_1_1variances_1_1Options_html_aeb3ee96b5c18332bd57e0633c3593c53"><div class="ttname"><a href="structtatami__stats_1_1variances_1_1Options.html#aeb3ee96b5c18332bd57e0633c3593c53">tatami_stats::variances::Options::skip_nan</a></div><div class="ttdeci">bool skip_nan</div><div class="ttdef"><b>Definition</b> variances.hpp:35</div></div>
<div class="ttc" id="atatami__stats_8hpp_html"><div class="ttname"><a href="tatami__stats_8hpp.html">tatami_stats.hpp</a></div><div class="ttdoc">Umbrella header for the tatami_stats library.</div></div>
</div><!-- fragment --><p>Check out the <a href="https://tatami-inc.github.io/tatami_stats">API documentation</a> for more details.</p>
<h1>Lower-level functionality</h1>
<p>The <code>apply()</code> function in each statistic's namespace offers more control over the calculation of each statistic. For example, instead of creating a new vector, we can fill an existing array with the sums:</p>
<div class="fragment"><div class="line">std::vector&lt;double&gt; my_output(mat-&gt;nrow());</div>
<div class="line"><a class="code hl_struct" href="structtatami__stats_1_1sums_1_1Options.html">tatami_stats::sums::Options</a> sopt;</div>
<div class="line"><a class="code hl_function" href="namespacetatami__stats_1_1sums.html#ae21d4cc4dfbc7002e3dd57b1eb6047a6">tatami_stats::sums::apply</a>(<span class="comment">/* row = */</span> <span class="keyword">true</span>, mat.get(), output.data(), sopt);</div>
<div class="ttc" id="anamespacetatami__stats_1_1sums_html_ae21d4cc4dfbc7002e3dd57b1eb6047a6"><div class="ttname"><a href="namespacetatami__stats_1_1sums.html#ae21d4cc4dfbc7002e3dd57b1eb6047a6">tatami_stats::sums::apply</a></div><div class="ttdeci">void apply(bool row, const tatami::Matrix&lt; Value_, Index_ &gt; *p, Output_ *output, const Options &amp;sopt)</div><div class="ttdef"><b>Definition</b> sums.hpp:212</div></div>
<div class="ttc" id="astructtatami__stats_1_1sums_1_1Options_html"><div class="ttname"><a href="structtatami__stats_1_1sums_1_1Options.html">tatami_stats::sums::Options</a></div><div class="ttdoc">Summation options.</div><div class="ttdef"><b>Definition</b> sums.hpp:29</div></div>
<div class="ttc" id="anamespacetatami__stats_1_1sums_html_ae21d4cc4dfbc7002e3dd57b1eb6047a6"><div class="ttname"><a href="namespacetatami__stats_1_1sums.html#ae21d4cc4dfbc7002e3dd57b1eb6047a6">tatami_stats::sums::apply</a></div><div class="ttdeci">void apply(bool row, const tatami::Matrix&lt; Value_, Index_ &gt; *p, Output_ *output, const Options &amp;sopt)</div><div class="ttdef"><b>Definition</b> sums.hpp:207</div></div>
<div class="ttc" id="astructtatami__stats_1_1sums_1_1Options_html"><div class="ttname"><a href="structtatami__stats_1_1sums_1_1Options.html">tatami_stats::sums::Options</a></div><div class="ttdoc">Summation options.</div><div class="ttdef"><b>Definition</b> sums.hpp:28</div></div>
</div><!-- fragment --><p>Some of the algorithms expose low-level functions for even more fine-grained control. For example, we can manage the loop over the matrix rows ourselves, computing the mean and median for each row:</p>
<div class="fragment"><div class="line"><span class="keyword">auto</span> ext = mat-&gt;dense_row();</div>
<div class="line">std::vector&lt;double&gt; buffer(ncols);</div>
Expand All @@ -135,7 +135,7 @@ <h1>Lower-level functionality</h1>
<div class="line"> med_output[r] = <a class="code hl_function" href="namespacetatami__stats_1_1medians.html#ad805e96ccca9615107f7360788f24a44">tatami_stats::medians::direct</a>(ptr, ncols, <span class="comment">/* skip_nan= */</span> <span class="keyword">true</span>);</div>
<div class="line">}</div>
<div class="ttc" id="anamespacetatami__stats_1_1medians_html_ad805e96ccca9615107f7360788f24a44"><div class="ttname"><a href="namespacetatami__stats_1_1medians.html#ad805e96ccca9615107f7360788f24a44">tatami_stats::medians::direct</a></div><div class="ttdeci">Output_ direct(Value_ *ptr, Index_ num, bool skip_nan)</div><div class="ttdef"><b>Definition</b> medians.hpp:82</div></div>
<div class="ttc" id="anamespacetatami__stats_1_1sums_html_af95ccf6d0eea5492a7ccd6c1c003df92"><div class="ttname"><a href="namespacetatami__stats_1_1sums.html#af95ccf6d0eea5492a7ccd6c1c003df92">tatami_stats::sums::direct</a></div><div class="ttdeci">Output_ direct(const Value_ *ptr, Index_ num, bool skip_nan)</div><div class="ttdef"><b>Definition</b> sums.hpp:58</div></div>
<div class="ttc" id="anamespacetatami__stats_1_1sums_html_af95ccf6d0eea5492a7ccd6c1c003df92"><div class="ttname"><a href="namespacetatami__stats_1_1sums.html#af95ccf6d0eea5492a7ccd6c1c003df92">tatami_stats::sums::direct</a></div><div class="ttdeci">Output_ direct(const Value_ *ptr, Index_ num, bool skip_nan)</div><div class="ttdef"><b>Definition</b> sums.hpp:57</div></div>
<div class="ttc" id="anamespacetatami_html_ab52a806e3f13a68741a9e1f77dccab14"><div class="ttname"><a href="https://tatami-inc.github.io/tatami/namespacetatami.html#ab52a806e3f13a68741a9e1f77dccab14">tatami::copy_n</a></div><div class="ttdeci">Value_ * copy_n(const Value_ *input, Size_ n, Value_ *output)</div></div>
</div><!-- fragment --><p>These low-level functions allow developers to compute multiple statistics with a single pass through the matrix. In contrast, calling <code><a class="el" href="namespacetatami__stats_1_1sums.html#aef91d6bb0a5132934e63bb2d4844e78d">tatami_stats::sums::by_row</a></code> and <code><a class="el" href="namespacetatami__stats_1_1medians.html#aec4803eb6b9ba02620a0dd349ea06119">tatami_stats::medians::by_row</a></code> separately would extract data from the matrix twice, which may be expensive for file-backed matrices.</p>
<h1>Building projects</h1>
Expand Down
Loading

0 comments on commit 8f86a3b

Please sign in to comment.