summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sccomp/source/solver/CoinMPSolver.cxx1
-rw-r--r--sccomp/source/solver/DifferentialEvolution.hxx1
-rw-r--r--sccomp/source/solver/LpsolveSolver.cxx1
-rw-r--r--sccomp/source/solver/ParticelSwarmOptimization.hxx1
4 files changed, 4 insertions, 0 deletions
diff --git a/sccomp/source/solver/CoinMPSolver.cxx b/sccomp/source/solver/CoinMPSolver.cxx
index 2b1ddd7227d7..23426e140e42 100644
--- a/sccomp/source/solver/CoinMPSolver.cxx
+++ b/sccomp/source/solver/CoinMPSolver.cxx
@@ -63,6 +63,7 @@ void SAL_CALL CoinMPSolver::solve()
// collect variables in vector (?)
std::vector<table::CellAddress> aVariableCells;
+ aVariableCells.reserve(maVariables.getLength());
for (sal_Int32 nPos=0; nPos<maVariables.getLength(); nPos++)
aVariableCells.push_back( maVariables[nPos] );
size_t nVariables = aVariableCells.size();
diff --git a/sccomp/source/solver/DifferentialEvolution.hxx b/sccomp/source/solver/DifferentialEvolution.hxx
index 2ced9b9d209e..7d18821350aa 100644
--- a/sccomp/source/solver/DifferentialEvolution.hxx
+++ b/sccomp/source/solver/DifferentialEvolution.hxx
@@ -76,6 +76,7 @@ public:
// Initialize population with individuals that have been initialized with uniform random
// noise
// uniform noise means random value inside your search space
+ maPopulation.reserve(mnPopulationSize);
for (size_t i = 0; i < mnPopulationSize; ++i)
{
maPopulation.emplace_back();
diff --git a/sccomp/source/solver/LpsolveSolver.cxx b/sccomp/source/solver/LpsolveSolver.cxx
index 8a6d32856760..6a6c55d961ad 100644
--- a/sccomp/source/solver/LpsolveSolver.cxx
+++ b/sccomp/source/solver/LpsolveSolver.cxx
@@ -100,6 +100,7 @@ void SAL_CALL LpsolveSolver::solve()
// collect variables in vector (?)
std::vector<table::CellAddress> aVariableCells;
+ aVariableCells.reserve(maVariables.getLength());
for (sal_Int32 nPos=0; nPos<maVariables.getLength(); nPos++)
aVariableCells.push_back( maVariables[nPos] );
size_t nVariables = aVariableCells.size();
diff --git a/sccomp/source/solver/ParticelSwarmOptimization.hxx b/sccomp/source/solver/ParticelSwarmOptimization.hxx
index 6c820ab7978c..ec76474ddece 100644
--- a/sccomp/source/solver/ParticelSwarmOptimization.hxx
+++ b/sccomp/source/solver/ParticelSwarmOptimization.hxx
@@ -92,6 +92,7 @@ public:
mfBestFitness = std::numeric_limits<float>::lowest();
+ maSwarm.reserve(mnNumOfParticles);
for (size_t i = 0; i < mnNumOfParticles; i++)
{
maSwarm.emplace_back(mnDimensionality);