1 2 3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 5<html xmlns="http://www.w3.org/1999/xhtml"> 6 <head> 7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 8 9 <title>multi_iter - Boost.Python NumPy extension 1.0 documentation</title> 10 <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> 11 <link rel="stylesheet" href="../_static/style.css" type="text/css" /> 12 <script type="text/javascript"> 13 var DOCUMENTATION_OPTIONS = { 14 URL_ROOT: '../', 15 VERSION: '1.0', 16 COLLAPSE_MODINDEX: false, 17 FILE_SUFFIX: '.html' 18 }; 19 </script> 20 <script type="text/javascript" src="../_static/jquery.js"></script> 21 <script type="text/javascript" src="../_static/underscore.js"></script> 22 <script type="text/javascript" src="../_static/doctools.js"></script> 23 <link rel="index" title="Index" href="../genindex.html" /> 24 <link rel="search" title="Search" href="../search.html" /> 25 <link rel="top" title="Boost.Python NumPy extension 1.0 documentation" href="../index.html" /> 26 <link rel="up" title="Boost.Python NumPy extension Reference" href="index.html" /> 27 <link rel="prev" title="binary_ufunc" href="binary_ufunc.html" /> 28 </head> 29 <body> 30 <div class="header"> 31 <table border="0" cellpadding="7" cellspacing="0" width="100%" summary= 32 "header"> 33 <tr> 34 <td valign="top" width="300"> 35 <h3><a href="../index.html"><img 36 alt="C++ Boost" src="../_static/bpl.png" border="0"></a></h3> 37 </td> 38 39 <td > 40 <h1 align="center"><a href="../index.html">(NumPy)</a></h1> 41<!-- <h2 align="center">CallPolicies Concept</h2>--> 42 </td> 43 <td> 44 <div id="searchbox" style="display: none"> 45 <form class="search" action="../search.html" method="get"> 46 <input type="text" name="q" size="18" /> 47 <input type="submit" value="Search" /> 48 <input type="hidden" name="check_keywords" value="yes" /> 49 <input type="hidden" name="area" value="default" /> 50 </form> 51 </div> 52 <script type="text/javascript">$('#searchbox').show(0);</script> 53 </td> 54 </tr> 55 </table> 56 </div> 57 <hr/> 58 <div class="content"> 59 <div class="navbar" style="text-align:right;"> 60 61 62 <a class="prev" title="binary_ufunc" href="binary_ufunc.html"><img src="../_static/prev.png" alt="prev"/></a> 63 <a class="up" title="Boost.Python NumPy extension Reference" href="index.html"><img src="../_static/up.png" alt="up"/></a> 64 65 </div> 66 67 <div class="section" id="multi-iter"> 68<h1><a class="toc-backref" href="#id1">multi_iter</a></h1> 69<div class="contents topic" id="table-of-contents"> 70<p class="topic-title first">Table of Contents</p> 71<ul class="simple"> 72<li><a class="reference internal" href="#multi-iter" id="id1">multi_iter</a><ul> 73<li><a class="reference internal" href="#synopsis" id="id2">synopsis</a></li> 74<li><a class="reference internal" href="#constructors" id="id3">constructors</a></li> 75<li><a class="reference internal" href="#accessors" id="id4">accessors</a></li> 76</ul> 77</li> 78</ul> 79</div> 80<p>A <code class="docutils literal"><span class="pre">multi_iter</span></code> is a Python object, intended to be used as an iterator It should generally only be used in loops.</p> 81<blockquote> 82<div><code class="docutils literal"><span class="pre"><boost/python/numpy/ufunc.hpp></span></code> contains the class definitions for <code class="docutils literal"><span class="pre">multi_iter</span></code></div></blockquote> 83<div class="section" id="synopsis"> 84<h2><a class="toc-backref" href="#id2">synopsis</a></h2> 85<div class="highlight-c++"><div class="highlight"><pre><span class="k">namespace</span> <span class="n">boost</span> 86<span class="p">{</span> 87<span class="k">namespace</span> <span class="n">python</span> 88<span class="p">{</span> 89<span class="k">namespace</span> <span class="n">numpy</span> 90<span class="p">{</span> 91 92<span class="k">class</span> <span class="nc">multi_iter</span> <span class="o">:</span> <span class="k">public</span> <span class="n">object</span> 93<span class="p">{</span> 94<span class="k">public</span><span class="o">:</span> 95 <span class="kt">void</span> <span class="n">next</span><span class="p">();</span> 96 <span class="kt">bool</span> <span class="nf">not_done</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span> 97 <span class="kt">char</span> <span class="o">*</span> <span class="nf">get_data</span><span class="p">(</span><span class="kt">int</span> <span class="n">n</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span> 98 <span class="kt">int</span> <span class="k">const</span> <span class="nf">get_nd</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span> 99 <span class="n">Py_intptr_t</span> <span class="k">const</span> <span class="o">*</span> <span class="nf">get_shape</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span> 100 <span class="n">Py_intptr_t</span> <span class="k">const</span> <span class="nf">shape</span><span class="p">(</span><span class="kt">int</span> <span class="n">n</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span> 101<span class="p">};</span> 102 103 104<span class="n">multi_iter</span> <span class="nf">make_multi_iter</span><span class="p">(</span><span class="n">object</span> <span class="k">const</span> <span class="o">&</span> <span class="n">a1</span><span class="p">);</span> 105<span class="n">multi_iter</span> <span class="nf">make_multi_iter</span><span class="p">(</span><span class="n">object</span> <span class="k">const</span> <span class="o">&</span> <span class="n">a1</span><span class="p">,</span> <span class="n">object</span> <span class="k">const</span> <span class="o">&</span> <span class="n">a2</span><span class="p">);</span> 106<span class="n">multi_iter</span> <span class="nf">make_multi_iter</span><span class="p">(</span><span class="n">object</span> <span class="k">const</span> <span class="o">&</span> <span class="n">a1</span><span class="p">,</span> <span class="n">object</span> <span class="k">const</span> <span class="o">&</span> <span class="n">a2</span><span class="p">,</span> <span class="n">object</span> <span class="k">const</span> <span class="o">&</span> <span class="n">a3</span><span class="p">);</span> 107 108<span class="p">}</span> 109<span class="p">}</span> 110<span class="p">}</span> 111</pre></div> 112</div> 113</div> 114<div class="section" id="constructors"> 115<h2><a class="toc-backref" href="#id3">constructors</a></h2> 116<div class="highlight-c++"><div class="highlight"><pre><span class="n">multi_iter</span> <span class="nf">make_multi_iter</span><span class="p">(</span><span class="n">object</span> <span class="k">const</span> <span class="o">&</span> <span class="n">a1</span><span class="p">);</span> 117<span class="n">multi_iter</span> <span class="nf">make_multi_iter</span><span class="p">(</span><span class="n">object</span> <span class="k">const</span> <span class="o">&</span> <span class="n">a1</span><span class="p">,</span> <span class="n">object</span> <span class="k">const</span> <span class="o">&</span> <span class="n">a2</span><span class="p">);</span> 118<span class="n">multi_iter</span> <span class="nf">make_multi_iter</span><span class="p">(</span><span class="n">object</span> <span class="k">const</span> <span class="o">&</span> <span class="n">a1</span><span class="p">,</span> <span class="n">object</span> <span class="k">const</span> <span class="o">&</span> <span class="n">a2</span><span class="p">,</span> <span class="n">object</span> <span class="k">const</span> <span class="o">&</span> <span class="n">a3</span><span class="p">);</span> 119</pre></div> 120</div> 121<table class="docutils field-list" frame="void" rules="none"> 122<col class="field-name" /> 123<col class="field-body" /> 124<tbody valign="top"> 125<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A Python iterator object broadcasting over one, two or three sequences as supplied</td> 126</tr> 127</tbody> 128</table> 129</div> 130<div class="section" id="accessors"> 131<h2><a class="toc-backref" href="#id4">accessors</a></h2> 132<div class="highlight-c++"><div class="highlight"><pre><span class="kt">void</span> <span class="nf">next</span><span class="p">();</span> 133</pre></div> 134</div> 135<table class="docutils field-list" frame="void" rules="none"> 136<col class="field-name" /> 137<col class="field-body" /> 138<tbody valign="top"> 139<tr class="field-odd field"><th class="field-name">Effects:</th><td class="field-body">Increments the iterator</td> 140</tr> 141</tbody> 142</table> 143<div class="highlight-c++"><div class="highlight"><pre><span class="kt">bool</span> <span class="nf">not_done</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span> 144</pre></div> 145</div> 146<table class="docutils field-list" frame="void" rules="none"> 147<col class="field-name" /> 148<col class="field-body" /> 149<tbody valign="top"> 150<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">boolean value indicating whether the iterator is at its end</td> 151</tr> 152</tbody> 153</table> 154<div class="highlight-c++"><div class="highlight"><pre><span class="kt">char</span> <span class="o">*</span> <span class="nf">get_data</span><span class="p">(</span><span class="kt">int</span> <span class="n">n</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span> 155</pre></div> 156</div> 157<table class="docutils field-list" frame="void" rules="none"> 158<col class="field-name" /> 159<col class="field-body" /> 160<tbody valign="top"> 161<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">a pointer to the element of the nth broadcasted array.</td> 162</tr> 163</tbody> 164</table> 165<div class="highlight-c++"><div class="highlight"><pre><span class="kt">int</span> <span class="k">const</span> <span class="nf">get_nd</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span> 166</pre></div> 167</div> 168<table class="docutils field-list" frame="void" rules="none"> 169<col class="field-name" /> 170<col class="field-body" /> 171<tbody valign="top"> 172<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">the number of dimensions of the broadcasted array expression</td> 173</tr> 174</tbody> 175</table> 176<div class="highlight-c++"><div class="highlight"><pre><span class="n">Py_intptr_t</span> <span class="k">const</span> <span class="o">*</span> <span class="nf">get_shape</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span> 177</pre></div> 178</div> 179<table class="docutils field-list" frame="void" rules="none"> 180<col class="field-name" /> 181<col class="field-body" /> 182<tbody valign="top"> 183<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">the shape of the broadcasted array expression as an array of integers.</td> 184</tr> 185</tbody> 186</table> 187<div class="highlight-c++"><div class="highlight"><pre><span class="n">Py_intptr_t</span> <span class="k">const</span> <span class="nf">shape</span><span class="p">(</span><span class="kt">int</span> <span class="n">n</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span> 188</pre></div> 189</div> 190<table class="docutils field-list" frame="void" rules="none"> 191<col class="field-name" /> 192<col class="field-body" /> 193<tbody valign="top"> 194<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">the shape of the broadcasted array expression in the nth dimension.</td> 195</tr> 196</tbody> 197</table> 198</div> 199</div> 200 201 202 <div class="navbar" style="text-align:right;"> 203 204 205 <a class="prev" title="binary_ufunc" href="binary_ufunc.html"><img src="../_static/prev.png" alt="prev"/></a> 206 <a class="up" title="Boost.Python NumPy extension Reference" href="index.html"><img src="../_static/up.png" alt="up"/></a> 207 208 </div> 209 </div> 210 </body> 211</html>