Skip to content

Commit

Permalink
Update Sphinx documentation, commit e5385a7 [skip ci].
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescarni committed Jan 17, 2024
1 parent bbe9745 commit 4ed93a8
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 19 deletions.
8 changes: 4 additions & 4 deletions _sources/breaking_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ if a single argument is passed in input. This means that code such as

.. code-block:: c++

auto [x] = make_vars("x")
auto [x] = make_vars("x");

needs to be rewritten like this:

.. code-block:: c++

auto x = make_vars("x")
auto x = make_vars("x");

Terminal events callbacks
^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -67,8 +67,8 @@ a matter of:
- accounting for the fact that batch propagations now return a tuple of two elements
rather than a single value.

``propagate_grid()``
^^^^^^^^^^^^^^^^^^^^
Changes to ``propagate_grid()``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``propagate_grid()`` functions of the adaptive integrators now require the first element of the
time grid to be equal to the current integrator time. Previously, in case of a difference between the
Expand Down
32 changes: 30 additions & 2 deletions _sources/expression.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ The :cpp:class:`expression` class

.. cpp:class:: expression

.. cpp:type:: value_type = std::variant<number, variable, func, param>

Functions
---------

.. cpp:function:: template <typename Arg0, typename... Args> auto make_vars(const Arg0 &str, const Args &...strs)

Create expressions from strings.
Create variable expressions from strings.

This function will return one or more :cpp:class:`expression` instances constructed from the input arguments.
This function will return one or more :cpp:class:`expression` instances
containing :cpp:class:`variables <variable>` constructed from the input arguments.
If a single argument is supplied, a single expression is returned. Otherwise, a ``std::array`` of
expressions (one for each argument) is returned.

Expand All @@ -29,3 +32,28 @@ Functions
:return: one or more expressions constructed from *str* and *strs*.

:exception: any exception thrown by constructing ``std::string`` objects.

Example
~~~~~~~

.. code-block:: c++

auto x = make_vars("x");
auto [y, z] = make_vars("y", "z");

User-defined literals
---------------------

.. cpp:function:: expression literals::operator""_flt(long double)

.. cpp:function:: expression literals::operator""_flt(unsigned long long)

.. cpp:function:: expression literals::operator""_dbl(long double)

.. cpp:function:: expression literals::operator""_dbl(unsigned long long)

.. cpp:function:: expression literals::operator""_ldbl(long double)

.. cpp:function:: expression literals::operator""_ldbl(unsigned long long)

.. cpp:function:: template <char... Chars> expression literals::operator""_f128()
12 changes: 6 additions & 6 deletions breaking_changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ <h2> Contents </h2>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#changes-to-make-vars">Changes to <code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">make_vars()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#terminal-events-callbacks">Terminal events callbacks</a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#step-callbacks-and-propagate">Step callbacks and <code class="docutils literal notranslate"><span class="pre">propagate_*()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#propagate-grid"><code class="docutils literal notranslate"><span class="pre">propagate_grid()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#changes-to-propagate-grid">Changes to <code class="docutils literal notranslate"><span class="pre">propagate_grid()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#general">General</a></li>
Expand Down Expand Up @@ -437,11 +437,11 @@ <h3>API/behaviour changes<a class="headerlink" href="#api-behaviour-changes" tit
<h4>Changes to <a class="reference internal" href="expression.html#_CPPv4I0DpEN6heyoka9make_varsEDaRK4Arg0DpRK4Args" title="heyoka::make_vars"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">make_vars()</span></code></a><a class="headerlink" href="#changes-to-make-vars" title="Link to this heading">#</a></h4>
<p>The <a class="reference internal" href="expression.html#_CPPv4I0DpEN6heyoka9make_varsEDaRK4Arg0DpRK4Args" title="heyoka::make_vars"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">make_vars()</span></code></a> function now returns a single expression (rather than an array of expressions)
if a single argument is passed in input. This means that code such as</p>
<div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="k">auto</span><span class="w"> </span><span class="p">[</span><span class="n">x</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">make_vars</span><span class="p">(</span><span class="s">&quot;x&quot;</span><span class="p">)</span>
<div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="k">auto</span><span class="w"> </span><span class="p">[</span><span class="n">x</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">make_vars</span><span class="p">(</span><span class="s">&quot;x&quot;</span><span class="p">);</span>
</pre></div>
</div>
<p>needs to be rewritten like this:</p>
<div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="k">auto</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">make_vars</span><span class="p">(</span><span class="s">&quot;x&quot;</span><span class="p">)</span>
<div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="k">auto</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">make_vars</span><span class="p">(</span><span class="s">&quot;x&quot;</span><span class="p">);</span>
</pre></div>
</div>
</section>
Expand Down Expand Up @@ -482,8 +482,8 @@ <h4>Step callbacks and <code class="docutils literal notranslate"><span class="p
rather than a single value.</p></li>
</ul>
</section>
<section id="propagate-grid">
<h4><code class="docutils literal notranslate"><span class="pre">propagate_grid()</span></code><a class="headerlink" href="#propagate-grid" title="Link to this heading">#</a></h4>
<section id="changes-to-propagate-grid">
<h4>Changes to <code class="docutils literal notranslate"><span class="pre">propagate_grid()</span></code><a class="headerlink" href="#changes-to-propagate-grid" title="Link to this heading">#</a></h4>
<p>The <code class="docutils literal notranslate"><span class="pre">propagate_grid()</span></code> functions of the adaptive integrators now require the first element of the
time grid to be equal to the current integrator time. Previously, in case of a difference between the
integrator time and the first grid point, heyoka would propagate the state of the system up to the
Expand Down Expand Up @@ -629,7 +629,7 @@ <h3>General<a class="headerlink" href="#general" title="Link to this heading">#<
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#changes-to-make-vars">Changes to <code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">make_vars()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#terminal-events-callbacks">Terminal events callbacks</a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#step-callbacks-and-propagate">Step callbacks and <code class="docutils literal notranslate"><span class="pre">propagate_*()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#propagate-grid"><code class="docutils literal notranslate"><span class="pre">propagate_grid()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#changes-to-propagate-grid">Changes to <code class="docutils literal notranslate"><span class="pre">propagate_grid()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#general">General</a></li>
Expand Down
Loading

0 comments on commit 4ed93a8

Please sign in to comment.