public static BasicSymmetricalDistanceMatrix cloneDM ( BasicSymmetricalDistanceMatrix distM ) { int n = distM . getSize ( ) ; BasicSymmetricalDistanceMatrix cloneDM = new BasicSymmetricalDistanceMatrix ( n ) ; for ( int i = 0 ; i < n ; i ++ ) { cloneDM . setIdentifier ( i , distM . getIdentifier ( i ) ) ; for ( int j = i + 1 ; j < n ; j ++ ) { cloneDM . setValue ( i , j , distM . getValue ( i , j ) ) ; } } return cloneDM ; }
Helper function to clone a forester symmetrical DistanceMatrix .