9#include "MantidCurveFitting/DllConfig.h"
12#include <boost/function.hpp>
15namespace CurveFitting {
24class UnconstrainedCostFunction;
57 using ObjFunction = boost::function<double(
const size_t,
const double *)>;
70 : m_userfunc(objfunc), m_nparams(nparams), m_neq(0), m_eq(), m_nineq(0), m_ineq(), m_maxIter(500) {}
87 : m_userfunc(objfunc), m_nparams(nparams), m_neq(equality.numRows()), m_eq(equality),
88 m_nineq(inequality.numRows()), m_ineq(inequality), m_maxIter(500) {
89 checkConstraints(equality, inequality);
115 void minimize(std::vector<double> &xv)
const;
118 friend class UnconstrainedCostFunction;
120 void unconstrainedOptimization(
const std::vector<double> &
lambda,
const std::vector<double> &
mu,
const double rho,
121 std::vector<double> &xcur)
const;
const std::vector< double > * lambda
Implements the Augmented Lagrangian optimization method of Birgin & Martinez.
Kernel::DblMatrix m_eq
Defines the equality constraints.
AugmentedLagrangianOptimizer()=delete
Disable default constructor.
AugmentedLagrangianOptimizer & operator=(const AugmentedLagrangianOptimizer &)=delete
Disable assignment operator.
void setMaxIterations(const int maxIter)
Override the maximum number of iterations (Default = 500)
const size_t m_neq
Number of equality constraints.
AugmentedLagrangianOptimizer(const AugmentedLagrangianOptimizer &)=delete
Disable copy operator.
AugmentedLagrangianOptimizer(const size_t nparams, const ObjFunction &objfunc, const Kernel::DblMatrix &equality, const Kernel::DblMatrix &inequality)
Constructor with constraints.
int m_maxIter
Maximum number of iterations.
size_t numParameters() const
size_t numEqualityConstraints() const
boost::function< double(const size_t, const double *)> ObjFunction
Function type.
AugmentedLagrangianOptimizer(const size_t nparams, const ObjFunction &objfunc)
Constructor.
const size_t m_nparams
Number of parameters under minimization.
ObjFunction m_userfunc
User-defined function.
Kernel::DblMatrix m_ineq
Defines the inequality constraints.
const size_t m_nineq
Number of inequality constraints.
size_t numInequalityConstraints() const
OptimizerResult
The results of the optimization.
Helper class which provides the Collimation Length for SANS instruments.