inprogress
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 20 Nov 2013 21:49:49 +0000 (21:49 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 20 Nov 2013 21:49:49 +0000 (21:49 +0000)
forester/java/src/org/forester/application/subtree_feature_count.java

index 57d4620..da23024 100644 (file)
@@ -125,23 +125,10 @@ public class subtree_feature_count {
         }
     }
 
-    private static PhylogenyNode moveUpOLd( final PhylogenyNode node, final double depth ) {
-        PhylogenyNode n = node;
-        double current_depth = 0.0;
-        while ( current_depth < depth ) {
-            current_depth += n.getDistanceToParent();
-            if ( n.getParent() == null ) {
-                throw new IllegalArgumentException( "Depth " + depth + " is too large" );
-            }
-            n = n.getParent();
-        }
-        return n;
-    }
-
     private static PhylogenyNode moveUp( final PhylogenyNode node, final double depth ) {
         PhylogenyNode n = node;
         PhylogenyNode prev = node;
-        while ( depth > n.calculateDistanceToRoot() ) {
+        while ( depth < n.calculateDistanceToRoot() ) {
             prev = n;
             n = n.getParent();
         }