-//THis function clusters based on the average method
-void AverageLinkage::update(){
- try{
- getRowColCells();
-
- vector<int> found(nColCells, 0);
-
- int rowBin = rabund->get(smallRow);
- int colBin = rabund->get(smallCol);
- int totalBin = rowBin + colBin;
-
- for(int i=1;i<nRowCells;i++){
-
- int search;
+//This function returns the tag of the method.
+string AverageLinkage::getTag() {
+ return("an");
+}
+
+
+/***********************************************************************/
+//This function updates the distance based on the average linkage method.
+bool AverageLinkage::updateDistance(MatData& colCell, MatData& rowCell) {
+ try {
+ if ((saveRow != smallRow) || (saveCol != smallCol)) {
+ rowBin = rabund->get(smallRow);
+ colBin = rabund->get(smallCol);
+ totalBin = rowBin + colBin;
+ saveRow = smallRow;
+ saveCol = smallCol;
+ }