From ded9235fb4260a13d6259d19c7b7717ee84212a8 Mon Sep 17 00:00:00 2001 From: Guangyang Wen Date: Fri, 17 Nov 2017 22:02:07 +0100 Subject: [PATCH] fix some type inconsistence --- include/cma-es/cmaes.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/cma-es/cmaes.h b/include/cma-es/cmaes.h index 98d89ec..4f8e8c9 100644 --- a/include/cma-es/cmaes.h +++ b/include/cma-es/cmaes.h @@ -825,7 +825,7 @@ template class CMAES { delete[] B; delete[] index; delete[] publicFitness; - delete[]-- functionValues; + delete[] functionValues; delete[]-- funcValueHistory; } @@ -887,9 +887,9 @@ template class CMAES { C = new T *[params.N]; B = new T *[params.N]; publicFitness = new T[params.lambda]; - functionValues = new T[params.lambda + 1]; - functionValues[0] = params.lambda; - ++functionValues; + functionValues = new T[params.lambda]; + // functionValues[0] = params.lambda; + // ++functionValues; const int historySize = 10 + (int)ceil(3. * 10. * params.N / params.lambda); funcValueHistory = new T[historySize + 1]; funcValueHistory[0] = (T)historySize;