private List<CLIQUESubspace<V>> pruneDenseSubspaces(List<CLIQUESubspace<V>> denseSubspaces){
  int[][] means=computeMeans(denseSubspaces);
  double[][] diffs=computeDiffs(denseSubspaces,means[0],means[1]);
  double[] codeLength=new double[denseSubspaces.size()];
  double minCL=Double.MAX_VALUE;
  int min_i=-1;
  for (int i=0; i < denseSubspaces.size(); i++) {
    int mi=means[0][i];
    int mp=means[1][i];
    double log_mi=mi == 0 ? 0 : StrictMath.log(mi) / StrictMath.log(2);
    double log_mp=mp == 0 ? 0 : StrictMath.log(mp) / StrictMath.log(2);
    double diff_mi=diffs[0][i];
    double diff_mp=diffs[1][i];
    codeLength[i]=log_mi + diff_mi + log_mp+ diff_mp;
    if (codeLength[i] <= minCL) {
      minCL=codeLength[i];
      min_i=i;
    }
  }
  return denseSubspaces.subList(0,min_i + 1);
}

private List < CLIQUESubspace < V > > pruneDenseSubspaces ( List < CLIQUESubspace < V > > denseSubspaces ) { int [ ] [ ] means = computeMeans ( denseSubspaces ) ; double [ ] [ ] diffs = computeDiffs ( denseSubspaces , means [ 0 ] , means [ 1 ] ) ; double [ ] codeLength = new double [ denseSubspaces . size ( ) ] ; double minCL = Double . MAX_VALUE ; int min_i = - 1 ; for ( int i = 0 ; i < denseSubspaces . size ( ) ; i ++ ) { int mi = means [ 0 ] [ i ] ; int mp = means [ 1 ] [ i ] ; double log_mi = mi == 0 ? 0 : StrictMath . log ( mi ) / StrictMath . log ( 2 ) ; double log_mp = mp == 0 ? 0 : StrictMath . log ( mp ) / StrictMath . log ( 2 ) ; double diff_mi = diffs [ 0 ] [ i ] ; double diff_mp = diffs [ 1 ] [ i ] ; codeLength [ i ] = log_mi + diff_mi + log_mp + diff_mp ; if ( codeLength [ i ] <= minCL ) { minCL = codeLength [ i ] ; min_i = i ; } } return denseSubspaces . subList ( 0 , min_i + 1 ) ; }
performs a mdl - based pruning of the specified dense subspaces as described in the clique algorithm .
