<br><br><div class="gmail_quote">2010/2/28 Andrew Kokkalis <span dir="ltr">&lt;<a href="mailto:andrewkokkalis@gmail.com">andrewkokkalis@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
&gt; I&#39;m using them for the process of clustering a huge amount of data<br>
&gt; (posts from an aple blog from the last 4-5 years)I&#39;m counting<br>
&gt; Euclidean distance between two clusters, which I store in a multi_index<br>
&gt; container like the above<br>
</div>&gt; [...]<br>
<div>&gt; My problem is that I have to count 9500! (! = factorial) distances,<br>
&gt; and store them in the multi_index container.<br>
<br>
</div>I think I&#39;m misunderstanding this: do you mean your container<br>
is holding 9500! elements? As 9500! ~ 9*10^33664 this can&#39;t possibly<br>
be the case.<br></blockquote><div>�</div></div><div>Is it impossible for a container such as the above to hold that much elements?<br>during insertion ram is over 2.4 gb (only for this program).<br><br>I&#39;m running now the program with different parameters and see the number of elements that are stored.<br>
</div></div></blockquote><div><br>Obviously it is not factorial! Once again i was wrong and fool!<br>The elements in my container are 46,238,536� (n^2 - n ) / 2� so complexity for storage is O(n^2)<br><br>And the problem is that inserting those few elements into the multi_index container takes almost 9 minutes.<br>
As I said before I&#39;m using &quot;<code>std::pair&lt;iterator,bool&gt; insert(const value_type&amp; x);</code>&quot;.<br>Is there� a faster way to insert?<br></div></div><br>