int this_count = 1 ; Count of current slope
for ( int i = 1 ; i < n ; i ++ ) { if ( compareDoubles ( slope [ i ] , slope [ i - 1 ] ) ) this_count ++ ; else { count [ k ++ ] = this_count ; this_count = 1 ; } } count [ k ++ ] = this_count ;