1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2024-11-14 01:45:35 +00:00

Minimizer: limit initialisation fix

This commit is contained in:
Antonin Portelli 2015-11-13 16:25:16 +00:00
parent aeda59adfa
commit abd8bfc91c

View File

@ -25,7 +25,6 @@ using namespace Latan;
// constructor ///////////////////////////////////////////////////////////////// // constructor /////////////////////////////////////////////////////////////////
Minimizer::Minimizer(const Index dim) Minimizer::Minimizer(const Index dim)
: Solver(dim)
{ {
resize(dim); resize(dim);
} }
@ -33,11 +32,21 @@ Minimizer::Minimizer(const Index dim)
// access ////////////////////////////////////////////////////////////////////// // access //////////////////////////////////////////////////////////////////////
void Minimizer::resize(const Index dim) void Minimizer::resize(const Index dim)
{ {
const Index oldDim = getDim();
Solver::resize(dim); Solver::resize(dim);
highLimit_.conservativeResize(dim); highLimit_.conservativeResize(dim);
lowLimit_.conservativeResize(dim); lowLimit_.conservativeResize(dim);
hasHighLimit_.conservativeResize(dim); hasHighLimit_.conservativeResize(dim);
hasLowLimit_.conservativeResize(dim); hasLowLimit_.conservativeResize(dim);
if (dim > oldDim)
{
highLimit_.segment(oldDim, dim - oldDim).fill(0.);
highLimit_.segment(oldDim, dim - oldDim).fill(0.);
lowLimit_.segment(oldDim, dim - oldDim).fill(0.);
hasHighLimit_.segment(oldDim, dim - oldDim).fill(false);
hasLowLimit_.segment(oldDim, dim - oldDim).fill(false);
}
} }
// limits ////////////////////////////////////////////////////////////////////// // limits //////////////////////////////////////////////////////////////////////