<?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[求问大佬，float数组如何转到Eigen::MatrixXf???]]></title><description><![CDATA[<p>从float数组转到Eigen的矩阵，除了遍历，有啥快速的方法吗？</p>
<pre><code>#include &lt;iostream&gt;
#include &quot;eigen3/Eigen/Eigen&quot;
#include &quot;eigen3/Eigen/Core&quot;


using namespace std;
using namespace Eigen;

 
int main(){
 
 int n_dets = 100;
  float* data = new float[n_dets * 6];
  for (int i = 0; i &lt; n_dets*6; i++)
  {
    // 600
    data[i] = 334.;
  }

// we want convert data into a Matrix
  MatrixXf m1;
  m1.data() = data;

  cout &lt;&lt; m1.size() &lt;&lt; endl;
     
  return 0;
}

</code></pre>
]]></description><link>http://t.manaai.cn/topic/200/求问大佬-float数组如何转到eigen-matrixxf</link><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 08:14:47 GMT</lastBuildDate><atom:link href="http://t.manaai.cn/topic/200.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Sep 2019 09:23:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 求问大佬，float数组如何转到Eigen::MatrixXf??? on Mon, 23 Sep 2019 09:23:57 GMT]]></title><description><![CDATA[<p>从float数组转到Eigen的矩阵，除了遍历，有啥快速的方法吗？</p>
<pre><code>#include &lt;iostream&gt;
#include &quot;eigen3/Eigen/Eigen&quot;
#include &quot;eigen3/Eigen/Core&quot;


using namespace std;
using namespace Eigen;

 
int main(){
 
 int n_dets = 100;
  float* data = new float[n_dets * 6];
  for (int i = 0; i &lt; n_dets*6; i++)
  {
    // 600
    data[i] = 334.;
  }

// we want convert data into a Matrix
  MatrixXf m1;
  m1.data() = data;

  cout &lt;&lt; m1.size() &lt;&lt; endl;
     
  return 0;
}

</code></pre>
]]></description><link>http://t.manaai.cn/post/452</link><guid isPermaLink="true">http://t.manaai.cn/post/452</guid><dc:creator><![CDATA[刘看山]]></dc:creator><pubDate>Mon, 23 Sep 2019 09:23:57 GMT</pubDate></item><item><title><![CDATA[Reply to 求问大佬，float数组如何转到Eigen::MatrixXf??? on Mon, 23 Sep 2019 09:56:54 GMT]]></title><description><![CDATA[<p>the answer is here:<a href="https://blog.csdn.net/sinat_28751869/article/details/79425491" target="_blank" rel="noopener noreferrer nofollow">https://blog.csdn.net/sinat_28751869/article/details/79425491</a></p>
]]></description><link>http://t.manaai.cn/post/453</link><guid isPermaLink="true">http://t.manaai.cn/post/453</guid><dc:creator><![CDATA[刘看山]]></dc:creator><pubDate>Mon, 23 Sep 2019 09:56:54 GMT</pubDate></item><item><title><![CDATA[Reply to 求问大佬，float数组如何转到Eigen::MatrixXf??? on Mon, 23 Sep 2019 10:19:41 GMT]]></title><description><![CDATA[<p>A little useful explaination on Eigen:</p>
<p><a href="https://blog.csdn.net/huyaoyu/article/details/78454249" target="_blank" rel="noopener noreferrer nofollow">https://blog.csdn.net/huyaoyu/article/details/78454249</a></p>
<p>this teach us how to do slicing operation on Eigen matrix.</p>
]]></description><link>http://t.manaai.cn/post/454</link><guid isPermaLink="true">http://t.manaai.cn/post/454</guid><dc:creator><![CDATA[刘看山]]></dc:creator><pubDate>Mon, 23 Sep 2019 10:19:41 GMT</pubDate></item></channel></rss>