+ // m.setRow( "5", 1 );
+ // m.setRow( "4 7", 2 );
+ // m.setRow( "7 10 7", 3 );
+ // m.setRow( "6 9 6 5", 4 );
+ // m.setRow( "8 11 8 9 8", 5 );
+ // m.setIdentifier( 0, "A" );
+ // m.setIdentifier( 1, "B" );
+ // m.setIdentifier( 2, "C" );
+ // m.setIdentifier( 3, "D" );
+ // m.setIdentifier( 4, "E" );
+ // m.setIdentifier( 5, "F" );
+ // final NeighborJoiningR nj1 = NeighborJoiningR.createInstance();
+ // final Phylogeny p1 = nj1.execute( m );
+ // p1.reRoot( p1.getNode( "F" ) );
+ // Archaeopteryx.createApplication( p1 );
+ // if ( isUnequal( p1.getNode( "A" ).getDistanceToParent(), 1 ) ) {
+ // return false;
+ // }
+ // if ( isUnequal( p1.getNode( "B" ).getDistanceToParent(), 4 ) ) {
+ // return false;
+ // }
+ // if ( isUnequal( p1.getNode( "C" ).getDistanceToParent(), 2 ) ) {
+ // return false;
+ // }
+ // if ( isUnequal( p1.getNode( "D" ).getDistanceToParent(), 3 ) ) {
+ // return false;
+ // }
+ // if ( isUnequal( p1.getNode( "E" ).getDistanceToParent(), 2 ) ) {
+ // return false;
+ // }
+ // if ( isUnequal( p1.getNode( "F" ).getDistanceToParent(), 2.5 ) ) {
+ // return false;
+ // }
+ // if ( isUnequal( p1.getNode( "A" ).getParent().getDistanceToParent(), 1 ) ) {
+ // return false;
+ // }
+ // if ( isUnequal( p1.getNode( "A" ).getParent().getParent().getDistanceToParent(), 1 ) ) {
+ // return false;
+ // }
+ // if ( isUnequal( p1.getNode( "A" ).getParent().getParent().getParent().getDistanceToParent(), 2.5 ) ) {
+ // return false;
+ // }
+ // if ( isUnequal( p1.getNode( "B" ).getParent().getDistanceToParent(), 1 ) ) {
+ // return false;
+ // }
+ // if ( isUnequal( p1.getNode( "D" ).getParent().getDistanceToParent(), 1 ) ) {
+ // return false;
+ // }
+ // if ( isUnequal( p1.getNode( "E" ).getParent().getDistanceToParent(), 1 ) ) {
+ // return false;
+ // }
+ ///////////////
+ m = new BasicSymmetricalDistanceMatrix( 7 );
+ m.setIdentifier( 0, "Bovine" );
+ m.setIdentifier( 1, "Mouse" );
+ m.setIdentifier( 2, "Gibbon" );
+ m.setIdentifier( 3, "Orang" );
+ m.setIdentifier( 4, "Gorilla" );
+ m.setIdentifier( 5, "Chimp" );
+ m.setIdentifier( 6, "Human" );
+ m.setRow( "0.00000 1.68660 1.71980 1.66060 1.52430 1.60430 1.59050", 0 );
+ m.setRow( "1.68660 0.00000 1.52320 1.48410 1.44650 1.43890 1.46290", 1 );
+ m.setRow( "1.71980 1.52320 0.00000 0.71150 0.59580 0.61790 0.55830", 2 );
+ m.setRow( "1.66060 1.48410 0.71150 0.00000 0.46310 0.50610 0.47100", 3 );
+ m.setRow( "1.52430 1.44650 0.59580 0.46310 0.00000 0.34840 0.30830", 4 );
+ m.setRow( "1.60430 1.43890 0.61790 0.50610 0.34840 0.00000 0.26920", 5 );
+ m.setRow( "1.59050 1.46290 0.55830 0.47100 0.30830 0.26920 0.00000", 6 );
+ final NeighborJoining nj = NeighborJoining.createInstance( true, 6 );
+ //nj = NeighborJoining.createInstance( true, 6 );
+ final Phylogeny pnj = nj.execute( m );
+ pnj.reRoot( pnj.getNode( "Bovine" ) );
+ Archaeopteryx.createApplication( pnj );
+ //
+ m = new BasicSymmetricalDistanceMatrix( 7 );
+ m.setIdentifier( 0, "Bovine" );
+ m.setIdentifier( 1, "Mouse" );
+ m.setIdentifier( 2, "Gibbon" );
+ m.setIdentifier( 3, "Orang" );
+ m.setIdentifier( 4, "Gorilla" );
+ m.setIdentifier( 5, "Chimp" );
+ m.setIdentifier( 6, "Human" );
+ m.setRow( "0.00000 1.68660 1.71980 1.66060 1.52430 1.60430 1.59050", 0 );
+ m.setRow( "1.68660 0.00000 1.52320 1.48410 1.44650 1.43890 1.46290", 1 );
+ m.setRow( "1.71980 1.52320 0.00000 0.71150 0.59580 0.61790 0.55830", 2 );
+ m.setRow( "1.66060 1.48410 0.71150 0.00000 0.46310 0.50610 0.47100", 3 );
+ m.setRow( "1.52430 1.44650 0.59580 0.46310 0.00000 0.34840 0.30830", 4 );
+ m.setRow( "1.60430 1.43890 0.61790 0.50610 0.34840 0.00000 0.26920", 5 );
+ m.setRow( "1.59050 1.46290 0.55830 0.47100 0.30830 0.26920 0.00000", 6 );
+ final NeighborJoiningR nj2 = NeighborJoiningR.createInstance( true, 6 );
+ //nj = NeighborJoining.createInstance( true, 6 );
+ final Phylogeny p2 = nj2.execute( m );
+ p2.reRoot( p2.getNode( "Bovine" ) );
+ Archaeopteryx.createApplication( p2 );
+ if ( isUnequal( p2.getNode( "Chimp" ).getDistanceToParent(), 0.15168 ) ) {
+ return false;
+ }
+ if ( isUnequal( p2.getNode( "Human" ).getDistanceToParent(), 0.11752 ) ) {
+ return false;
+ }
+ if ( isUnequal( p2.getNode( "Gorilla" ).getDistanceToParent(), 0.15393 ) ) {
+ return false;
+ }
+ if ( isUnequal( p2.getNode( "Orang" ).getDistanceToParent(), 0.28469 ) ) {
+ return false;
+ }
+ if ( isUnequal( p2.getNode( "Gibbon" ).getDistanceToParent(), 0.35793 ) ) {
+ return false;
+ }
+ if ( isUnequal( p2.getNode( "Mouse" ).getDistanceToParent(), 0.76891 ) ) {
+ return false;
+ }
+ if ( isUnequal( p2.getNode( "Bovine" ).getDistanceToParent(), 0.458845 ) ) {
+ return false;
+ }
+ if ( isUnequal( p2.getNode( "Chimp" ).getParent().getDistanceToParent(), 0.03982 ) ) {
+ return false;
+ }
+ if ( isUnequal( p2.getNode( "Human" ).getParent().getDistanceToParent(), 0.03982 ) ) {
+ return false;
+ }
+ if ( isUnequal( p2.getNode( "Chimp" ).getParent().getParent().getDistanceToParent(), 0.02696 ) ) {
+ return false;
+ }
+ if ( isUnequal( p2.getNode( "Chimp" ).getParent().getParent().getParent().getDistanceToParent(), 0.04648 ) ) {
+ return false;
+ }
+ if ( isUnequal( p2.getNode( "Chimp" ).getParent().getParent().getParent().getParent().getDistanceToParent(),
+ 0.42027 ) ) {
+ return false;
+ }
+ if ( isUnequal( p2.getNode( "Chimp" ).getParent().getParent().getParent().getParent().getParent()
+ .getDistanceToParent(), 0.458845 ) ) {
+ return false;
+ }