@Test public void testExecuteDist1() { IdentifierList co = new NeighborNetImpl().createCircularOrdering(new FlexibleDistanceMatrix(distances1)); String orderedTaxa = co.toString(); assertTrue(orderedTaxa.equalsIgnoreCase("[A,C,D,E,B]")); assertTrue(true); }
@Override public IdentifierList createCircularOrdering(DistanceMatrix distanceMatrix) { this.mx = new CVMatrices(distanceMatrix); while (this.mx.getNbVertices() > 3) { Pair<Identifier, Identifier> selectedClusters = this.selectionStep1(this.mx.getC2C()); Pair<Identifier, Identifier> selectedVertices = this.selectionStep2(selectedClusters); Pair<Identifier, Identifier> newVertices = this.reduce(selectedClusters, selectedVertices); this.merge(selectedClusters, newVertices); } IdentifierList circularOrdering = this.expand(this.stackedVertexTriplets); if (!this.stackedVertexTriplets.empty()) { throw new IllegalStateException("Vertex triplet stack still contains entries. Something went wrong in the NN algorithm."); } return circularOrdering; }
NeighborNetImpl implements CircularOrderingCreator { @Override public IdentifierList createCircularOrdering(DistanceMatrix distanceMatrix) { this.mx = new CVMatrices(distanceMatrix); while (this.mx.getNbVertices() > 3) { Pair<Identifier, Identifier> selectedClusters = this.selectionStep1(this.mx.getC2C()); Pair<Identifier, Identifier> selectedVertices = this.selectionStep2(selectedClusters); Pair<Identifier, Identifier> newVertices = this.reduce(selectedClusters, selectedVertices); this.merge(selectedClusters, newVertices); } IdentifierList circularOrdering = this.expand(this.stackedVertexTriplets); if (!this.stackedVertexTriplets.empty()) { throw new IllegalStateException("Vertex triplet stack still contains entries. Something went wrong in the NN algorithm."); } return circularOrdering; } }
NeighborNetImpl implements CircularOrderingCreator { @Override public IdentifierList createCircularOrdering(DistanceMatrix distanceMatrix) { this.mx = new CVMatrices(distanceMatrix); while (this.mx.getNbVertices() > 3) { Pair<Identifier, Identifier> selectedClusters = this.selectionStep1(this.mx.getC2C()); Pair<Identifier, Identifier> selectedVertices = this.selectionStep2(selectedClusters); Pair<Identifier, Identifier> newVertices = this.reduce(selectedClusters, selectedVertices); this.merge(selectedClusters, newVertices); } IdentifierList circularOrdering = this.expand(this.stackedVertexTriplets); if (!this.stackedVertexTriplets.empty()) { throw new IllegalStateException("Vertex triplet stack still contains entries. Something went wrong in the NN algorithm."); } return circularOrdering; } NeighborNetImpl(); }
NeighborNetImpl implements CircularOrderingCreator { @Override public IdentifierList createCircularOrdering(DistanceMatrix distanceMatrix) { this.mx = new CVMatrices(distanceMatrix); while (this.mx.getNbVertices() > 3) { Pair<Identifier, Identifier> selectedClusters = this.selectionStep1(this.mx.getC2C()); Pair<Identifier, Identifier> selectedVertices = this.selectionStep2(selectedClusters); Pair<Identifier, Identifier> newVertices = this.reduce(selectedClusters, selectedVertices); this.merge(selectedClusters, newVertices); } IdentifierList circularOrdering = this.expand(this.stackedVertexTriplets); if (!this.stackedVertexTriplets.empty()) { throw new IllegalStateException("Vertex triplet stack still contains entries. Something went wrong in the NN algorithm."); } return circularOrdering; } NeighborNetImpl(); @Override IdentifierList createCircularOrdering(DistanceMatrix distanceMatrix); @Override boolean createsTreeSplits(); @Override SplitSystem getTreeSplits(); IdentifierList expand(Stack<VertexTriplet> stackedVertexTriplets); }
NeighborNetImpl implements CircularOrderingCreator { @Override public IdentifierList createCircularOrdering(DistanceMatrix distanceMatrix) { this.mx = new CVMatrices(distanceMatrix); while (this.mx.getNbVertices() > 3) { Pair<Identifier, Identifier> selectedClusters = this.selectionStep1(this.mx.getC2C()); Pair<Identifier, Identifier> selectedVertices = this.selectionStep2(selectedClusters); Pair<Identifier, Identifier> newVertices = this.reduce(selectedClusters, selectedVertices); this.merge(selectedClusters, newVertices); } IdentifierList circularOrdering = this.expand(this.stackedVertexTriplets); if (!this.stackedVertexTriplets.empty()) { throw new IllegalStateException("Vertex triplet stack still contains entries. Something went wrong in the NN algorithm."); } return circularOrdering; } NeighborNetImpl(); @Override IdentifierList createCircularOrdering(DistanceMatrix distanceMatrix); @Override boolean createsTreeSplits(); @Override SplitSystem getTreeSplits(); IdentifierList expand(Stack<VertexTriplet> stackedVertexTriplets);  }