5 /***********************************************************************/
7 SingleLinkage::SingleLinkage(RAbundVector* rav, ListVector* lv, SparseMatrix* dm) :
11 /***********************************************************************/
12 //This function clusters based on nearest method.
13 void SingleLinkage::update(){
17 for(int i=1;i<nRowCells;i++){
21 if(rowCells[i]->row == smallRow){
22 search = rowCells[i]->column;
25 search = rowCells[i]->row;
28 for(int j=1;j<nColCells;j++){
30 if(colCells[j]->row == search || colCells[j]->column == search){
32 if(colCells[j]->dist > rowCells[i]->dist){
33 colCells[j]->dist = rowCells[i]->dist;
35 if(colCells[j]->vectorMap != NULL){
36 *(colCells[j]->vectorMap) = NULL;
37 colCells[j]->vectorMap = NULL;
41 dMatrix->rmCell(rowCells[i]);
46 if(search < smallCol){
47 rowCells[i]->row = smallCol;
48 rowCells[i]->column = search;
51 rowCells[i]->row = search;
52 rowCells[i]->column = smallCol;
58 dMatrix->rmCell(rowCells[0]);
61 cout << "Standard Error: " << e.what() << " has occurred in the SingleLinkage class Function update. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
65 cout << "An unknown error has occurred in the SingleLinkage class function update. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
70 /***********************************************************************/