I tried LIBMESH_BEST_UNORDERED_SET... and I got this:

error: ‘std::tr1’ has not been declared

So apparently, that configure test isn't doing the right thing on my Mac.  I guess we must not be using this anywhere else in the code...


On Thu, May 24, 2012 at 12:36 PM, Roy Stogner <roystgnr@ices.utexas.edu> wrote:

On Thu, 24 May 2012, Derek Gaston wrote:

HOWEVER: This is now a 2nLog(n) algorithm... where n is the number
of nodes in your mesh.

Replace std::set with LIBMESH_BEST_UNORDERED_SET and (as long as
configure found a gnu or tr1 or c++11 hash table container) we ought
to be back to O(n).  Since you're not actually trying to iterate
through connected_nodes in order, just testing for set inclusion
later, there's no need to preserve ordering.  The hash tables probably
take up more memory, but I don't think the difference will be
too bad - might want to benchmark (both RAM and CPU usage) to be sure.