@@ -46,9 +46,8 @@ fn imbalance(weights: &[f64]) -> f64 {
4646/// - `delta_threshold`: the distance threshold for the cluster movements under which the algorithm stops.
4747/// - `max_iter`: the maximum number of times each cluster will move before stopping the algorithm
4848/// - `max_balance_iter`: the maximum number of iterations of the load balancing loop. It will limit how much each cluster
49- /// influence can grow between each cluster movement.
49+ /// influence can grow between each cluster movement.
5050/// - `erode`: sets whether or not cluster influence is modified according to errosion's rules between each cluster movement
51- /// - `hilbert`: sets wheter or not an Hilbert curve is used to create the initial partition. If false, a Z curve is used instead.
5251/// - `mbr_early_break`: sets whether or not bounding box optimization is enabled.
5352#[ derive( Debug , Clone , Copy ) ]
5453pub struct BalancedKmeansSettings {
@@ -58,7 +57,6 @@ pub struct BalancedKmeansSettings {
5857 pub max_iter : usize ,
5958 pub max_balance_iter : usize ,
6059 pub erode : bool ,
61- pub hilbert : bool ,
6260 pub mbr_early_break : bool ,
6361}
6462
@@ -71,7 +69,6 @@ impl Default for BalancedKmeansSettings {
7169 max_iter : 50 ,
7270 max_balance_iter : 1 , // for now, `max_balance_iter > 1` yields poor convergence time
7371 erode : false , // for now, `erode` yields` enabled yields wrong results
74- hilbert : true ,
7572 mbr_early_break : false , // for now, `mbr_early_break` enabled yields wrong results
7673 }
7774 }
@@ -129,7 +126,7 @@ fn balanced_k_means_with_initial_partition<const D: usize>(
129126 // Generate initial lower and upper bounds. These two variables represent bounds on
130127 // the effective distance between an point and the cluster it is assigned to.
131128 let mut lbs: Vec < _ > = points. par_iter ( ) . map ( |_| 0. ) . collect ( ) ;
132- let mut ubs: Vec < _ > = points. par_iter ( ) . map ( |_| std :: f64:: MAX ) . collect ( ) ; // we use f64::MAX to represent infinity
129+ let mut ubs: Vec < _ > = points. par_iter ( ) . map ( |_| f64:: MAX ) . collect ( ) ; // we use f64::MAX to represent infinity
133130
134131 balanced_k_means_iter (
135132 Inputs { points, weights } ,
@@ -480,8 +477,8 @@ fn best_values<const D: usize>(
480477 f64 , // new ub
481478 Option < ClusterId > , // new cluster assignment for the current point (None if the same assignment is kept)
482479) {
483- let mut best_value = std :: f64:: MAX ;
484- let mut snd_best_value = std :: f64:: MAX ;
480+ let mut best_value = f64:: MAX ;
481+ let mut snd_best_value = f64:: MAX ;
485482 let mut assignment = None ;
486483
487484 for ( ( ( center, id) , distance_to_mbr) , influence) in centers
@@ -621,7 +618,6 @@ where
621618 max_iter : self . max_iter ,
622619 max_balance_iter : self . max_balance_iter ,
623620 erode : self . erode ,
624- hilbert : self . hilbert ,
625621 mbr_early_break : self . mbr_early_break ,
626622 } ;
627623 balanced_k_means_with_initial_partition ( points, weights, settings, part_ids) ;
0 commit comments