Skip to content

Commit

Permalink
#6: add pow to ops tree
Browse files Browse the repository at this point in the history
  • Loading branch information
cwschilly committed Oct 25, 2024
1 parent cfb0381 commit 4db7e53
Show file tree
Hide file tree
Showing 16 changed files with 400 additions and 3 deletions.
Binary file modified docs/generated_docs/.doctrees/components/ops.doctree
Binary file not shown.
Binary file modified docs/generated_docs/.doctrees/components/ops/norms.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/generated_docs/.doctrees/environment.pickle
Binary file not shown.
1 change: 1 addition & 0 deletions docs/generated_docs/_sources/components/ops.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,4 @@ Use the links below to view details about each operation.
ops/matrix_matrix_product
ops/min_max
ops/norms
ops/pow
2 changes: 1 addition & 1 deletion docs/generated_docs/_sources/components/ops/norms.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ Description
\|\mathbf{a}\|_2 = \sqrt{\sum_{i=1}^{n} a_i^2}
* ``a`` must be rank-1
* ``a`` must be rank-1 container of any type
47 changes: 47 additions & 0 deletions docs/generated_docs/_sources/components/ops/pow.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.. include:: ../../mydefs.rst

``pow``
=======

Header: ``<pressio/ops.hpp>``

API
---

.. code-block:: cpp
namespace pressio { namespace ops{
// x^exponent
template <typename T>
void pow(T & x, const scalar_type & exponent);
// y = x^exponent
template<typename T1, typename T2>
void pow(T1 & y, const T2 & x, const scalar_type & exponent);
// y = |x|^exponent (exponent > 0)
template <class T1, class T2>
abs_pow(T1 & y,
const T2 & x,
const typename ::pressio::Traits<T1>::scalar_type & exponent
);
// y = |x|^exponent (exponent < 0)
template <class T1, class T2>
abs_pow(T1 & y,
const T2 & x,
const typename ::pressio::Traits<T1>::scalar_type & exponent,
const typename ::pressio::Traits<T1>::scalar_type & eps
);
}} // end namespace pressio::ops
Description
-----------

* Raises each element of a rank-1 container ``x`` to the specified power ``exponent``

* Stores the result in ``y`` if provided; otherwise, acts in place on ``x``

* ``x`` may be any type of rank-1 container other than a Teuchos vector
2 changes: 2 additions & 0 deletions docs/generated_docs/components/ops.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
<li class="toctree-l2"><a class="reference internal" href="ops/matrix_matrix_product.html"><code class="docutils literal notranslate"><span class="pre">matrix-matrix</span> <span class="pre">product</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="ops/min_max.html"><code class="docutils literal notranslate"><span class="pre">min</span></code> &amp; <code class="docutils literal notranslate"><span class="pre">max</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="ops/norms.html"><code class="docutils literal notranslate"><span class="pre">norms</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="ops/pow.html"><code class="docutils literal notranslate"><span class="pre">pow</span></code></a></li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="expressions.html"><code class="docutils literal notranslate"><span class="pre">expressions</span></code></a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
Expand Down Expand Up @@ -332,6 +333,7 @@ <h2>Navigation<a class="headerlink" href="#navigation" title="Permalink to this
<li class="toctree-l1"><a class="reference internal" href="ops/matrix_matrix_product.html"><code class="docutils literal notranslate"><span class="pre">matrix-matrix</span> <span class="pre">product</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="ops/min_max.html"><code class="docutils literal notranslate"><span class="pre">min</span></code> &amp; <code class="docutils literal notranslate"><span class="pre">max</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="ops/norms.html"><code class="docutils literal notranslate"><span class="pre">norms</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="ops/pow.html"><code class="docutils literal notranslate"><span class="pre">pow</span></code></a></li>
</ul>
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion docs/generated_docs/components/ops/norms.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ <h2>Description<a class="headerlink" href="#description" title="Permalink to thi
\[\|\mathbf{a}\|_2 = \sqrt{\sum_{i=1}^{n} a_i^2}\]</div>
</div>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">a</span></code> must be rank-1</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">a</span></code> must be rank-1 container of any type</p></li>
</ul>
</section>
</section>
Expand Down
343 changes: 343 additions & 0 deletions docs/generated_docs/components/ops/pow.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/generated_docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
<li class="toctree-l2"><a class="reference internal" href="components/ops/matrix_matrix_product.html"><code class="docutils literal notranslate"><span class="pre">matrix-matrix</span> <span class="pre">product</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="components/ops/min_max.html"><code class="docutils literal notranslate"><span class="pre">min</span></code> &amp; <code class="docutils literal notranslate"><span class="pre">max</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="components/ops/norms.html"><code class="docutils literal notranslate"><span class="pre">norms</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="components/ops/pow.html"><code class="docutils literal notranslate"><span class="pre">pow</span></code></a></li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="components/expressions.html"><code class="docutils literal notranslate"><span class="pre">expressions</span></code></a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
Expand Down
1 change: 1 addition & 0 deletions docs/generated_docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
<li class="toctree-l2"><a class="reference internal" href="components/ops/matrix_matrix_product.html"><code class="docutils literal notranslate"><span class="pre">matrix-matrix</span> <span class="pre">product</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="components/ops/min_max.html"><code class="docutils literal notranslate"><span class="pre">min</span></code> &amp; <code class="docutils literal notranslate"><span class="pre">max</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="components/ops/norms.html"><code class="docutils literal notranslate"><span class="pre">norms</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="components/ops/pow.html"><code class="docutils literal notranslate"><span class="pre">pow</span></code></a></li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="components/expressions.html"><code class="docutils literal notranslate"><span class="pre">expressions</span></code></a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
Expand Down
Binary file modified docs/generated_docs/objects.inv
Binary file not shown.
1 change: 1 addition & 0 deletions docs/generated_docs/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
<li class="toctree-l2"><a class="reference internal" href="components/ops/matrix_matrix_product.html"><code class="docutils literal notranslate"><span class="pre">matrix-matrix</span> <span class="pre">product</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="components/ops/min_max.html"><code class="docutils literal notranslate"><span class="pre">min</span></code> &amp; <code class="docutils literal notranslate"><span class="pre">max</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="components/ops/norms.html"><code class="docutils literal notranslate"><span class="pre">norms</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="components/ops/pow.html"><code class="docutils literal notranslate"><span class="pre">pow</span></code></a></li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="components/expressions.html"><code class="docutils literal notranslate"><span class="pre">expressions</span></code></a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
Expand Down
2 changes: 1 addition & 1 deletion docs/generated_docs/searchindex.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/source/components/ops.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,4 @@ Use the links below to view details about each operation.
ops/matrix_matrix_product
ops/min_max
ops/norms
ops/pow

0 comments on commit 4db7e53

Please sign in to comment.