Mantid
Loading...
Searching...
No Matches
Framework
CurveFitting
src
RalNlls
Workspaces.cpp
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
// This code was originally translated from Fortran code on
8
// https://ccpforge.cse.rl.ac.uk/gf/project/ral_nlls June 2016
9
#include "
MantidCurveFitting/RalNlls/Workspaces.h
"
10
11
namespace
Mantid::CurveFitting::NLLS
{
12
14
NLLS_workspace::NLLS_workspace
()
15
: first_call(0), iter(0), normF0(), normJF0(), normF(), normJF(), normJFold(), normJF_Newton(), Delta(), normd(),
16
use_second_derivatives(false), hybrid_count(0), hybrid_tol(1.0), tr_p(7) {}
17
22
void
NLLS_workspace::initialize
(
int
n
,
int
m
,
const
nlls_options
&options) {
23
24
tr_nu
= options.
radius_increase
;
25
26
J
.
allocate
(
m
,
n
);
27
f
.
allocate
(
m
);
28
fnew
.
allocate
(
m
);
29
hf
.
allocate
(
n
,
n
);
30
d
.
allocate
(
n
);
31
g
.
allocate
(
n
);
32
Xnew
.
allocate
(
n
);
33
y
.
allocate
(
n
);
34
y
.
zero
();
35
y_sharp
.
allocate
(
n
);
36
y_sharp
.
zero
();
37
38
if
(!options.
exact_second_derivatives
) {
39
g_old
.
allocate
(
n
);
40
g_mixed
.
allocate
(
n
);
41
Sks
.
allocate
(
n
);
42
ysharpSks
.
allocate
(
n
);
43
}
44
45
if
(options.
output_progress_vectors
) {
46
resvec
.
allocate
(options.
maxit
+ 1);
47
gradvec
.
allocate
(options.
maxit
+ 1);
48
}
49
50
if
(options.
calculate_svd_J
) {
51
largest_sv
.
allocate
(options.
maxit
+ 1);
52
smallest_sv
.
allocate
(options.
maxit
+ 1);
53
}
54
55
if
(options.
model
== 3) {
56
hf_temp
.
allocate
(
n
,
n
);
57
}
58
}
59
60
}
// namespace Mantid::CurveFitting::NLLS
n
size_t n
Definition
AugmentedLagrangianOptimizer.cpp:42
Workspaces.h
Mantid::CurveFitting::EigenVector::zero
void zero()
Definition
EigenVector.cpp:134
Mantid::CurveFitting::FortranMatrix::allocate
void allocate(const int iFrom, const int iTo, const int jFrom, const int jTo)
Resize the matrix.
Definition
EigenFortranMatrix.h:103
Mantid::CurveFitting::FortranVector::allocate
void allocate(int firstIndex, int lastIndex)
Resize the vector.
Definition
EigenFortranVector.h:85
Mantid::CurveFitting::NLLS
Definition
TrustRegion.h:15
Mantid::Geometry::m
z F d m
Definition
SpaceGroupFactory.cpp:802
Mantid::CurveFitting::NLLS::NLLS_workspace::NLLS_workspace
NLLS_workspace()
Constructor of the workspace.
Definition
Workspaces.cpp:14
Mantid::CurveFitting::NLLS::NLLS_workspace::Sks
DoubleFortranVector Sks
Definition
Workspaces.h:269
Mantid::CurveFitting::NLLS::NLLS_workspace::J
DoubleFortranMatrix J
Definition
Workspaces.h:264
Mantid::CurveFitting::NLLS::NLLS_workspace::g_mixed
DoubleFortranVector g_mixed
Definition
Workspaces.h:268
Mantid::CurveFitting::NLLS::NLLS_workspace::Xnew
DoubleFortranVector Xnew
Definition
Workspaces.h:267
Mantid::CurveFitting::NLLS::NLLS_workspace::hf_temp
DoubleFortranMatrix hf_temp
Definition
Workspaces.h:266
Mantid::CurveFitting::NLLS::NLLS_workspace::gradvec
DoubleFortranVector gradvec
Definition
Workspaces.h:270
Mantid::CurveFitting::NLLS::NLLS_workspace::ysharpSks
DoubleFortranVector ysharpSks
Definition
Workspaces.h:269
Mantid::CurveFitting::NLLS::NLLS_workspace::initialize
void initialize(int n, int m, const nlls_options &options)
Initialize the workspace.
Definition
Workspaces.cpp:22
Mantid::CurveFitting::NLLS::NLLS_workspace::largest_sv
DoubleFortranVector largest_sv
Definition
Workspaces.h:271
Mantid::CurveFitting::NLLS::NLLS_workspace::tr_nu
double tr_nu
Definition
Workspaces.h:261
Mantid::CurveFitting::NLLS::NLLS_workspace::hf
DoubleFortranMatrix hf
Definition
Workspaces.h:266
Mantid::CurveFitting::NLLS::NLLS_workspace::f
DoubleFortranVector f
Definition
Workspaces.h:265
Mantid::CurveFitting::NLLS::NLLS_workspace::fnew
DoubleFortranVector fnew
Definition
Workspaces.h:265
Mantid::CurveFitting::NLLS::NLLS_workspace::smallest_sv
DoubleFortranVector smallest_sv
Definition
Workspaces.h:271
Mantid::CurveFitting::NLLS::NLLS_workspace::g
DoubleFortranVector g
Definition
Workspaces.h:267
Mantid::CurveFitting::NLLS::NLLS_workspace::y
DoubleFortranVector y
Definition
Workspaces.h:268
Mantid::CurveFitting::NLLS::NLLS_workspace::d
DoubleFortranVector d
Definition
Workspaces.h:267
Mantid::CurveFitting::NLLS::NLLS_workspace::g_old
DoubleFortranVector g_old
Definition
Workspaces.h:268
Mantid::CurveFitting::NLLS::NLLS_workspace::resvec
DoubleFortranVector resvec
Definition
Workspaces.h:270
Mantid::CurveFitting::NLLS::NLLS_workspace::y_sharp
DoubleFortranVector y_sharp
Definition
Workspaces.h:268
Mantid::CurveFitting::NLLS::nlls_options
Definition
Workspaces.h:33
Mantid::CurveFitting::NLLS::nlls_options::model
int model
specify the model used.
Definition
Workspaces.h:46
Mantid::CurveFitting::NLLS::nlls_options::maxit
int maxit
the maximum number of iterations performed
Definition
Workspaces.h:38
Mantid::CurveFitting::NLLS::nlls_options::output_progress_vectors
bool output_progress_vectors
Shall we output progess vectors at termination of the routine?
Definition
Workspaces.h:152
Mantid::CurveFitting::NLLS::nlls_options::radius_increase
double radius_increase
on very successful iterations, the trust-region radius will be increased by the factor ....
Definition
Workspaces.h:99
Mantid::CurveFitting::NLLS::nlls_options::calculate_svd_J
bool calculate_svd_J
Definition
Workspaces.h:131
Mantid::CurveFitting::NLLS::nlls_options::exact_second_derivatives
bool exact_second_derivatives
shall we use explicit second derivatives, or approximate using a secant method
Definition
Workspaces.h:113
Generated by
1.9.8