/***********************************************************************/
-SharedSAbundVector::SharedSAbundVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){}
+SharedSAbundVector::SharedSAbundVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){ }
/***********************************************************************/
if(bin > maxRank) { maxRank = bin; }
}
catch(exception& e) {
- errorOut(e, "SharedSAbundVector", "set");
+ m->errorOut(e, "SharedSAbundVector", "set");
exit(1);
}
}
numSeqs += (maxRank * abundance);
}
catch(exception& e) {
- errorOut(e, "SharedSAbundVector", "push_back");
+ m->errorOut(e, "SharedSAbundVector", "push_back");
exit(1);
}
}
output << endl;
}
catch(exception& e) {
- errorOut(e, "SharedSAbundVector", "print");
+ m->errorOut(e, "SharedSAbundVector", "print");
exit(1);
}
}
try {
RAbundVector rav;
- for(int i=1;i<=data.size();i++){
+ for(int i=1;i<data.size();i++){
for(int j=0;j<data[i].abundance;j++){
rav.push_back(i);
}
return rav;
}
catch(exception& e) {
- errorOut(e, "SharedSAbundVector", "getRAbundVector");
+ m->errorOut(e, "SharedSAbundVector", "getRAbundVector");
exit(1);
}
}
}
catch(exception& e) {
- errorOut(e, "SharedSAbundVector", "getSAbundVector");
+ m->errorOut(e, "SharedSAbundVector", "getSAbundVector");
exit(1);
}
}
try {
SharedRAbundVector rav;
- int binNumber = 0;
- for(int i=1;i<=data.size();i++){
+ for(int i=1;i<data.size();i++){
for(int j=0;j<data[i].abundance;j++){
- rav.push_back(i, binNumber, data[i].group);
- binNumber++;
+ rav.push_back(i, data[i].group);
}
}
sort(rav.rbegin(), rav.rend(), compareMembers);
return rav;
}
catch(exception& e) {
- errorOut(e, "SharedSAbundVector", "getSharedRAbundVector");
+ m->errorOut(e, "SharedSAbundVector", "getSharedRAbundVector");
exit(1);
}
}
return ov;
}
catch(exception& e) {
- errorOut(e, "SharedSAbundVector", "getSharedOrderVector");
+ m->errorOut(e, "SharedSAbundVector", "getSharedOrderVector");
exit(1);
}
}
+/***********************************************************************/
+
+void SharedSAbundVector::clear(){
+ numBins = 0;
+ maxRank = 0;
+ numSeqs = 0;
+ data.clear();
+}
+
/***********************************************************************/
OrderVector SharedSAbundVector::getOrderVector(map<string,int>* hold = NULL){
try {
return ov;
}
catch(exception& e) {
- errorOut(e, "SharedSAbundVector", "getOrderVector");
+ m->errorOut(e, "SharedSAbundVector", "getOrderVector");
exit(1);
}
}