From: kjvdheide Date: Wed, 11 Oct 2017 20:03:44 +0000 (+0100) Subject: Use DistanceMatrix interface instead of the concrete implementation X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2dc2907ec279a0134c907e120c2c893396cbd5e2;p=jalview.git Use DistanceMatrix interface instead of the concrete implementation --- diff --git a/forester/java/src/org/forester/evoinference/distance/NeighborJoiningF.java b/forester/java/src/org/forester/evoinference/distance/NeighborJoiningF.java index 217cdba..f13e520 100644 --- a/forester/java/src/org/forester/evoinference/distance/NeighborJoiningF.java +++ b/forester/java/src/org/forester/evoinference/distance/NeighborJoiningF.java @@ -30,13 +30,14 @@ import java.util.ArrayList; import java.util.List; import org.forester.evoinference.matrix.distance.BasicSymmetricalDistanceMatrix; +import org.forester.evoinference.matrix.distance.DistanceMatrix; import org.forester.phylogeny.Phylogeny; import org.forester.phylogeny.PhylogenyNode; import org.forester.util.ForesterUtil; public final class NeighborJoiningF { - private BasicSymmetricalDistanceMatrix _d; + private DistanceMatrix _d; private float[][] _d_values; private final DecimalFormat _df; private PhylogenyNode[] _external_nodes; @@ -63,7 +64,7 @@ public final class NeighborJoiningF { _df.setRoundingMode( RoundingMode.HALF_UP ); } - public final Phylogeny execute( final BasicSymmetricalDistanceMatrix distance ) { + public final Phylogeny execute( final DistanceMatrix distance ) { reset( distance ); final Phylogeny phylogeny = new Phylogeny(); while ( _n > 2 ) { @@ -213,7 +214,7 @@ public final class NeighborJoiningF { } // only the values in the lower triangle are used. - private final void reset( final BasicSymmetricalDistanceMatrix distances ) { + private final void reset( final DistanceMatrix distances ) { _n = distances.getSize(); _d = distances; _r = new float[ _n ];