Mantid
Loading...
Searching...
No Matches
TrustRegionMinimizer.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
13#include "MantidAPI/IFunction.h"
18
19namespace Mantid {
20namespace CurveFitting {
21namespace FuncMinimisers {
24class MANTID_CURVEFITTING_DLL TrustRegionMinimizer : public API::IFuncMinimizer {
25public:
29 void initialize(API::ICostFunction_sptr costFunction, size_t maxIterations = 0) override;
31 bool iterate(size_t) override;
33 double costFunctionVal() override;
35 std::string name() const override;
36
37private:
39 void evalF(const DoubleFortranVector &x, DoubleFortranVector &f) const;
41 void evalJ(const DoubleFortranVector &x, DoubleFortranMatrix &J) const;
43 void evalHF(const DoubleFortranVector &x, const DoubleFortranVector &f, DoubleFortranMatrix &h) const;
45 void calculateStep(const DoubleFortranMatrix &J, const DoubleFortranVector &f, const DoubleFortranMatrix &hf,
46 double Delta, DoubleFortranVector &d, double &normd, const NLLS::nlls_options &options);
47
49 std::shared_ptr<CostFunctions::CostFuncLeastSquares> m_leastSquares;
64
65 // Used for calculating step in DTRS method
67 DoubleFortranVector m_ew, m_v, m_v_trans, m_d_trans;
70};
71
72} // namespace FuncMinimisers
73} // namespace CurveFitting
74} // namespace Mantid
An interface for function minimizers.
Trust Region minimizer class using the DTRS method of GALAHAD.
NLLS::NLLS_workspace m_workspace
Temporary and helper objects.
std::shared_ptr< CostFunctions::CostFuncLeastSquares > m_leastSquares
Stored cost function.
NLLS::nlls_inform m_inform
Information about the fitting.
JacobianImpl1< DoubleFortranMatrix > m_J
The Jacobian.
API::IFunction_sptr m_function
Stored to access IFunction interface in iterate()
The implementation of Jacobian.
Definition: EigenJacobian.h:85
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class
Definition: IFunction.h:732
std::shared_ptr< ICostFunction > ICostFunction_sptr
define a shared pointer to a cost function
Definition: ICostFunction.h:60
Helper class which provides the Collimation Length for SANS instruments.
all workspaces called from the top level
Definition: Workspaces.h:251
workspace for subroutine allEigSymm
Definition: Workspaces.h:241
inform derived type with component defaults
Definition: Workspaces.h:157