Mantid
Loading...
Searching...
No Matches
TrustRegion.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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#include "MantidCurveFitting/DllConfig.h"
12
13namespace Mantid {
14namespace CurveFitting {
15namespace NLLS {
16
17void MANTID_CURVEFITTING_DLL matmultInner(const DoubleFortranMatrix &J, DoubleFortranMatrix &A);
18void MANTID_CURVEFITTING_DLL getSvdJ(const DoubleFortranMatrix &J, double &s1, double &sn);
19double MANTID_CURVEFITTING_DLL norm2(const DoubleFortranVector &v);
20void MANTID_CURVEFITTING_DLL multJ(const DoubleFortranMatrix &J, const DoubleFortranVector &x, DoubleFortranVector &Jx);
21void MANTID_CURVEFITTING_DLL multJt(const DoubleFortranMatrix &J, const DoubleFortranVector &x,
24 const DoubleFortranVector &d, const nlls_options &options, evaluate_model_work &w);
25double calculateRho(double normf, double normfnew, double md, const nlls_options &options);
26void updateTrustRegionRadius(double &rho, const nlls_options &options, NLLS_workspace &w);
28void testConvergence(double normF, double normJF, double normF0, double normJF0, const nlls_options &options,
29 nlls_inform &inform);
31 DoubleFortranVector &scale, const nlls_options &options);
33// void apply_second_order_info(int n, int m, const DoubleFortranVector& X,
34// NLLS_workspace& w, eval_hf_type evalHF, params_base_type params,
35// const nlls_options& options, nlls_inform& inform, const DoubleFortranVector&
36// weights);
37
38} // namespace NLLS
39} // namespace CurveFitting
40} // namespace Mantid
void rankOneUpdate(DoubleFortranMatrix &hf, NLLS_workspace &w)
Update the Hessian matrix without actually evaluating it (quasi-Newton?)
double calculateRho(double normf, double normfnew, double md, const nlls_options &options)
Calculate the quantity 0.5||f||^2 - 0.5||fnew||^2 actual_reduction rho = -----------------------— = -...
double evaluateModel(const DoubleFortranVector &f, const DoubleFortranMatrix &J, const DoubleFortranMatrix &hf, const DoubleFortranVector &d, const nlls_options &options, evaluate_model_work &w)
Input: f = f(x_k), J = J(x_k), hf = \sum_{i=1}^m f_i(x_k) \nabla^2 f_i(x_k) (or an approx)
void MANTID_CURVEFITTING_DLL matmultInner(const DoubleFortranMatrix &J, DoubleFortranMatrix &A)
Takes an m x n matrix J and forms the n x n matrix A given by A = J' * J.
Definition: TrustRegion.cpp:31
double MANTID_CURVEFITTING_DLL norm2(const DoubleFortranVector &v)
Compute the 2-norm of a vector which is a square root of the sum of squares of its elements.
Definition: TrustRegion.cpp:57
void testConvergence(double normF, double normJF, double normF0, double normJF0, const nlls_options &options, nlls_inform &inform)
Test the convergence.
void updateTrustRegionRadius(double &rho, const nlls_options &options, NLLS_workspace &w)
Update the trust region radius which is hidden in NLLS_workspace w (w.Delta).
void allEigSymm(const DoubleFortranMatrix &A, DoubleFortranVector &ew, DoubleFortranMatrix &ev)
Calculate all the eigenvalues of a symmetric matrix.
void MANTID_CURVEFITTING_DLL multJ(const DoubleFortranMatrix &J, const DoubleFortranVector &x, DoubleFortranVector &Jx)
Multiply a matrix by a vector.
Definition: TrustRegion.cpp:68
void MANTID_CURVEFITTING_DLL multJt(const DoubleFortranMatrix &J, const DoubleFortranVector &x, DoubleFortranVector &Jtx)
Multiply a transposed matrix by a vector.
Definition: TrustRegion.cpp:82
void MANTID_CURVEFITTING_DLL getSvdJ(const DoubleFortranMatrix &J, double &s1, double &sn)
Given an (m x n) matrix J held by columns as a vector, this routine returns the largest and smallest ...
Definition: TrustRegion.cpp:45
void applyScaling(const DoubleFortranMatrix &J, DoubleFortranMatrix &A, DoubleFortranVector &v, DoubleFortranVector &scale, const nlls_options &options)
Apply_scaling input Jacobian matrix, J ouput scaled Hessisan, H, and J^Tf, v.
Helper class which provides the Collimation Length for SANS instruments.
all workspaces called from the top level
Definition: Workspaces.h:251
workspace for subroutine evaluateModel
Definition: Workspaces.h:222
inform derived type with component defaults
Definition: Workspaces.h:157