Buggy code:
public abstract class DirectSearchOptimizer { protected DirectSearchOptimizer ( ) { } public PointCostPair minimizes ( CostFunction f , int maxEvaluations , ConvergenceChecker checker , double [ ] vertexA , double [ ] vertexB ) throws ConvergenceException , CostException { } public PointCostPair minimizes ( CostFunction f , int maxEvaluations , ConvergenceChecker checker , double [ ] vertexA , double [ ] vertexB , int starts , long seed ) throws ConvergenceException , CostException { } public PointCostPair minimizes ( CostFunction f , int maxEvaluations , ConvergenceChecker checker , double [ ] [ ] vertices ) throws ConvergenceException , CostException { } public PointCostPair minimizes ( CostFunction f , int maxEvaluations , ConvergenceChecker checker , double [ ] [ ] vertices , int starts , long seed ) throws ConvergenceException , CostException , NotPositiveDefiniteMatrixException { try { buildSimplex ( vertices ) ; VectorialMean meanStat = new VectorialMean ( vertices [ 0 ] . length ) ; <START_BUG> VectorialCovariance covStat = new VectorialCovariance ( vertices [ 0 ] . length ) ; <END_BUG> for ( int i = 0 ; i < ( vertices . length ) ; ++ i ) { meanStat . increment ( vertices [ i ] ) ; covStat . increment ( vertices [ i ] ) ; } double [ ] mean = meanStat . getResult ( ) ; RealMatrix covariance = covStat . getResult ( ) ; RandomGenerator rg = new JDKRandomGenerator ( ) ; rg . setSeed ( seed ) ; RandomVectorGenerator rvg = new org . apache . commons . math . random . CorrelatedRandomVectorGenerator ( mean , covariance , ( 1.0E-12 * ( covariance . getNorm ( ) ) ) , new org . apache . commons . math . random . UniformRandomGenerator ( rg ) ) ; setMultiStart ( starts , rvg ) ; return minimizes ( f , maxEvaluations , checker ) ; } catch ( DimensionMismatchException dme ) { throw new RuntimeException ( "internal<seq2seq4repair_space>error" ) ; } } public PointCostPair minimizes ( CostFunction f , int maxEvaluations , ConvergenceChecker checker , RandomVectorGenerator generator ) throws ConvergenceException , CostException { } public PointCostPair minimizes ( CostFunction f , int maxEvaluations , ConvergenceChecker checker , RandomVectorGenerator generator , int starts ) throws ConvergenceException , CostException { } private void buildSimplex ( double [ ] vertexA , double [ ] vertexB ) { } private void buildSimplex ( double [ ] [ ] vertices ) { } private void buildSimplex ( RandomVectorGenerator generator ) { } private void setSingleStart ( ) { } private void setMultiStart ( int starts , RandomVectorGenerator generator ) { } public PointCostPair [ ] getMinima ( ) { } private PointCostPair minimizes ( CostFunction f , int maxEvaluations , ConvergenceChecker checker ) throws ConvergenceException , CostException { } protected abstract void iterateSimplex ( ) throws CostException { } protected double evaluateCost ( double [ ] x ) throws CostException { } protected void evaluateSimplex ( ) throws CostException { } protected void replaceWorstPoint ( PointCostPair pointCostPair ) { } private static Comparator pointCostPairComparator = new Comparator ( ) { public int compare ( Object o1 , Object o2 ) { } } ; protected PointCostPair [ ] simplex ; private CostFunction f ; private int evaluations ; private int starts ; private RandomVectorGenerator generator ; private PointCostPair [ ] minima ; }

Fix:
VectorialCovariance covStat = new VectorialCovariance ( vertices [ 0 ] . length , true ) ;