1 #ifndef COLLECTDISPLAY_H
2 #define COLLECTDISPLAY_H
4 #include "sabundvector.hpp"
5 #include "sharedsabundvector.h"
6 #include "calculator.h"
7 #include "fileoutput.h"
13 /***********************************************************************/
15 class CollectDisplay : public Display {
18 CollectDisplay(Calculator* calc, FileOutput* file) : estimate(calc), output(file) {timesCalled = 0;};
19 ~CollectDisplay() { delete estimate; delete output; }
20 void update(SAbundVector* rank){
21 nSeqs=rank->getNumSeqs();
22 data = estimate->getValues(rank);
23 output->output(nSeqs, data);
26 void update(SharedRAbundVector* shared1, SharedRAbundVector* shared2, int numSeqs, int numGroupComb){
28 data = estimate->getValues(shared1, shared2); //passes estimators a shared vector from each group to be compared
29 //fills groupdata with datas info
30 for (int i = 0; i < data.size(); i++) {
31 groupData.push_back(data[i]);
33 //when you get all your groups info then output
34 if ((timesCalled % numGroupComb) == 0) {
35 output->output(numSeqs, groupData);
40 void init(string s) { output->initFile(s); };
41 void reset() { output->resetFile(); };
42 void close() { output->resetFile(); };
47 int nSeqs, timesCalled;
49 vector<double> groupData;
52 /***********************************************************************/