1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2024-11-14 09:45:36 +00:00
LatAnalyze/lib/Minimizer.hpp

73 lines
2.9 KiB
C++
Raw Normal View History

2014-02-20 20:21:45 +00:00
/*
* Minimizer.hpp, part of LatAnalyze 3
*
2016-04-06 20:11:23 +01:00
* Copyright (C) 2013 - 2016 Antonin Portelli
2014-02-20 20:21:45 +00:00
*
* LatAnalyze 3 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LatAnalyze 3 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LatAnalyze 3. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef Latan_Minimizer_hpp_
#define Latan_Minimizer_hpp_
2014-03-13 18:51:01 +00:00
#include <LatAnalyze/Global.hpp>
#include <LatAnalyze/Function.hpp>
#include <LatAnalyze/Mat.hpp>
2014-09-22 15:19:30 +01:00
#include <LatAnalyze/Solver.hpp>
2014-02-20 20:21:45 +00:00
BEGIN_LATAN_NAMESPACE
2014-02-20 20:21:45 +00:00
/******************************************************************************
* Abstract minimizer class *
******************************************************************************/
2014-09-22 15:19:30 +01:00
class Minimizer: public Solver
2014-02-20 20:21:45 +00:00
{
public:
// constructor
Minimizer(void) = default;
2014-02-20 20:21:45 +00:00
// destructor
virtual ~Minimizer(void) = default;
// access
2016-04-01 21:39:49 +01:00
virtual void resize(const Index dim);
2014-10-14 16:34:27 +01:00
virtual double getHighLimit(const Index i) const ;
virtual const DVec & getHighLimit(const PlaceHolder ph = _) const;
virtual double getLowLimit(const Index i) const;
virtual const DVec & getLowLimit(const PlaceHolder ph = _) const;
virtual bool hasHighLimit(const Index i) const;
virtual bool hasLowLimit(const Index i) const;
virtual void setHighLimit(const Index i, const double l);
virtual void setHighLimit(const PlaceHolder ph, const DVec &l);
virtual void setLowLimit(const Index i, const double l);
virtual void setLowLimit(const PlaceHolder ph, const DVec &l);
virtual void useHighLimit(const Index i, const bool use = true);
virtual void useHighLimit(const PlaceHolder ph = _,
const bool use = true);
virtual void useLowLimit(const Index i, const bool use = true);
virtual void useLowLimit(const PlaceHolder ph = _,
const bool use = true);
2016-04-12 20:10:37 +01:00
virtual bool supportLimits(void) const = 0;
2016-04-01 21:39:49 +01:00
virtual unsigned int getMaxPass(void) const;
virtual void setMaxPass(const unsigned int maxPass);
2014-02-20 20:21:45 +00:00
// minimization
virtual const DVec & operator()(const DoubleFunction &f) = 0;
2014-10-14 16:34:27 +01:00
private:
2016-04-01 21:39:49 +01:00
DVec highLimit_, lowLimit_;
Vec<bool> hasHighLimit_, hasLowLimit_;
unsigned int maxPass_{5u};
2014-02-20 20:21:45 +00:00
};
END_LATAN_NAMESPACE
2014-02-20 20:21:45 +00:00
#endif // Latan_Minimizer_hpp_