<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Teil eines Multiarrays an Vector zuweisen]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte eine Zeile aus einem 2-dimensionalen Boost-Multiarray an einen Vector zuweisen.</p>
<p>Bisher sieht das so aus:</p>
<pre><code class="language-cpp">multi_array&lt;unsigned, 2&gt; ar;
ar.resize(extents[s][t]);
ar = ...
vector&lt;unsigned&gt; v(t);
unsigned n = ...
for (unsigned i = 0; i &lt; t; ++i)
    v[i] = v[n][i];
</code></pre>
<p>Weiss jemand, ob es einen Befehl gibt, den man statt der Schleife verwenden kann?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/266581/teil-eines-multiarrays-an-vector-zuweisen</link><generator>RSS for Node</generator><lastBuildDate>Thu, 03 Sep 2026 04:16:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/266581.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 May 2010 08:02:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Teil eines Multiarrays an Vector zuweisen on Tue, 11 May 2010 08:02:28 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte eine Zeile aus einem 2-dimensionalen Boost-Multiarray an einen Vector zuweisen.</p>
<p>Bisher sieht das so aus:</p>
<pre><code class="language-cpp">multi_array&lt;unsigned, 2&gt; ar;
ar.resize(extents[s][t]);
ar = ...
vector&lt;unsigned&gt; v(t);
unsigned n = ...
for (unsigned i = 0; i &lt; t; ++i)
    v[i] = v[n][i];
</code></pre>
<p>Weiss jemand, ob es einen Befehl gibt, den man statt der Schleife verwenden kann?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1895518</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1895518</guid><dc:creator><![CDATA[ingobulla]]></dc:creator><pubDate>Tue, 11 May 2010 08:02:28 GMT</pubDate></item><item><title><![CDATA[Reply to Teil eines Multiarrays an Vector zuweisen on Tue, 11 May 2010 08:19:51 GMT]]></title><description><![CDATA[<p>du kannst einen view konstrueiren, der die n-te Zeile wiedergibt. (wie das geht steht in der Doku) Den kannst du dann ganz normal durchiterieren bzw. dem vector einfach begin() und end() des views als konstruktorparameter verpassen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1895529</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1895529</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Tue, 11 May 2010 08:19:51 GMT</pubDate></item></channel></rss>