@@ -28,28 +28,28 @@ public class DisjointSetBenchmark
2828 private Dictionary < int , HashSet < int > > dictFull = null ! ;
2929
3030 [ Params ( 1000 , 100_000 ) ]
31- public int ElementCount ;
31+ public int ItemCount ;
3232
3333 [ GlobalSetup ]
3434 public void Setup ( )
3535 {
36- int edges = ElementCount ; // a near-spanning edge stream over the universe
36+ int edges = ItemCount ; // a near-spanning edge stream over the universe
3737 edgeA = new int [ edges ] ;
3838 edgeB = new int [ edges ] ;
3939 var rand = new Random ( 42 ) ;
4040 for ( int i = 0 ; i < edges ; i ++ )
4141 {
42- edgeA [ i ] = rand . Next ( ElementCount ) ;
43- edgeB [ i ] = rand . Next ( ElementCount ) ;
42+ edgeA [ i ] = rand . Next ( ItemCount ) ;
43+ edgeB [ i ] = rand . Next ( ItemCount ) ;
4444 }
4545
46- int queries = Math . Min ( ElementCount , 10_000 ) ;
46+ int queries = Math . Min ( ItemCount , 10_000 ) ;
4747 queryA = new int [ queries ] ;
4848 queryB = new int [ queries ] ;
4949 for ( int i = 0 ; i < queries ; i ++ )
5050 {
51- queryA [ i ] = rand . Next ( ElementCount ) ;
52- queryB [ i ] = rand . Next ( ElementCount ) ;
51+ queryA [ i ] = rand . Next ( ItemCount ) ;
52+ queryB [ i ] = rand . Next ( ItemCount ) ;
5353 }
5454
5555 dsFull = BuildCelerity ( ) ;
@@ -130,8 +130,8 @@ public int Dictionary_Components()
130130
131131 private DisjointSet < int > BuildCelerity ( )
132132 {
133- var ds = new DisjointSet < int > ( ElementCount ) ;
134- for ( int i = 0 ; i < ElementCount ; i ++ )
133+ var ds = new DisjointSet < int > ( ItemCount ) ;
134+ for ( int i = 0 ; i < ItemCount ; i ++ )
135135 ds . Add ( i ) ;
136136 for ( int i = 0 ; i < edgeA . Length ; i ++ )
137137 ds . Union ( edgeA [ i ] , edgeB [ i ] ) ;
@@ -140,8 +140,8 @@ private DisjointSet<int> BuildCelerity()
140140
141141 private Dictionary < int , HashSet < int > > BuildDictionary ( )
142142 {
143- var map = new Dictionary < int , HashSet < int > > ( ElementCount ) ;
144- for ( int i = 0 ; i < ElementCount ; i ++ )
143+ var map = new Dictionary < int , HashSet < int > > ( ItemCount ) ;
144+ for ( int i = 0 ; i < ItemCount ; i ++ )
145145 map [ i ] = new HashSet < int > { i } ;
146146
147147 for ( int i = 0 ; i < edgeA . Length ; i ++ )
0 commit comments