#include "hcluster.h"
#include "rabundvector.hpp"
#include "listvector.hpp"
-#include "sparsematrix.hpp"
/***********************************************************************/
HCluster::HCluster(RAbundVector* rav, ListVector* lv, string ms, string d, NameAssignment* n, float c) : rabund(rav), list(lv), method(ms), distfile(d), nameMap(n), cutoff(c) {
in >> first >> second >> dist; m->gobble(in);
- if (m->control_pressed) { in.close(); out.close(); remove(tempDistFile.c_str()); return 0; }
+ if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(tempDistFile); return 0; }
//while there are still values in mergedMin that are smaller than the distance read from file
while (count < mergedMin.size()) {
mergedMin.clear();
//rename tempfile to distfile
- remove(distfile.c_str());
+ m->mothurRemove(distfile);
rename(tempDistFile.c_str(), distfile.c_str());
//cout << "remove = "<< renameOK << " rename = " << ok << endl;
exit(1);
}
}
-/***********************************************************************/
+***********************************************************************/
int HCluster::processFile() {
try {
string firstName, secondName;
//get entry
while (!in.eof()) {
- if (m->control_pressed) { in.close(); out.close(); remove(outTemp.c_str()); return 0; }
+ if (m->control_pressed) { in.close(); out.close(); m->mothurRemove(outTemp); return 0; }
in >> firstName >> secondName >> distance; m->gobble(in);
in.close();
out.close();
- remove(distfile.c_str());
+ m->mothurRemove(distfile);
rename(outTemp.c_str(), distfile.c_str());
return 0;