goldingn/BayesComm — pull request #2 by davharris (2013-11-09 23:47:16+00:00)
Title: Prevent unnecessary copy of model traces

I've been working with very large communities (350+ species) on a machine with 8 gigabytes of RAM. As a result, I've been having trouble fitting all of the trace objects into memory.

I noticed that the last line of BCfit copied all the trace objects to create the output list, which almost doubled the memory footprint for a brief period, leading R to abort the computation altogether.

I've avoided that duplication event by storing all the traces in the output list from the start.

The function's behavior should otherwise be unchanged (i.e. it should produce identical results).