private SOTACell findMyCell(int geneNum) { SOTACell curr = head; SOTACell myClosestCell = head; double keyDist = Float.POSITIVE_INFINITY; double currDist = 0; while (curr != null) { currDist = ExperimentUtil.geneDistance( dataMatrix, curr.centroidGene, geneNum, 0, function, factor, absolute); if (currDist <= keyDist) { keyDist = currDist; myClosestCell = curr; } curr = curr.succ; } if (myNucleus[geneNum] != myClosestCell) { myNucleus[geneNum] = myClosestCell; myClosestCell.addMember(geneNum); } return myClosestCell; }
private SOTACell findMyCellInSubTree(SOTACell trainingCell, int geneNum, int level) { SOTACell currCell = trainingCell; SOTACell myCell = trainingCell; int levelIndex = 0; while (currCell.parent != null && levelIndex < level) { currCell = currCell.parent; levelIndex++; } // now currNode is at root, or 'level' number of nodes above the training node Vector cellList = new Vector(); getCellsBelow(cellList, currCell); float minDist = Float.POSITIVE_INFINITY; float currDist; for (int i = 0; i < cellList.size(); i++) { currCell = (SOTACell) (cellList.elementAt(i)); currDist = ExperimentUtil.geneDistance( dataMatrix, currCell.centroidGene, geneNum, 0, function, factor, absolute); if (currDist < minDist) { minDist = currDist; myCell = currCell; } } if (myNucleus[geneNum] != myCell) { myNucleus[geneNum] = myCell; myCell.addMember(geneNum); } return myCell; }