Commits

Anonymous committed e4dc8fb

railgun/1a19367106ba

  • Participants
  • Parent commits 41214fe

Comments (0)

Files changed (40)

railgun-doc/_images/kaplan_yorke_map.pdf

Binary file added.

railgun-doc/_images/kaplan_yorke_map.png

Added
New image

railgun-doc/_images/kaplan_yorke_map5.pdf

Binary file removed.

railgun-doc/_images/kaplan_yorke_map5.png

Removed
Old image

railgun-doc/_images/lode.pdf

Binary file added.

railgun-doc/_images/lode.png

Added
New image

railgun-doc/_images/lode15.pdf

Binary file removed.

railgun-doc/_images/lode15.png

Removed
Old image

railgun-doc/_images/run.pdf

Binary file added.

railgun-doc/_images/run.png

Added
New image

railgun-doc/_images/run3.pdf

Binary file removed.

railgun-doc/_images/run3.png

Removed
Old image

railgun-doc/_images/run_debug.pdf

Binary file added.

railgun-doc/_images/run_debug.png

Added
New image

railgun-doc/_images/run_debug3.pdf

Binary file removed.

railgun-doc/_images/run_debug3.png

Removed
Old image

railgun-doc/_sources/samples/lode_rk4/lode_rk4.txt

+.. module:: yourcode
+
 Runge-Kutta method (usage of :attr:`_cmemsubsets_`)
 ===================================================
 
+If you are using a lot of intermediate variables and want to check these
+variables for debugging, you can use :attr:`YourSimObject._cmemsubsets_` to
+allocate memory only when the flag is on.
+
 Python code (``lode_rk4.py``)
 -----------------------------
 
 .. literalinclude:: lode_rk4.py
    :language: python
 
+
 C code (``lode_rk4.c``)
 -----------------------
 .. literalinclude:: lode_rk4.c
    :language: c
 
-Running without intermediate variables
---------------------------------------
+
+Running on "normal mode"
+------------------------
 .. literalinclude:: run.py
    :language: python
 
 .. plot:: source/samples/lode_rk4/run.py
 
 
-Running with intermediate variables
------------------------------------
+Running on "debug mode"
+-----------------------
+You can create "debug mode" instance by giving ``_cmemsubsets_debug=True``
+to your class constructor.
+
 .. literalinclude:: run_debug.py
    :language: python
 
 .. plot:: source/samples/lode_rk4/run_debug.py
+
+
+Reference
+---------
+
+- `Runge–Kutta methods - Wikipedia, the free encyclopedia
+  <http://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods>`_

railgun-doc/_sources/simobj.txt

 :class:`SimObject` --- A class loads everything you need from C shared library
 ==============================================================================
 
-.. module:: railgun
+.. class:: yourcode.YourSimObject
 
-
-.. class:: SimObject
-
-   A base class used for loading C shared library.
+   To load your C shared library, please define this class which
+   override :class:`railgun.SimObject`.
    You will need to define four attribute: :attr:`_clibname_`,
    :attr:`_clibdir_`, :attr:`_cmembers_` and :attr:`_cfuncs_`.
 
+   .. note::
+
+      In this document, :class:`yourcode.YourSimObject` means the class
+      *you need to define*. It is not the class in RailGun.
+
    Example::
 
-       class NameOfCStruct(SimObject):
+       class YourSimObject(SimObject):
            _clibname_ = 'name_of_shared_library.so'
            _clibdir_ = 'path/to/shared/library'
 
            def some_function(self, ...):
                ...
 
-   - You can override :meth:`SimObject.__init__`.
+   - You can override :meth:`railgun.SimObject.__init__`.
    - You can define additional python methods or members.
-     But be careful with name: :class:`SimObject` will overwrite
+     But be careful with name: :class:`railgun.SimObject` will overwrite
      the methods or members of your class with name in
      :attr:`_cmembers_` and :attr:`_cfuncs_`.
 
 
-   .. attribute:: SimObject._clibname_
+   .. attribute:: _clibname_
 
       Name of your C shared library.
 
-   .. attribute:: SimObject._clibdir_
+   .. attribute:: _clibdir_
 
       Path of the directory where your C library are.
       If you want to specify relative path from where
       this python module file are, you can use :func:`relpath`.
 
-   .. attribute:: SimObject._cmembers_
+   .. attribute:: _cmembers_
 
       This is a list of the definitions of C variables with
       following syntax::
               'double double_matrix[k][i] = -4.1',
               ]
 
-      See also: :func:`cmems`
+      See also: :func:`railgun.cmems`
 
-   .. attribute:: SimObject._cfuncs_
+   .. attribute:: _cfuncs_
 
       This is a list of the definitions of C functions with
       following syntax::
 
       See also: :ref:`how_to_write_cfunc`
 
-   .. attribute:: SimObject._cstructname_
+   .. attribute:: _cstructname_
 
       This is optional. This is used to specify the name of C struct
       explicitly::
                _cstructname_ = 'CStructName'  # this is name of c-struct
 
 
-   .. attribute:: SimObject._cfuncprefix_
+   .. attribute:: _cfuncprefix_
 
       This is optional. This is used to specify the prefix of C functions
       explicitly (default is name of C Struct + ``_``)::
 
-           class YourSimObj(SimObject):
+           class YourSimObject(SimObject):
                ...
                _cfuncprefix_ = 'MyPrefix'
                _cfuncs_ = [
                    ...
                    ]
 
-           class YourSimObj(SimObject):
+           class YourSimObject(SimObject):
                ...
                _cfuncprefix_ = ''
                _cfuncs_ = [
                    ...
                    ]
 
-   .. attribute:: SimObject._cmemsubsets_
+   .. attribute:: _cmemsubsets_
 
       dict of dict of list, optional
       Definition of subset of C members for controlling which
       ``f, g, h, j, k`` are the name of C functions, and
       ``x, y, z`` are the name of C members.
 
-   .. method:: SimObject._cwrap_{C_FUNC_NAME}(func)
+   .. method:: _cwrap_C_FUNC_NAME(func)
 
       This is optional. If you want to wrap C function ``C_FUNC_NAME``,
       define this wrapper function.
 
       Example::
 
-          class YourSimObj(SimObject):
+          class YourSimObject(SimObject):
 
               _clibname_ = '...'
               _clibdir_ = '...'
           your_c_function = _cwrap_your_c_function(your_c_function)
 
 
-   .. method:: SimObject.setv(**kwds)
+
+.. class:: railgun.SimObject
+
+
+   .. method:: setv(**kwds)
 
       This is used for setting values of C struct members.
 
            obj.var[0][1] = 1
 
 
-   .. method:: SimObject.getv(*args)
+   .. method:: getv(*args)
 
       Get the C variable by specifying the name
       (Following lines have same effects)::
            (a, c, c) = obj.getv('a, b, c')
 
 
-   .. method:: SimObject.num(*args)
+   .. method:: num(*args)
 
       Get the size along index
       (Following lines have same effects)::

railgun-doc/genindex.html

    <h1 id="index">Index</h1>
 
    <div class="genindex-jumpbox">
-   <a href="#_"><strong>_</strong></a> | <a href="#C"><strong>C</strong></a> | <a href="#G"><strong>G</strong></a> | <a href="#N"><strong>N</strong></a> | <a href="#R"><strong>R</strong></a> | <a href="#S"><strong>S</strong></a> 
+   <a href="#_"><strong>_</strong></a> | <a href="#C"><strong>C</strong></a> | <a href="#G"><strong>G</strong></a> | <a href="#N"><strong>N</strong></a> | <a href="#R"><strong>R</strong></a> | <a href="#S"><strong>S</strong></a> | <a href="#Y"><strong>Y</strong></a> 
    </div>
 <h2 id="_">_</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
-    <dt><a href="simobj.html#railgun.SimObject._cfuncprefix_">_cfuncprefix_ (railgun.SimObject attribute)</a></dt>
-    <dt><a href="simobj.html#railgun.SimObject._cfuncs_">_cfuncs_ (railgun.SimObject attribute)</a></dt>
-    <dt><a href="simobj.html#railgun.SimObject._clibdir_">_clibdir_ (railgun.SimObject attribute)</a></dt>
-    <dt><a href="simobj.html#railgun.SimObject._clibname_">_clibname_ (railgun.SimObject attribute)</a></dt>
+    <dt><a href="simobj.html#yourcode.YourSimObject._cfuncprefix_">_cfuncprefix_ (yourcode.YourSimObject attribute)</a></dt>
+    <dt><a href="simobj.html#yourcode.YourSimObject._cfuncs_">_cfuncs_ (yourcode.YourSimObject attribute)</a></dt>
+    <dt><a href="simobj.html#yourcode.YourSimObject._clibdir_">_clibdir_ (yourcode.YourSimObject attribute)</a></dt>
+    <dt><a href="simobj.html#yourcode.YourSimObject._clibname_">_clibname_ (yourcode.YourSimObject attribute)</a></dt>
 </dl></td>
   <td style="width: 33%" valign="top"><dl>
-    <dt><a href="simobj.html#railgun.SimObject._cmembers_">_cmembers_ (railgun.SimObject attribute)</a></dt>
-    <dt><a href="simobj.html#railgun.SimObject._cmemsubsets_">_cmemsubsets_ (railgun.SimObject attribute)</a></dt>
-    <dt><a href="simobj.html#railgun.SimObject._cstructname_">_cstructname_ (railgun.SimObject attribute)</a></dt>
+    <dt><a href="simobj.html#yourcode.YourSimObject._cmembers_">_cmembers_ (yourcode.YourSimObject attribute)</a></dt>
+    <dt><a href="simobj.html#yourcode.YourSimObject._cmemsubsets_">_cmemsubsets_ (yourcode.YourSimObject attribute)</a></dt>
+    <dt><a href="simobj.html#yourcode.YourSimObject._cstructname_">_cstructname_ (yourcode.YourSimObject attribute)</a></dt>
+    <dt><a href="simobj.html#yourcode.YourSimObject._cwrap_C_FUNC_NAME">_cwrap_C_FUNC_NAME() (yourcode.YourSimObject method)</a></dt>
 </dl></td>
 </tr></table>
 
 <h2 id="R">R</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
-    <dt><a href="utils.html#module-railgun">railgun (module)</a>, <a href="simobj.html#module-railgun">[1]</a></dt>
+    <dt><a href="utils.html#module-railgun">railgun (module)</a></dt>
+    <dt><a href="simobj.html#railgun.SimObject">railgun.SimObject (built-in class)</a></dt>
 </dl></td>
   <td style="width: 33%" valign="top"><dl>
     <dt><a href="utils.html#railgun.relpath">relpath() (in module railgun)</a></dt>
   <td style="width: 33%" valign="top"><dl>
     <dt><a href="simobj.html#railgun.SimObject.setv">setv() (railgun.SimObject method)</a></dt>
 </dl></td>
+</tr></table>
+
+<h2 id="Y">Y</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
-    <dt><a href="simobj.html#railgun.SimObject">SimObject (class in railgun)</a></dt>
+    <dt><a href="samples/lode_rk4/lode_rk4.html#module-yourcode">yourcode (module)</a></dt>
+</dl></td>
+  <td style="width: 33%" valign="top"><dl>
+    <dt><a href="simobj.html#yourcode.YourSimObject">yourcode.YourSimObject (built-in class)</a></dt>
 </dl></td>
 </tr></table>
 

railgun-doc/objects.inv

Binary file modified.

railgun-doc/plot_directive/samples/kaplan_yorke_map/kaplan_yorke_map.hires.png

Added
New image

railgun-doc/plot_directive/samples/kaplan_yorke_map/kaplan_yorke_map.pdf

Binary file added.

railgun-doc/plot_directive/samples/kaplan_yorke_map/kaplan_yorke_map.py

+from railgun import SimObject, relpath
+
+class KaplanYorkeMap(SimObject):
+    """
+    Simulating Kaplan-Yorke Map using RailGun
+    """
+
+    _clibname_ = 'libkaplan_yorke_map.so'  # name of shared library
+    _clibdir_ = relpath('.', __file__)  # library directory
+    _cmembers_ = [  # declaring members of struct
+        'num_i',  # num_* as size of array (no need to write `int`)
+        'double xt[i]',  # array with num_i elements
+        'double yt[i]',  # array with num_i elements
+        'double mu',
+        'double lmd',
+        ]
+    _cfuncs_ = ["gene_seq()"]
+
+
+kym = KaplanYorkeMap(num_i=10**5, mu=2, lmd=0.4, xt_0=0.1, yt_0=0.1)
+kym.setv()
+kym.gene_seq()
+(xt, yt) = kym.getv('xt, yt')
+
+import pylab
+pylab.figure(1, figsize=(4,3))
+pylab.plot(xt, yt, 'k.', markersize=0.1)
+pylab.show()

railgun-doc/plot_directive/samples/lode/lode.hires.png

Added
New image

railgun-doc/plot_directive/samples/lode/lode.pdf

Binary file added.

railgun-doc/plot_directive/samples/lode/lode.py

+from railgun import SimObject, relpath
+
+class LinearODE(SimObject):
+    """
+    Solve D-dimensional linear ordinary differential equations
+
+    Equation::
+
+        dX/dt(t) = A X(t)
+        X: D-dimensional vector
+        A: DxD matrix
+
+    """
+
+    _clibname_ = 'liblode.so'  # name of shared library
+    _clibdir_ = relpath('.', __file__)  # library directory
+    _cmembers_ = [  # declaring members of struct
+        'num_d',  # num_* as size of array (no need to write `int`)
+        'num_s = 10000',  # setting default value
+        'double dt = 0.001',
+        'double a[d][d]',  # num_d x num_d array
+        'double x[s][d]',  # num_s x num_d array
+        ]
+    _cfuncs_ = [  # declaring functions to load
+        "x run(s< s_end=num_s)"
+        # argument `s_end` has index `s` type and default is `num_s`
+        # '<' means it is upper bound of the index so the range is [1, num_s]
+        # this function returns member x
+        ]
+
+
+lode = LinearODE(num_d=2)  # set num_d
+lode.x[0] = [1, 0]  # access c-member "VAR" via lode.VAR
+lode.a = [[0, 1], [-1, 0]]
+x1 = lode.run().copy()
+lode.setv(a_0_0=-0.5)  # set lode.a[i][j]=v via lode.set(a_'i'_'j'=v)
+x2 = lode.run().copy()
+
+import pylab
+for (i, x) in enumerate([x1, x2]):
+    pylab.subplot(2, 2, 1 + i)
+    pylab.plot(x[:,0])
+    pylab.plot(x[:,1])
+    pylab.subplot(2, 2, 3 + i)
+    pylab.plot(x[:,0], x[:,1])
+pylab.show()

railgun-doc/plot_directive/samples/lode_rk4/run.hires.png

Added
New image

railgun-doc/plot_directive/samples/lode_rk4/run.pdf

Binary file added.

railgun-doc/plot_directive/samples/lode_rk4/run.py

+from lode_rk4 import LinearODERK4
+
+lode = LinearODERK4(num_s=10000, num_d=2)
+lode.x[0] = [1, 0]  # access c-member "VAR" via lode.VAR
+lode.a = [[-0.5, 1], [-1, 0]]
+lode.run()  # mode='normal'
+
+import pylab
+lode.plot_x()
+pylab.show()

railgun-doc/plot_directive/samples/lode_rk4/run_debug.hires.png

Added
New image

railgun-doc/plot_directive/samples/lode_rk4/run_debug.pdf

Binary file added.

railgun-doc/plot_directive/samples/lode_rk4/run_debug.py

+from lode_rk4 import LinearODERK4
+
+lode = LinearODERK4(num_s=10000, num_d=2, _cmemsubsets_debug=True)
+lode.x[0] = [1, 0]  # access c-member "VAR" via lode.VAR
+lode.a = [[-0.5, 1], [-1, 0]]
+lode.run(mode='debug')
+
+import pylab
+lode.plot_k()
+pylab.show()

railgun-doc/py-modindex.html

    <h1>Python Module Index</h1>
 
    <div class="modindex-jumpbox">
-   <a href="#cap-r"><strong>r</strong></a>
+   <a href="#cap-r"><strong>r</strong></a> | 
+   <a href="#cap-y"><strong>y</strong></a>
    </div>
 
    <table class="indextable modindextable" cellspacing="0" cellpadding="2">
      <tr>
        <td></td>
        <td>
-       <a href="simobj.html#module-railgun"><tt class="xref">railgun</tt></a></td><td>
+       <a href="utils.html#module-railgun"><tt class="xref">railgun</tt></a></td><td>
+       <em></em></td></tr>
+     <tr class="pcap"><td></td><td>&nbsp;</td><td></td></tr>
+     <tr class="cap" id="cap-y"><td></td><td>
+       <strong>y</strong></td><td></td></tr>
+     <tr>
+       <td></td>
+       <td>
+       <a href="samples/lode_rk4/lode_rk4.html#module-yourcode"><tt class="xref">yourcode</tt></a></td><td>
        <em></em></td></tr>
    </table>
 

railgun-doc/samples/index.html

 <li class="toctree-l1"><a class="reference internal" href="lode_rk4/lode_rk4.html">Runge-Kutta method (usage of <tt class="docutils literal"><span class="pre">_cmemsubsets_</span></tt>)</a><ul>
 <li class="toctree-l2"><a class="reference internal" href="lode_rk4/lode_rk4.html#python-code-lode-rk4-py">Python code (<tt class="docutils literal"><span class="pre">lode_rk4.py</span></tt>)</a></li>
 <li class="toctree-l2"><a class="reference internal" href="lode_rk4/lode_rk4.html#c-code-lode-rk4-c">C code (<tt class="docutils literal"><span class="pre">lode_rk4.c</span></tt>)</a></li>
-<li class="toctree-l2"><a class="reference internal" href="lode_rk4/lode_rk4.html#running-without-intermediate-variables">Running without intermediate variables</a></li>
-<li class="toctree-l2"><a class="reference internal" href="lode_rk4/lode_rk4.html#running-with-intermediate-variables">Running with intermediate variables</a></li>
+<li class="toctree-l2"><a class="reference internal" href="lode_rk4/lode_rk4.html#running-on-normal-mode">Running on &#8220;normal mode&#8221;</a></li>
+<li class="toctree-l2"><a class="reference internal" href="lode_rk4/lode_rk4.html#running-on-debug-mode">Running on &#8220;debug mode&#8221;</a></li>
+<li class="toctree-l2"><a class="reference internal" href="lode_rk4/lode_rk4.html#reference">Reference</a></li>
 </ul>
 </li>
 <li class="toctree-l1"><a class="reference internal" href="kaplan_yorke_map/kaplan_yorke_map.html">Kaplan-Yorke map</a><ul>

railgun-doc/samples/kaplan_yorke_map/kaplan_yorke_map.html

 <h2>Output<a class="headerlink" href="#output" title="Permalink to this headline">¶</a></h2>
 <p>[<a class="reference external" href="../../plot_directive/samples/kaplan_yorke_map/kaplan_yorke_map.py">source code</a>, <a class="reference external" href="../../plot_directive/samples/kaplan_yorke_map/kaplan_yorke_map.hires.png">hires.png</a>, <a class="reference external" href="../../plot_directive/samples/kaplan_yorke_map/kaplan_yorke_map.pdf">pdf</a>]</p>
 <div class="figure">
-<img alt="../../_images/kaplan_yorke_map5.png" src="../../_images/kaplan_yorke_map5.png" />
+<img alt="../../_images/kaplan_yorke_map.png" src="../../_images/kaplan_yorke_map.png" />
 </div>
 </div>
 <div class="section" id="python-code">

railgun-doc/samples/lode/lode.html

 <h2>Output<a class="headerlink" href="#output" title="Permalink to this headline">¶</a></h2>
 <p>[<a class="reference external" href="../../plot_directive/samples/lode/lode.py">source code</a>, <a class="reference external" href="../../plot_directive/samples/lode/lode.hires.png">hires.png</a>, <a class="reference external" href="../../plot_directive/samples/lode/lode.pdf">pdf</a>]</p>
 <div class="figure">
-<img alt="../../_images/lode15.png" src="../../_images/lode15.png" />
+<img alt="../../_images/lode.png" src="../../_images/lode.png" />
 </div>
 </div>
 <div class="section" id="python-code">

railgun-doc/samples/lode_rk4/lode_rk4.html

         <div class="bodywrapper">
           <div class="body">
             
-  <div class="section" id="runge-kutta-method-usage-of-cmemsubsets">
+  <span class="target" id="module-yourcode"></span><div class="section" id="runge-kutta-method-usage-of-cmemsubsets">
 <h1>Runge-Kutta method (usage of <tt class="xref py py-attr docutils literal"><span class="pre">_cmemsubsets_</span></tt>)<a class="headerlink" href="#runge-kutta-method-usage-of-cmemsubsets" title="Permalink to this headline">¶</a></h1>
+<p>If you are using a lot of intermediate variables and want to check these
+variables for debugging, you can use <a class="reference internal" href="../../simobj.html#yourcode.YourSimObject._cmemsubsets_" title="yourcode.YourSimObject._cmemsubsets_"><tt class="xref py py-attr docutils literal"><span class="pre">YourSimObject._cmemsubsets_</span></tt></a> to
+allocate memory only when the flag is on.</p>
 <div class="section" id="python-code-lode-rk4-py">
 <h2>Python code (<tt class="docutils literal"><span class="pre">lode_rk4.py</span></tt>)<a class="headerlink" href="#python-code-lode-rk4-py" title="Permalink to this headline">¶</a></h2>
 <div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">railgun</span> <span class="kn">import</span> <span class="n">SimObject</span><span class="p">,</span> <span class="n">relpath</span><span class="p">,</span> <span class="n">cm</span>
         <span class="n">cm</span><span class="o">.</span><span class="n">double</span><span class="p">(</span><span class="o">*</span><span class="p">[</span><span class="s">&#39;k</span><span class="si">%s</span><span class="s">_debug[s][d]&#39;</span> <span class="o">%</span> <span class="n">s</span> <span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="s">&#39;1234&#39;</span><span class="p">])</span> <span class="o">+</span>
         <span class="n">cm</span><span class="o">.</span><span class="n">double</span><span class="p">(</span><span class="o">*</span><span class="p">[</span><span class="s">&#39;x</span><span class="si">%s</span><span class="s">_debug[s][d]&#39;</span> <span class="o">%</span> <span class="n">s</span> <span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="s">&#39;123&#39;</span><span class="p">])</span>
     <span class="p">)</span>
-    <span class="n">_cfuncs_</span> <span class="o">=</span> <span class="p">[</span><span class="s">&quot;x run_{level | normal, debug }()&quot;</span><span class="p">]</span>
+    <span class="n">_cfuncs_</span> <span class="o">=</span> <span class="p">[</span><span class="s">&quot;x run_{mode | normal, debug}()&quot;</span><span class="p">]</span>
     <span class="n">_cmemsubsets_</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span>
         <span class="n">debug</span><span class="o">=</span><span class="nb">dict</span><span class="p">(</span>
             <span class="n">funcs</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;run_debug&#39;</span><span class="p">],</span>
 </pre></div>
 </div>
 </div>
-<div class="section" id="running-without-intermediate-variables">
-<h2>Running without intermediate variables<a class="headerlink" href="#running-without-intermediate-variables" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="running-on-normal-mode">
+<h2>Running on &#8220;normal mode&#8221;<a class="headerlink" href="#running-on-normal-mode" title="Permalink to this headline">¶</a></h2>
 <div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">lode_rk4</span> <span class="kn">import</span> <span class="n">LinearODERK4</span>
 
 <span class="n">lode</span> <span class="o">=</span> <span class="n">LinearODERK4</span><span class="p">(</span><span class="n">num_s</span><span class="o">=</span><span class="mi">10000</span><span class="p">,</span> <span class="n">num_d</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
 <span class="n">lode</span><span class="o">.</span><span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span>  <span class="c"># access c-member &quot;VAR&quot; via lode.VAR</span>
 <span class="n">lode</span><span class="o">.</span><span class="n">a</span> <span class="o">=</span> <span class="p">[[</span><span class="o">-</span><span class="mf">0.5</span><span class="p">,</span> <span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]]</span>
-<span class="n">lode</span><span class="o">.</span><span class="n">run</span><span class="p">()</span>  <span class="c"># level=&#39;normal&#39;</span>
+<span class="n">lode</span><span class="o">.</span><span class="n">run</span><span class="p">()</span>  <span class="c"># mode=&#39;normal&#39;</span>
 
 <span class="kn">import</span> <span class="nn">pylab</span>
 <span class="n">lode</span><span class="o">.</span><span class="n">plot_x</span><span class="p">()</span>
 </div>
 <p>[<a class="reference external" href="../../plot_directive/samples/lode_rk4/run.py">source code</a>, <a class="reference external" href="../../plot_directive/samples/lode_rk4/run.hires.png">hires.png</a>, <a class="reference external" href="../../plot_directive/samples/lode_rk4/run.pdf">pdf</a>]</p>
 <div class="figure">
-<img alt="../../_images/run3.png" src="../../_images/run3.png" />
+<img alt="../../_images/run.png" src="../../_images/run.png" />
 </div>
 </div>
-<div class="section" id="running-with-intermediate-variables">
-<h2>Running with intermediate variables<a class="headerlink" href="#running-with-intermediate-variables" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="running-on-debug-mode">
+<h2>Running on &#8220;debug mode&#8221;<a class="headerlink" href="#running-on-debug-mode" title="Permalink to this headline">¶</a></h2>
+<p>You can create &#8220;debug mode&#8221; instance by giving <tt class="docutils literal"><span class="pre">_cmemsubsets_debug=True</span></tt>
+to your class constructor.</p>
 <div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">lode_rk4</span> <span class="kn">import</span> <span class="n">LinearODERK4</span>
 
 <span class="n">lode</span> <span class="o">=</span> <span class="n">LinearODERK4</span><span class="p">(</span><span class="n">num_s</span><span class="o">=</span><span class="mi">10000</span><span class="p">,</span> <span class="n">num_d</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">_cmemsubsets_debug</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
 <span class="n">lode</span><span class="o">.</span><span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span>  <span class="c"># access c-member &quot;VAR&quot; via lode.VAR</span>
 <span class="n">lode</span><span class="o">.</span><span class="n">a</span> <span class="o">=</span> <span class="p">[[</span><span class="o">-</span><span class="mf">0.5</span><span class="p">,</span> <span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">]]</span>
-<span class="n">lode</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">level</span><span class="o">=</span><span class="s">&#39;debug&#39;</span><span class="p">)</span>
+<span class="n">lode</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">mode</span><span class="o">=</span><span class="s">&#39;debug&#39;</span><span class="p">)</span>
 
 <span class="kn">import</span> <span class="nn">pylab</span>
 <span class="n">lode</span><span class="o">.</span><span class="n">plot_k</span><span class="p">()</span>
 </div>
 <p>[<a class="reference external" href="../../plot_directive/samples/lode_rk4/run_debug.py">source code</a>, <a class="reference external" href="../../plot_directive/samples/lode_rk4/run_debug.hires.png">hires.png</a>, <a class="reference external" href="../../plot_directive/samples/lode_rk4/run_debug.pdf">pdf</a>]</p>
 <div class="figure">
-<img alt="../../_images/run_debug3.png" src="../../_images/run_debug3.png" />
+<img alt="../../_images/run_debug.png" src="../../_images/run_debug.png" />
 </div>
 </div>
+<div class="section" id="reference">
+<h2>Reference<a class="headerlink" href="#reference" title="Permalink to this headline">¶</a></h2>
+<ul class="simple">
+<li><a class="reference external" href="http://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods">Runge–Kutta methods - Wikipedia, the free encyclopedia</a></li>
+</ul>
+</div>
 </div>
 
 
 <li><a class="reference internal" href="#">Runge-Kutta method (usage of <tt class="docutils literal"><span class="pre">_cmemsubsets_</span></tt>)</a><ul>
 <li><a class="reference internal" href="#python-code-lode-rk4-py">Python code (<tt class="docutils literal"><span class="pre">lode_rk4.py</span></tt>)</a></li>
 <li><a class="reference internal" href="#c-code-lode-rk4-c">C code (<tt class="docutils literal"><span class="pre">lode_rk4.c</span></tt>)</a></li>
-<li><a class="reference internal" href="#running-without-intermediate-variables">Running without intermediate variables</a></li>
-<li><a class="reference internal" href="#running-with-intermediate-variables">Running with intermediate variables</a></li>
+<li><a class="reference internal" href="#running-on-normal-mode">Running on &#8220;normal mode&#8221;</a></li>
+<li><a class="reference internal" href="#running-on-debug-mode">Running on &#8220;debug mode&#8221;</a></li>
+<li><a class="reference internal" href="#reference">Reference</a></li>
 </ul>
 </li>
 </ul>

railgun-doc/searchindex.js

-Search.setIndex({objects:{"":{railgun:[4,0,1]},railgun:{cmems:[2,1,1],SimObject:[4,4,1],relpath:[2,1,1]},"railgun.SimObject":{"_cfuncs_":[4,2,1],"_cmemsubsets_":[4,2,1],"_cmembers_":[4,2,1],setv:[4,3,1],num:[4,3,1],getv:[4,3,1],"_clibname_":[4,2,1],"_cfuncprefix_":[4,2,1],"_cstructname_":[4,2,1],"_clibdir_":[4,2,1]}},terms:{all:[0,7],code:[0,1,3,6,7,5],name1:4,four:4,scalar:4,follow:[0,4],run_debug:6,cython:0,myprefixfuncnam:4,intermedi:[6,3],program:[0,7],vec:4,liter:[4,6],string:[4,7],c_doubl:4,"void":6,util:[0,2],veri:0,c_int:4,level:[0,6],list:[4,7],prefix:[4,5],vector:[4,6,5],refer:[1,3],pleas:5,upper:[5,7],your_modul:2,s_debug:6,zero:7,pass:0,num_i2:4,run:[0,6,5,3,7],num_i1:4,index:[0,4,5,7],what:5,plot_x:6,libkaplan_yorke_map:1,access:[0,4,5,6,7],version:5,method:[0,4,6,3,7],othernameforpyclass:4,christian:1,gener:[0,2,7],here:[0,4,7],satisfi:4,beck:1,let:[0,2],xt_0:1,path:[2,4,7],along:[4,7],legend:6,"_clibdir_":[0,1,2,4,6,5,7],wait:7,search:0,figsiz:1,chang:7,linearordinarydifferentialequ:5,control:4,via:[0,6,5],although:0,func_:[4,7],modul:[0,2,4,7],double_vector:4,kaplanyorkemap:1,instal:0,should:[4,7],x1_debug:6,from:[0,1,2,4,6,5,7],memori:0,doubl:[0,1,2,4,6,5,7],two:[4,7],next:0,liblode_cfuncprefix:5,call:[0,4,7],c_ushort:4,type:[0,2,5,4,7],notic:5,relative_path:2,warn:4,name2:4,c_float:4,hold:7,must:[4,7],uint64:4,"_cwrap_":4,alia:4,arang:6,can:[0,2,4,7],def:[4,6],overrid:4,simobject:[0,1,2,3,4,5,6,7],kym:1,share:[0,1,6,4,7,5],indic:[0,4,7],kaplanyorkemap_gene_seq:1,sourc:[1,0,2,6,5],lode_rk4:[6,3],want:[0,4,7],dxd:[6,5],unsign:4,alwai:[0,7],differenti:[0,3,5],end:[0,4,7],ordinari:[0,3,5],double_matrix:4,write:[0,1,6,4,7,5],how:[0,5,7],sever:[4,7],longlong:4,map:[1,0,3],after:4,befor:0,uint:4,mai:0,multipl:4,data:[0,2,4],stress:0,"short":[0,4],essenti:7,num_:[0,1,6,4,7,5],correspond:4,element:[1,4],int64:4,linearoderk4_:6,order:[4,7],nameofstruct_func_method3:7,nameofstruct_func_method2:7,nameofstruct_func_method1:7,double_scalar:4,c_bool:4,pointer:7,typedef:[1,0,6,5,7],c_longlong:4,chosen:4,platform:4,yt_0:1,calc_xi:6,lode_cstructnam:5,easier:0,myprefix:4,good:0,"return":[0,1,6,4,7,5],python:[0,1,2,3,4,5,6,7],auto:7,var_nam:4,bound:[5,7],now:5,introduct:1,choic:[4,7],"schl\u00f6gl":1,name:[1,4,5,6,7],int_matrix:4,easili:[0,2],k4_debug:6,debug:6,side:0,mean:[5,7],subset:4,k1_debug:6,our:7,meth:7,special:[2,7],variabl:[0,4,6,3,7],ulonglong:4,matrix:[4,6,5],ret:7,content:0,rel:[2,4,7],uint32:4,pul:7,linear:[0,6,3,5],free:1,base:4,york:[1,0,3],org:0,lmd:1,care:4,omit:[4,5,7],plot:[1,0,6,5],thing:0,nameofstruct_name_of_funct:7,rais:7,gene_seq:1,first:7,s_end:[5,7],rang:[6,5,7],pyrex:0,onc:[4,7],arrai:[0,1,6,4,7,5],number:[4,7],sometim:0,fast:0,klist:6,size:[1,4,5,6,7],linearoderk4_run_norm:6,differ:5,x3_debug:6,system:1,wrapper:4,subplot:5,option:[4,7],relationship:[0,4],especi:0,copi:[4,5],setuptool:0,alloc:0,specifi:[4,5,7],liblod:[0,5,7],png:[1,6,5],overwrit:4,keyword:7,provid:0,tree:2,second:7,charact:4,arg_nam:4,pre:[4,6],argument:[0,4,5,7],packag:0,have:[0,2,4,7],tabl:0,need:[0,1,6,4,7,5],self:[0,1,6,4,7,5],simul:[1,0],note:[2,4,7],also:4,without:[6,5,3,7],take:7,which:[0,2,4,7],kaplan:[1,0,3],encyclopedia:1,ulong:4,normal:[6,5],k3_debug:6,letter:4,pair:0,"class":[0,1,2,4,6,5,7],linearod:[0,5,7],don:[4,7],doe:4,ext:2,declar:[1,6,5,7],axi:7,tkf:0,iterate_onc:6,show:[1,0,6,5],enumer:[6,5],syntax:4,cdt:[0,2,4],line:[4,5],your_clib:2,onli:0,explicitli:4,enough:0,rasi:4,dict:[4,6],local:4,variou:7,get:[2,4,7],"__file__":[0,1,2,6,7,5],run_:6,c_ulong:4,requir:[0,7],bar:4,plot_k:6,stuff:0,rung:[0,6,3],where:[4,7],set:[4,5,6,7],a_0_0:[5,7],"_cmembers_":[0,1,2,4,6,5,7],see:[0,4,7],num:4,arg:[2,4,7],num_in:4,railgun:[0,1,2,4,6,5,7],wikipedia:1,label:6,figur:1,"import":[1,0,6,5,7],attribut:[2,4],cstructnam:4,kei:[4,7],kaplanyorkemap_:1,numer:0,style:[0,7],lode:[0,6,5,7],solv:[6,5],come:4,addit:4,last:7,ushort:4,instanc:7,equat:[0,6,3,5],pdf:[1,6,5],load:[0,2,5,4,7],among:[0,4],simpli:5,kwd:4,cmem:[2,4],non:7,creat:[4,7],fortran:0,s_start:7,numpi:[0,4],three:5,empti:7,much:0,valu:[4,5,6,7],great:0,func_foo:4,linearode_run:[0,5,7],c_char:4,func:[4,6,7],k2_debug:6,defin:[4,7],"_cstructname_":[4,3,5],abov:[0,7],error:[4,7],func_nam:[4,7],c_ulonglong:4,chaotic:1,nameofstruct:7,scipi:0,"__init__":4,welcom:0,make:7,same:[2,4,7],member:[1,4,5,6,7],your_c_funct:4,tutori:[0,7],document:0,getv:[1,4,6],complet:0,kutta:[0,6,3],http:0,c_uint:4,effect:4,hand:0,name_of_shared_librari:4,temporari:7,cdt_or_index:4,inherit:7,setv:[1,4,5,7],exampl:[0,4,7],thi:[0,2,5,4,7],choos:4,everyth:[0,4],dimension:[6,5],name_of_c_funct:4,linearoderk4:6,just:5,less:0,pylab:[1,0,6,5],shape:4,psyco:0,speed:0,languag:[0,4],struct:[0,1,6,4,7,5],easi:[0,7],c_short:4,makefil:2,friedrich:1,add:7,c_func_nam:4,dtype:[0,4],float32:4,build:2,int32:4,longdoubl:4,read:0,know:7,like:[0,2,4,7],specif:7,docutil:[4,6],"_cfuncs_":[0,1,6,4,7,5],int_scalar:4,some_funct:4,output:[1,3,5],func_with_arg:4,page:0,thermodynam:1,some:7,sampl:[0,3],int_vector2:4,int_vector1:4,librari:[0,1,6,4,7,5],var_0_1:4,definit:[1,2,3,4,7],markers:1,leav:7,linearoderk4_run_debug:6,relpath:[0,1,2,4,6,5,7],c_long:4,method2:7,method3:7,method1:7,usag:[0,2,6,3],funcnam:4,repositori:0,"_cmemsubsets_debug":6,src:2,obj:4,func_spam:4,book:1,"float":4,easy_instal:0,automat:[0,4,7],liblode_rk4:6,wrap:4,"_cwrap_your_c_funct":4,your:[0,2,4,7],span:[4,6],wai:[0,7],yoursimobj:4,"long":4,avail:4,start:4,low:0,"_clibname_":[0,1,2,4,6,5,7],"var":[4,6,5],"function":[0,2,5,4,7],form:7,num_i:[1,4],bitbucket:0,"_cfuncprefix_":[4,3,5],"true":6,notat:[4,7],hire:[1,6,5],consist:[0,7],"default":[4,5,6,7],"_cmemsubsets_":[0,4,6,3],c_longdoubl:4,featur:7,calc_f:6,nameofcstruct:4,"int":[0,1,2,4,6,5,7],certain:[0,7],"char":4,file:[2,4,7],pip:0,check:[0,7],fill:4,linearode_:[0,5,7],googl:1,when:[0,4],other:0,bool:4,you:[0,2,4,7],architectur:4,ctype:[0,4],old_c_funct:4,num_j:4,num_k:4,directori:[1,4,5,6,7],num_d:[0,6,5,7],pathnam:2,x2_debug:6,return_var:4},objtypes:{"0":"py:module","1":"py:function","2":"py:attribute","3":"py:method","4":"py:class"},titles:["Welcome to RailGun&#8217;s documentation!","Kaplan-Yorke map","Utility functions","Samples","<tt class=\"docutils literal\"><span class=\"pre\">SimObject</span></tt> &#8212; A class loads everything you need from C shared library","Linear Ordinary Differential Equation","Runge-Kutta method (usage of <tt class=\"docutils literal docutils literal docutils literal\"><span class=\"pre\">_cmemsubsets_</span></tt>)","RailGun Tutorial"],objnames:{"0":"Python module","1":"Python function","2":"Python attribute","3":"Python method","4":"Python class"},filenames:["index","samples/kaplan_yorke_map/kaplan_yorke_map","utils","samples/index","simobj","samples/lode/lode","samples/lode_rk4/lode_rk4","tutorial"]})
+Search.setIndex({objects:{"":{railgun:[2,0,1],yourcode:[4,0,1]},railgun:{cmems:[2,1,1],SimObject:[6,3,1],relpath:[2,1,1]},"railgun.SimObject":{setv:[6,4,1],num:[6,4,1],getv:[6,4,1]},yourcode:{YourSimObject:[6,3,1]},"yourcode.YourSimObject":{"_cwrap_C_FUNC_NAME":[6,4,1],"_cfuncs_":[6,2,1],"_cmemsubsets_":[6,2,1],"_cmembers_":[6,2,1],"_cstructname_":[6,2,1],"_clibname_":[6,2,1],"_cfuncprefix_":[6,2,1],"_clibdir_":[6,2,1]}},terms:{all:[0,7],code:[0,1,3,4,7,5],name1:6,four:6,scalar:6,follow:[0,6],run_debug:4,cython:0,myprefixfuncnam:6,intermedi:4,program:[0,7],vec:6,liter:[4,6],string:[6,7],c_doubl:6,"void":4,util:[0,2],veri:0,c_int:6,level:0,list:[6,7],prefix:[6,5],vector:[4,6,5],refer:[1,4,3],pleas:[6,5],upper:[5,7],your_modul:2,s_debug:4,zero:7,pass:0,num_i2:6,run:[0,4,5,3,7],num_i1:6,index:[0,6,5,7],what:5,plot_x:4,libkaplan_yorke_map:1,access:[0,4,5,6,7],version:5,method:[6,0,4,3,7],othernameforpyclass:6,christian:1,gener:[0,2,7],here:[0,6,7],satisfi:6,beck:1,let:[0,2],xt_0:1,path:[2,6,7],along:[6,7],legend:4,"_clibdir_":[0,1,2,6,4,5,7],wait:7,search:0,figsiz:1,chang:7,linearordinarydifferentialequ:5,control:6,via:[0,4,5],although:0,func_:[6,7],modul:[0,2,6,7],double_vector:6,kaplanyorkemap:1,instal:0,should:[6,7],x1_debug:4,from:[0,1,2,6,4,5,7],memori:[0,4],doubl:[0,1,2,6,4,5,7],two:[6,7],next:0,liblode_cfuncprefix:5,call:[0,6,7],c_ushort:6,type:[0,2,5,6,7],notic:5,relative_path:2,warn:6,flag:4,name2:6,c_float:6,hold:7,must:[6,7],uint64:6,alia:6,arang:4,can:[6,0,2,4,7],def:[4,6],overrid:6,simobject:[0,1,2,3,4,5,6,7],kym:1,give:4,share:[0,1,6,4,7,5],indic:[0,6,7],kaplanyorkemap_gene_seq:1,sourc:[1,0,2,4,5],lode_rk4:[4,3],want:[0,4,6,7],dxd:[4,5],unsign:6,alwai:[0,7],differenti:[0,3,5],end:[0,6,7],ordinari:[0,3,5],double_matrix:6,write:[0,1,6,4,7,5],how:[0,5,7],sever:[6,7],longlong:6,map:[1,0,3],after:6,befor:0,uint:6,mai:0,multipl:6,data:[0,2,6],stress:0,"short":[0,6],essenti:7,num_:[0,1,6,4,7,5],correspond:6,element:[1,6],int64:6,linearoderk4_:4,order:[6,7],nameofstruct_func_method3:7,nameofstruct_func_method2:7,nameofstruct_func_method1:7,double_scalar:6,c_bool:6,pointer:7,typedef:[1,0,4,5,7],c_longlong:6,chosen:6,platform:6,yt_0:1,calc_xi:4,lode_cstructnam:5,easier:0,myprefix:6,good:0,"return":[0,1,6,4,7,5],python:[0,1,2,3,4,5,6,7],auto:7,var_nam:6,"_cwrap_c_func_nam":6,now:5,introduct:1,choic:[6,7],"schl\u00f6gl":1,name:[1,4,5,6,7],int_matrix:6,easili:[0,2],mode:[4,3],debug:[4,3],side:0,mean:[6,5,7],subset:6,k1_debug:4,our:7,meth:7,special:[2,7],variabl:[0,4,6,7],ulonglong:6,matrix:[4,6,5],ret:7,content:0,rel:[2,6,7],uint32:6,pul:7,linear:[0,4,3,5],free:[1,4],k4_debug:4,base:6,york:[1,0,3],org:0,lmd:1,care:6,yourcod:6,omit:[6,5,7],plot:[1,0,4,5],thing:0,nameofstruct_name_of_funct:7,name_of_shared_librari:6,gene_seq:1,first:7,s_end:[5,7],rang:[4,5,7],pyrex:0,onc:[6,7],arrai:[0,1,6,4,7,5],number:[6,7],sometim:0,fast:0,klist:4,size:[1,4,5,6,7],linearoderk4_run_norm:4,differ:5,x3_debug:4,system:1,wrapper:6,subplot:5,option:[6,7],relationship:[0,6],especi:0,copi:[6,5],setuptool:0,alloc:[0,4],specifi:[6,5,7],liblod:[0,5,7],png:[1,4,5],overwrit:6,keyword:7,provid:0,tree:2,second:7,charact:6,arg_nam:6,pre:[4,6],argument:[0,6,5,7],packag:0,have:[0,2,6,7],tabl:0,need:[0,1,6,4,7,5],self:[0,1,6,4,7,5],simul:[1,0],note:[2,6,7],also:6,without:[5,7],take:7,which:[0,2,6,7],kaplan:[1,0,3],encyclopedia:[1,4],ulong:6,normal:[4,3,5],k3_debug:4,letter:6,pair:0,"class":[0,1,2,6,4,5,7],linearod:[0,5,7],don:[6,7],doe:6,ext:2,declar:[1,4,5,7],axi:7,tkf:0,iterate_onc:4,show:[1,0,4,5],enumer:[4,5],syntax:6,cdt:[0,2,6],line:[6,5],your_clib:2,onli:[0,4],explicitli:6,enough:0,rasi:6,dict:[4,6],local:6,variou:7,get:[2,6,7],"__file__":[0,1,2,4,7,5],run_:4,c_ulong:6,requir:[0,7],bar:6,plot_k:4,stuff:0,rung:[0,4,3],where:[6,7],set:[4,5,6,7],a_0_0:[5,7],"_cmembers_":[0,1,2,6,4,5,7],see:[0,6,7],num:6,arg:[2,6,7],num_in:6,railgun:[0,1,2,6,4,5,7],wikipedia:[1,4],label:4,figur:1,"import":[1,0,4,5,7],attribut:[2,6],cstructnam:6,bound:[5,7],kei:[6,7],kaplanyorkemap_:1,numer:0,style:[0,7],lode:[0,4,5,7],solv:[4,5],come:6,addit:6,last:7,ushort:6,instanc:[4,7],equat:[0,4,3,5],pdf:[1,4,5],load:[0,2,5,6,7],among:[0,6],simpli:5,kwd:6,cmem:[2,6],non:7,creat:[4,6,7],fortran:0,s_start:7,numpi:[0,6],three:5,empti:7,much:0,valu:[4,5,6,7],great:0,func_foo:6,linearode_run:[0,5,7],c_char:6,func:[4,6,7],k2_debug:4,defin:[6,7],"_cstructname_":[6,3,5],abov:[0,7],error:[6,7],func_nam:[6,7],c_ulonglong:6,chaotic:1,nameofstruct:7,scipi:0,"__init__":6,welcom:0,make:7,same:[2,6,7],member:[1,4,5,6,7],your_c_funct:6,tutori:[0,7],document:[0,6],getv:[1,4,6],complet:0,kutta:[0,4,3],http:0,c_uint:6,effect:6,hand:0,rais:7,temporari:7,cdt_or_index:6,inherit:7,setv:[1,6,5,7],exampl:[0,6,7],thi:[0,2,5,6,7],choos:6,everyth:[0,6],dimension:[4,5],name_of_c_funct:6,linearoderk4:4,just:5,less:0,pylab:[1,0,4,5],shape:6,psyco:0,yoursimobject:[4,6],speed:0,languag:[0,6],struct:[0,1,6,4,7,5],easi:[0,7],c_short:6,makefil:2,friedrich:1,add:7,c_func_nam:6,dtype:[0,6],float32:6,build:2,int32:6,longdoubl:6,read:0,know:7,like:[0,2,6,7],specif:7,docutil:[4,6],"_cfuncs_":[0,1,6,4,7,5],int_scalar:6,some_funct:6,output:[1,3,5],func_with_arg:6,page:0,thermodynam:1,some:7,sampl:[0,3],int_vector2:6,int_vector1:6,librari:[0,1,6,4,7,5],var_0_1:6,definit:[1,2,3,7,6],markers:1,leav:7,linearoderk4_run_debug:4,relpath:[0,1,2,6,4,5,7],c_long:6,method2:7,method3:7,method1:7,usag:[0,2,4,3],funcnam:6,repositori:0,"_cmemsubsets_debug":4,src:2,obj:6,func_spam:6,constructor:4,book:1,"float":6,easy_instal:0,automat:[0,6,7],liblode_rk4:4,wrap:6,"_cwrap_your_c_funct":6,your:[6,0,2,4,7],span:[4,6],wai:[0,7],"long":6,avail:6,start:6,low:0,lot:4,"_clibname_":[0,1,2,6,4,5,7],"var":[4,6,5],"function":[0,2,5,6,7],form:7,num_i:[1,6],bitbucket:0,"_cfuncprefix_":[6,3,5],"true":4,notat:[6,7],hire:[1,4,5],consist:[0,7],"default":[4,5,6,7],"_cmemsubsets_":[0,4,3,6],c_longdoubl:6,featur:7,calc_f:4,"int":[0,1,2,6,4,5,7],certain:[0,7],"char":6,file:[2,6,7],pip:0,check:[0,4,7],fill:6,linearode_:[0,5,7],googl:1,when:[0,4,6],other:0,bool:6,you:[6,0,2,4,7],architectur:6,ctype:[0,6],old_c_funct:6,num_j:6,num_k:6,directori:[1,4,5,6,7],num_d:[0,4,5,7],pathnam:2,x2_debug:4,return_var:6},objtypes:{"0":"py:module","1":"py:function","2":"py:attribute","3":"py:class","4":"py:method"},titles:["Welcome to RailGun&#8217;s documentation!","Kaplan-Yorke map","Utility functions","Samples","Runge-Kutta method (usage of <tt class=\"docutils literal docutils literal docutils literal\"><span class=\"pre\">_cmemsubsets_</span></tt>)","Linear Ordinary Differential Equation","<tt class=\"docutils literal\"><span class=\"pre\">SimObject</span></tt> &#8212; A class loads everything you need from C shared library","RailGun Tutorial"],objnames:{"0":"Python module","1":"Python function","2":"Python attribute","3":"Python class","4":"Python method"},filenames:["index","samples/kaplan_yorke_map/kaplan_yorke_map","utils","samples/index","samples/lode_rk4/lode_rk4","samples/lode/lode","simobj","tutorial"]})

railgun-doc/simobj.html

         <div class="bodywrapper">
           <div class="body">
             
-  <div class="section" id="module-railgun">
-<span id="simobject-a-class-loads-everything-you-need-from-c-shared-library"></span><h1><tt class="xref py py-class docutils literal"><span class="pre">SimObject</span></tt> &#8212; A class loads everything you need from C shared library<a class="headerlink" href="#module-railgun" title="Permalink to this headline">¶</a></h1>
+  <div class="section" id="simobject-a-class-loads-everything-you-need-from-c-shared-library">
+<h1><tt class="xref py py-class docutils literal"><span class="pre">SimObject</span></tt> &#8212; A class loads everything you need from C shared library<a class="headerlink" href="#simobject-a-class-loads-everything-you-need-from-c-shared-library" title="Permalink to this headline">¶</a></h1>
 <dl class="class">
-<dt id="railgun.SimObject">
-<em class="property">class </em><tt class="descclassname">railgun.</tt><tt class="descname">SimObject</tt><a class="headerlink" href="#railgun.SimObject" title="Permalink to this definition">¶</a></dt>
-<dd><p>A base class used for loading C shared library.
-You will need to define four attribute: <a class="reference internal" href="#railgun.SimObject._clibname_" title="railgun.SimObject._clibname_"><tt class="xref py py-attr docutils literal"><span class="pre">_clibname_</span></tt></a>,
-<a class="reference internal" href="#railgun.SimObject._clibdir_" title="railgun.SimObject._clibdir_"><tt class="xref py py-attr docutils literal"><span class="pre">_clibdir_</span></tt></a>, <a class="reference internal" href="#railgun.SimObject._cmembers_" title="railgun.SimObject._cmembers_"><tt class="xref py py-attr docutils literal"><span class="pre">_cmembers_</span></tt></a> and <a class="reference internal" href="#railgun.SimObject._cfuncs_" title="railgun.SimObject._cfuncs_"><tt class="xref py py-attr docutils literal"><span class="pre">_cfuncs_</span></tt></a>.</p>
+<dt id="yourcode.YourSimObject">
+<em class="property">class </em><tt class="descclassname">yourcode.</tt><tt class="descname">YourSimObject</tt><a class="headerlink" href="#yourcode.YourSimObject" title="Permalink to this definition">¶</a></dt>
+<dd><p>To load your C shared library, please define this class which
+override <a class="reference internal" href="#railgun.SimObject" title="railgun.SimObject"><tt class="xref py py-class docutils literal"><span class="pre">railgun.SimObject</span></tt></a>.
+You will need to define four attribute: <a class="reference internal" href="#yourcode.YourSimObject._clibname_" title="yourcode.YourSimObject._clibname_"><tt class="xref py py-attr docutils literal"><span class="pre">_clibname_</span></tt></a>,
+<a class="reference internal" href="#yourcode.YourSimObject._clibdir_" title="yourcode.YourSimObject._clibdir_"><tt class="xref py py-attr docutils literal"><span class="pre">_clibdir_</span></tt></a>, <a class="reference internal" href="#yourcode.YourSimObject._cmembers_" title="yourcode.YourSimObject._cmembers_"><tt class="xref py py-attr docutils literal"><span class="pre">_cmembers_</span></tt></a> and <a class="reference internal" href="#yourcode.YourSimObject._cfuncs_" title="yourcode.YourSimObject._cfuncs_"><tt class="xref py py-attr docutils literal"><span class="pre">_cfuncs_</span></tt></a>.</p>
+<div class="admonition note">
+<p class="first admonition-title">Note</p>
+<p class="last">In this document, <a class="reference internal" href="#yourcode.YourSimObject" title="yourcode.YourSimObject"><tt class="xref py py-class docutils literal"><span class="pre">yourcode.YourSimObject</span></tt></a> means the class
+<em>you need to define</em>. It is not the class in RailGun.</p>
+</div>
 <p>Example:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">NameOfCStruct</span><span class="p">(</span><span class="n">SimObject</span><span class="p">):</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">YourSimObject</span><span class="p">(</span><span class="n">SimObject</span><span class="p">):</span>
     <span class="n">_clibname_</span> <span class="o">=</span> <span class="s">&#39;name_of_shared_library.so&#39;</span>
     <span class="n">_clibdir_</span> <span class="o">=</span> <span class="s">&#39;path/to/shared/library&#39;</span>
 
 </pre></div>
 </div>
 <ul class="simple">
-<li>You can override <tt class="xref py py-meth docutils literal"><span class="pre">SimObject.__init__()</span></tt>.</li>
+<li>You can override <tt class="xref py py-meth docutils literal"><span class="pre">railgun.SimObject.__init__()</span></tt>.</li>
 <li>You can define additional python methods or members.
-But be careful with name: <a class="reference internal" href="#railgun.SimObject" title="railgun.SimObject"><tt class="xref py py-class docutils literal"><span class="pre">SimObject</span></tt></a> will overwrite
+But be careful with name: <a class="reference internal" href="#railgun.SimObject" title="railgun.SimObject"><tt class="xref py py-class docutils literal"><span class="pre">railgun.SimObject</span></tt></a> will overwrite
 the methods or members of your class with name in
-<a class="reference internal" href="#railgun.SimObject._cmembers_" title="railgun.SimObject._cmembers_"><tt class="xref py py-attr docutils literal"><span class="pre">_cmembers_</span></tt></a> and <a class="reference internal" href="#railgun.SimObject._cfuncs_" title="railgun.SimObject._cfuncs_"><tt class="xref py py-attr docutils literal"><span class="pre">_cfuncs_</span></tt></a>.</li>
+<a class="reference internal" href="#yourcode.YourSimObject._cmembers_" title="yourcode.YourSimObject._cmembers_"><tt class="xref py py-attr docutils literal"><span class="pre">_cmembers_</span></tt></a> and <a class="reference internal" href="#yourcode.YourSimObject._cfuncs_" title="yourcode.YourSimObject._cfuncs_"><tt class="xref py py-attr docutils literal"><span class="pre">_cfuncs_</span></tt></a>.</li>
 </ul>
 <dl class="attribute">
-<dt id="railgun.SimObject._clibname_">
-<tt class="descname">_clibname_</tt><a class="headerlink" href="#railgun.SimObject._clibname_" title="Permalink to this definition">¶</a></dt>
+<dt id="yourcode.YourSimObject._clibname_">
+<tt class="descname">_clibname_</tt><a class="headerlink" href="#yourcode.YourSimObject._clibname_" title="Permalink to this definition">¶</a></dt>
 <dd><p>Name of your C shared library.</p>
 </dd></dl>
 
 <dl class="attribute">
-<dt id="railgun.SimObject._clibdir_">
-<tt class="descname">_clibdir_</tt><a class="headerlink" href="#railgun.SimObject._clibdir_" title="Permalink to this definition">¶</a></dt>
+<dt id="yourcode.YourSimObject._clibdir_">
+<tt class="descname">_clibdir_</tt><a class="headerlink" href="#yourcode.YourSimObject._clibdir_" title="Permalink to this definition">¶</a></dt>
 <dd><p>Path of the directory where your C library are.
 If you want to specify relative path from where
-this python module file are, you can use <a class="reference internal" href="utils.html#railgun.relpath" title="railgun.relpath"><tt class="xref py py-func docutils literal"><span class="pre">relpath()</span></tt></a>.</p>
+this python module file are, you can use <tt class="xref py py-func docutils literal"><span class="pre">relpath()</span></tt>.</p>
 </dd></dl>
 
 <dl class="attribute">
-<dt id="railgun.SimObject._cmembers_">
-<tt class="descname">_cmembers_</tt><a class="headerlink" href="#railgun.SimObject._cmembers_" title="Permalink to this definition">¶</a></dt>
+<dt id="yourcode.YourSimObject._cmembers_">
+<tt class="descname">_cmembers_</tt><a class="headerlink" href="#yourcode.YourSimObject._cmembers_" title="Permalink to this definition">¶</a></dt>
 <dd><p>This is a list of the definitions of C variables with
 following syntax:</p>
 <div class="highlight-python"><pre>[CDT] VAR_NAME[INDEX] [= DEFAULT]</pre>
     <span class="p">]</span>
 </pre></div>
 </div>
-<p>See also: <a class="reference internal" href="utils.html#railgun.cmems" title="railgun.cmems"><tt class="xref py py-func docutils literal"><span class="pre">cmems()</span></tt></a></p>
+<p>See also: <a class="reference internal" href="utils.html#railgun.cmems" title="railgun.cmems"><tt class="xref py py-func docutils literal"><span class="pre">railgun.cmems()</span></tt></a></p>
 </dd></dl>
 
 <dl class="attribute">
-<dt id="railgun.SimObject._cfuncs_">
-<tt class="descname">_cfuncs_</tt><a class="headerlink" href="#railgun.SimObject._cfuncs_" title="Permalink to this definition">¶</a></dt>
+<dt id="yourcode.YourSimObject._cfuncs_">
+<tt class="descname">_cfuncs_</tt><a class="headerlink" href="#yourcode.YourSimObject._cfuncs_" title="Permalink to this definition">¶</a></dt>
 <dd><p>This is a list of the definitions of C functions with
 following syntax:</p>
 <div class="highlight-python"><pre>[RETURN_VAR] FUNC_NAME([ARG, ARG, ...])</pre>
 </dd></dl>
 
 <dl class="attribute">
-<dt id="railgun.SimObject._cstructname_">
-<tt class="descname">_cstructname_</tt><a class="headerlink" href="#railgun.SimObject._cstructname_" title="Permalink to this definition">¶</a></dt>
+<dt id="yourcode.YourSimObject._cstructname_">
+<tt class="descname">_cstructname_</tt><a class="headerlink" href="#yourcode.YourSimObject._cstructname_" title="Permalink to this definition">¶</a></dt>
 <dd><p>This is optional. This is used to specify the name of C struct
 explicitly:</p>
 <div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">CStructName</span><span class="p">(</span><span class="n">SimObject</span><span class="p">):</span>  <span class="c"># &#39;CStructName&#39; is name of c-struct</span>
 </dd></dl>
 
 <dl class="attribute">
-<dt id="railgun.SimObject._cfuncprefix_">
-<tt class="descname">_cfuncprefix_</tt><a class="headerlink" href="#railgun.SimObject._cfuncprefix_" title="Permalink to this definition">¶</a></dt>
+<dt id="yourcode.YourSimObject._cfuncprefix_">
+<tt class="descname">_cfuncprefix_</tt><a class="headerlink" href="#yourcode.YourSimObject._cfuncprefix_" title="Permalink to this definition">¶</a></dt>
 <dd><p>This is optional. This is used to specify the prefix of C functions
 explicitly (default is name of C Struct + <tt class="docutils literal"><span class="pre">_</span></tt>):</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">YourSimObj</span><span class="p">(</span><span class="n">SimObject</span><span class="p">):</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">YourSimObject</span><span class="p">(</span><span class="n">SimObject</span><span class="p">):</span>
     <span class="o">...</span>
     <span class="n">_cfuncprefix_</span> <span class="o">=</span> <span class="s">&#39;MyPrefix&#39;</span>
     <span class="n">_cfuncs_</span> <span class="o">=</span> <span class="p">[</span>
         <span class="o">...</span>
         <span class="p">]</span>
 
-<span class="k">class</span> <span class="nc">YourSimObj</span><span class="p">(</span><span class="n">SimObject</span><span class="p">):</span>
+<span class="k">class</span> <span class="nc">YourSimObject</span><span class="p">(</span><span class="n">SimObject</span><span class="p">):</span>
     <span class="o">...</span>
     <span class="n">_cfuncprefix_</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>
     <span class="n">_cfuncs_</span> <span class="o">=</span> <span class="p">[</span>
 </dd></dl>
 
 <dl class="attribute">
-<dt id="railgun.SimObject._cmemsubsets_">
-<tt class="descname">_cmemsubsets_</tt><a class="headerlink" href="#railgun.SimObject._cmemsubsets_" title="Permalink to this definition">¶</a></dt>
+<dt id="yourcode.YourSimObject._cmemsubsets_">
+<tt class="descname">_cmemsubsets_</tt><a class="headerlink" href="#yourcode.YourSimObject._cmemsubsets_" title="Permalink to this definition">¶</a></dt>
 <dd><p>dict of dict of list, optional
 Definition of subset of C members for controlling which
 C members to be loaded. Example:</p>
 </dd></dl>
 
 <dl class="method">
-<dt>
-<tt class="descname">SimObject._cwrap_{C_FUNC_NAME}(func)</tt></dt>
+<dt id="yourcode.YourSimObject._cwrap_C_FUNC_NAME">
+<tt class="descname">_cwrap_C_FUNC_NAME</tt><big>(</big><em>func</em><big>)</big><a class="headerlink" href="#yourcode.YourSimObject._cwrap_C_FUNC_NAME" title="Permalink to this definition">¶</a></dt>
 <dd><p>This is optional. If you want to wrap C function <tt class="docutils literal"><span class="pre">C_FUNC_NAME</span></tt>,
 define this wrapper function.</p>
 <p>Example:</p>
-<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">YourSimObj</span><span class="p">(</span><span class="n">SimObject</span><span class="p">):</span>
+<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">YourSimObject</span><span class="p">(</span><span class="n">SimObject</span><span class="p">):</span>
 
     <span class="n">_clibname_</span> <span class="o">=</span> <span class="s">&#39;...&#39;</span>
     <span class="n">_clibdir_</span> <span class="o">=</span> <span class="s">&#39;...&#39;</span>
 </div>
 </dd></dl>
 
-<dl class="method">
+</dd></dl>
+
+<dl class="class">
+<dt id="railgun.SimObject">
+<em class="property">class </em><tt class="descclassname">railgun.</tt><tt class="descname">SimObject</tt><a class="headerlink" href="#railgun.SimObject" title="Permalink to this definition">¶</a></dt>
+<dd><dl class="method">
 <dt id="railgun.SimObject.setv">
 <tt class="descname">setv</tt><big>(</big><em>**kwds</em><big>)</big><a class="headerlink" href="#railgun.SimObject.setv" title="Permalink to this definition">¶</a></dt>
 <dd><p>This is used for setting values of C struct members.</p>

railgun-doc/utils.html

 <dl class="function">
 <dt id="railgun.cmems">
 <tt class="descclassname">railgun.</tt><tt class="descname">cmems</tt><big>(</big><em>cdt</em>, <em>*args</em><big>)</big><a class="headerlink" href="#railgun.cmems" title="Permalink to this definition">¶</a></dt>
-<dd><p>Generate <a class="reference internal" href="simobj.html#railgun.SimObject._cmembers_" title="railgun.SimObject._cmembers_"><tt class="xref py py-attr docutils literal"><span class="pre">SimObject._cmembers_</span></tt></a> for same C Data Type (CDT)
+<dd><p>Generate <tt class="xref py py-attr docutils literal"><span class="pre">SimObject._cmembers_</span></tt> for same C Data Type (CDT)
 easily</p>
 <p>Usage:</p>
 <div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">cmems</span><span class="p">(</span><span class="s">&#39;int&#39;</span><span class="p">,</span> <span class="s">&#39;a&#39;</span><span class="p">,</span> <span class="s">&#39;b&#39;</span><span class="p">,</span> <span class="s">&#39;c&#39;</span><span class="p">)</span>